-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
What is the difference between Z3_solver_check()
and Z3_solver_check_assumptions()
?
#1152
Comments
check-assumptions originates with MiniSAT and other SAT solvers where selected literals are pushed on an assertion stack. It is then easy to use the SAT solver conflict mechanism to track if the assumptions are used in conflicts. In the end we can use the assumptions that are in the unsat core to track what subset of assumptions are inconsistent when taken in conjunction with the asserted formulas. Thus, assumptions are used to extract cores. After search completes learned clauses that don't contain the assumptions are thus independent of them and can be reused in the next SAT call. This is different from push/pop where all learned clauses under a push are removed. So even if the assumptions you use in one call are not leading to an answer "unsat" it is possible that the call involves learning some clauses that can remain valid for the next call. |
@NikolajBjorner Thanks for the explanation. Will Z3 do what you describe if Z3's SAT solver gets called? If I use my own custom tactic (that calls the |
tactics are not incremental, only solvers have a chance to be. If you create a solver from a tactic, the resulting solver just calls the tactic from scratch every time. |
Okay. So I would need to create the solver via Looking at the current implementation If that is the case then there are quite a few hoops to jump through to get at the incremental SAT solver
Is that correct? |
Yep, that looks like the only combination of facts that gets you the new SAT solver with incremental features. Bit-blasting is done in the preprocessing stage of the @NikolajBjorner I think we should make it easier to get at that. Those questions/requests will come up more than once. Maybe |
I would vote |
There is Z3_mk_solver_for("QF_FD") and Z3_mk_solver_for("QF_BV") already. |
Yes, in theory everything is possible! In practice, @delcypher : we tend to support the official SMT logics, so "SAT" would break that convention. But, we recently added "ALL" too... This gives you a good idea of what magic strings Z3 recognizes as logic names. It's not really worth fixing or even documenting though, because the whole idea of logic names is flawed and the SMT community is currently working out a solution. Ideally, Z3 should work without specifying a logic, as it will figure out what it needs and where it can cut corners (but that doesn't always work either...). |
…orks too. #1152 Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
Can this be closed now? |
@NikolajBjorner No. Although the question was answered the issue relating to access to the incremental sat solver remains unresolved (maybe a separate issue should be opened for that?). I noticed in 97e2632 you made |
Fd is for finite domains. It uses incsatsolver, otherwise compiles away enumeration, finite range integers and bitvectors. I see no internal motivation to maintain a separate solver. |
The answer is to use Z3_mk_solver_for("QF_FD"). Given that this option is by now somewhat mature, I will close this issue |
Aside from the fact that their interfaces are different and that
Z3_solver_check_assumptions()
doesn't modify the solver's assertion stack (thus avoiding use of push/pop) are these functions expected to perform differently in anyway?Personally I'm wondering if Z3 is expected perform better if the "assumptions" provided are satisfiable? This seems to hinted at on this old SMTLIB mailing list post but I'm wondering if this really is the case for Z3.
The text was updated successfully, but these errors were encountered: