Skip to content

Commit

Permalink
remove z3 again
Browse files Browse the repository at this point in the history
  • Loading branch information
HKalbasi committed Jan 18, 2024
1 parent aad203c commit d42e4e3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
24 changes: 10 additions & 14 deletions front/src/hakim/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { normalPrompt } from "../dialog";
import { fromRust } from "../i18n";
import { loadLibText } from "./lib_text";
import { hakimQueryImpl } from "./wasm_provider";
import { init } from "z3-solver";

declare let window: Window & {
ask_question: (q: string) => Promise<string>;
Expand Down Expand Up @@ -48,9 +47,6 @@ await window.hakimQueryLoad;

let queryLock = false;

const { Context, em } = await init();
const Z3 = Context('main');

const instance: Instance = new Proxy(
{},
{
Expand All @@ -70,16 +66,16 @@ const instance: Instance = new Proxy(
});
}
if (r && typeof r === "object" && r.Z3State) {
const solver = new Z3.Solver();

solver.fromString(r.Z3State);
solver.set("timeout", 1500);
let sat = await solver.check();
if (sat === 'unsat') {
r = "z3_solved";
} else {
r = "z3_cant_solve";
}
// const solver = new Z3.Solver();

// solver.fromString(r.Z3State);
// solver.set("timeout", 1500);
// let sat = await solver.check();
// if (sat === 'unsat') {
// r = "z3_solved";
// } else {
r = "z3_cant_solve";
// }
}
queryLock = false;
return r;
Expand Down
4 changes: 4 additions & 0 deletions front/src/hakim/z3_in_browser.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { init } from "z3-solver";

const { Context, em } = await init();
const Z3 = Context('main');

0 comments on commit d42e4e3

Please sign in to comment.