Closed MarianAldenhoevel closed 5 years ago
Thank you very much Nikolaj,
1) I am using 4.8.4 from https://github.com/z3prover/z3/releases on Windows 10. Are there newer binaries available? I don't quite feel up to building from source.
2) By "reading from the command line" do you suggest doing:
.\z3.exe -smt2 .\z3test.smt2
This just returns without printing any output
I have found the nightly builds, shame on me for not doing so earlier.
using z3-4.8.5.8c177c019b6c-x64-win my test-program works fine.
Regarding "reading from command-line".
I think it is absurd that the SMT module houses a function for which does not do what the name implies without even so much as a comment on the interface. Why would a parse_smtlib_file not put every single last thing that is in the file into the AST? If the user doesn't want something, they can go delete it. As it is, optimize has some functionality and so does Fixedpoint. Functionality that should be straightforward is scattered around inside different modules. Lots of the submodules have to_string, but no easy way to parse that back out.
Can I save the constraints I created for a Z3 solver and later reload them to continue looking for more solutions?
I have read #2095 and #1044 but I am not sure they talking are about the same thing. If so, feel free to ignore this question. I am very new to Z3 and SAT-solvers in general, so excuse me in that case.
My program generates a large set of constraints and lets
solver.check()
work on it. If the verdict issat
it interprets the model in my problem-space (as an image), adds a blocking clause and then callssolver.check()
again to try and find another solution.The total runtime is expected to be many days. If my machine dies or needs a reboot I currently have to start over. While I can easily create the initial constraints the blocking clauses are only found while working the problem. If possible I would like to create savepoints during the run capturing the state of the solver or at least the blocking clauses added so far.
I have learned there is the SMT-LIB2 format for stating the problem in a portable way and that Z3 and z3py have an API for saving and loading in that format. Unfortunately I cannot make it work.
Here's my example program which (pointlessly) saves and reloads:
For me it fails with:
Is this a problem with my understanding or my code? Can it be done like this? Are sexpr() and from_file() the right pair of API calls?
I am using Z3 and z3py 4.8.4 from here ([https://github.com/z3prover/z3/releases]) on Windows 10 64bit.