Skip to content
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

Instanciar z3 solver #4

Open
samuelbarbosazup opened this issue Jul 14, 2020 · 2 comments
Open

Instanciar z3 solver #4

samuelbarbosazup opened this issue Jul 14, 2020 · 2 comments
Labels
question Further information is requested

Comments

@samuelbarbosazup
Copy link

How can I instantiate the z3 solver and if possible how to pass a formula for testing?

@sim642
Copy link
Owner

sim642 commented Jul 15, 2020

Since I created this for just my own use in another project, it really lacks documentation or comprehensive features (and is massively outdated Z3 now).

I don't have a simple example script either, but it exposes the Z3Em object, which is an emscripten object with all of its standard features. Some example of initialization:
https://github.com/sim642/einstein-js/blob/d1fd63549cad60e2485b768f8a475fab425e9bcf/src/z3/Z3.ts#L15-L22.
To use the initialized emscripten object, you can wrap the few C functions that are exported like this:
https://github.com/sim642/einstein-js/blob/d1fd63549cad60e2485b768f8a475fab425e9bcf/src/z3/Z3.ts#L72-L82.
Basic usage can be seen here (creating config, context and evaluating smtlib2 formulae): https://github.com/sim642/einstein-js/blob/d1fd63549cad60e2485b768f8a475fab425e9bcf/src/puzzle/generate/Z3HintsGenerator.ts#L25-L54.

@sim642 sim642 added the question Further information is requested label Jul 15, 2020
@samuelbarbosazup
Copy link
Author

Thanks a lot, very helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants