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

Implement Solver Interrupt and SMT2 Log in Java #3382

Closed
baierd opened this issue Mar 17, 2020 · 4 comments
Closed

Implement Solver Interrupt and SMT2 Log in Java #3382

baierd opened this issue Mar 17, 2020 · 4 comments

Comments

@baierd
Copy link

baierd commented Mar 17, 2020

In Issues #867 and #1006 the ability to interrupt single solvers as well as the ability to log in SMT-LIB2 format was added.
However this is not possible in Java at the moment. (As far as i am not mistaken)
It would be great if you could add this to the Java wrapper.

@NikolajBjorner
Copy link
Contributor

You can set interrupt on a context, this cancels the solver based on the context.
The method is called "interrupt" and defined on the Context object.

The "toString" method on the Solver object prints the solver state in SMTLIB2 format.

@baierd
Copy link
Author

baierd commented Mar 17, 2020

I am aware of both proposed workarounds but they are not useful for our project.
I am an colleague of @PhilippWendler and work on the same project as he does, hence why i mentioned the 2 issues in particular.

@NikolajBjorner
Copy link
Contributor

Regarding logging to an SMT2 file: It is an option on the solver object.
You should set this option (smtlib2_log) before invoking calls on the solver.
There is no specific Java support required for this feature.

z3 /pm:solver
[module] solver, description: solver parameters
cancel_backup_file (symbol) file to save partial search state if search is canceled (default: )
enforce_model_conversion (bool) apply model transformation on new assertions (default: false)
smtlib2_log (symbol) file to save solver interaction (default: )
timeout (unsigned int) timeout on the solver object; overwrites a global timeout (default: 4294967295)

@NikolajBjorner
Copy link
Contributor

regarding the missing call to interrupt the solver object selectively. This was indeed implemented, but absent from the Java API. It has now been added.

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

No branches or pull requests

2 participants