-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
node-compat: z3-solver #17171
Comments
One interesting thing though import { init } from "npm:z3-solver";
const { Context } = await init(); Actually downloads the wasm file as part of the deno downloading dependencies part So I didn't even need to give --allow-net, is this something I can do with my own deno modules ? |
now this causes a deno panic
|
sorry for the necropost, but this also causes infinite hanging. import { init } from "npm:z3-solver"
const { Context } = await init()
const { Int, And, solve } = Context("main")
const x = Int.const("x")
console.log(await solve(And(x.ge(10), x.le(9)))) System Infodeno 1.39.1+140e8be (canary, x86_64-unknown-linux-gnu) |
Advent of bug fixing :) |
I ran into a similar bug when trying to use the Optimize solver in deno. I was also able to reproduce the bug in #17171 (comment)
Case A and C work fine returning sat, and unsat respectively. However, case B gives me the error:
|
Obviously not the same, but in the meantime, its possible to use libpython for this, here is an example of the original snippet (requires z3-python library installed)
import { python } from "https://deno.land/x/python@0.4.3/mod.ts";
const z3 = python.import("z3");
const x = z3.Int("x");
const solver = z3.Solver();
solver.add(z3.And(x.__ge__(0), x.__le__(9)));
console.log(solver.check());
console.log(solver.model()); |
The error have changed in the last version
deno 1.42.0+bca0fe1 |
I just noticed that this issue is untagged, @satyarohith would be great if you tag this issue with npm-compat so it doesn't get lost |
error:
Also there seem to be a lint issue ?
The node packagae has z3-solver/browser recomends z3-solver/browser for browsers, but I don't know how to use this with deno becasue using
errors
The text was updated successfully, but these errors were encountered: