Repository navigation
|
In my application, I'm generating large z3 inputs representing verification conditions for non-trivial functions. Some pre/post conditions, or assertions, are written using quantifiers. These have a strong tendency to go into prover loops when mbqi is on. But I realize that I don't have a clear understanding of how Z3 handle quantifiers when mbqi is false. I thought that mbqi involved some sort of unification-like process to see if asserted quantifiers are mutually consistent, but that non-mbqi mode would simply use e-matching to find instantiations that might show a context to be unsatisfiable. The example I've attached is a distillation of a larger example. The predicate being proved essentially has the form Note that the first forall also includes a pattern, which is the precise text of one of the top-level sub-expressions of . As written, this yields unsat for me (with Z3 version 4.15.2 - 64 bit). If I turn mbqi, it works. Alternatively, if I comment out the pattern, it proves as well. My question is: how can this not work with the pattern, and with mbqi off? My assumption is that the consequent universal quantifier is negated, and therefore skolemized, but that the (select ...) term that is the same as the pattern would be created as an enode. Is there something going on that could alter this, so that the term is never available as a an enode to match? Any help on what I'm doing wrong here (or whethrer this is a bug -- perhaps fixed in a later version?) would be appreciated. |
Replies: 1 comment 1 reply
|
Your mental model is right: with I ran it with 4.15.3 (4.15.2 isn't on PyPI) and 5.3.0, same results on both:
After a Workarounds while you generate VCs:
|
Your mental model is right: with
mbqioff, Z3 only instantiates by E-matching. The negated consequent is skolemized, which puts(select (store (store ...) ...) k!0)into the E-graph, and that term should match your pattern. What breaks it in this file is the(push), not the pattern itself.I ran it with 4.15.3 (4.15.2 isn't on PyPI) and 5.3.0, same results on both:
unknown(incomplete quantifiers, 0 instantiations)(push)/(pop)unsat(check-sat)→(check-sat-using smt)unsatunsatAfter a
push, Z3 switches to its incremental solver, which handles the problem differently from a one-shotcheck-sat(…