0

I am playing around with Java Z3 API for a research problem and I am really confused about how this is happening:

I create a Solver object and add a number of assertions, and repeatedly call the check() method, adding additional assertions each time, until it returns UNSATISFIABLE. Once it does, I call the getAssertions() method on the original Solver object and add all the assertions to a new Solver object creating using the same Context object using mkSolver(). When I call check() on the new Solver object, it returns SATISFIABLE.

How can two different SOLVER objects with identical assertions and parameters be different in terms of satisfiablity? I'm not sure about the the models are used for evaluating satisfiability.

chittychitty
  • 419
  • 5
  • 12
  • I'm not familiar with the Java API. But for `get-assertions` to work in regular SMT-Lib, you have to explicitly tell the solver to produce these assertions first. See page 56 of http://smtlib.cs.uiowa.edu/papers/smt-lib-reference-v2.6-r2017-07-18.pdf. Perhaps when you do `getAssertions` you merely get an empty list since you haven't told the solver to produce them first? I'd start by checking if the number of assertions you get is a reasonable one. – alias Apr 16 '18 at 05:21
  • Yes. I'm doing that. They have the exact same assertions – chittychitty Apr 16 '18 at 11:36
  • If you think this is a bug, please submit a self-contained, fully reproducible example to the Z3 issue tracker: https://github.com/z3prover/z3 – Christoph Wintersteiger Apr 16 '18 at 13:26

0 Answers0