Consider the following SMTLIB program (on rise4fun here):
(set-option :auto_config false)
(set-option :smt.mbqi false)
(set-option :smt.arith.nl.gb false)
(declare-const n Int)
(declare-const i Int)
(declare-const r Int)
(assert (= i n))
(assert (= r (* i n)))
(push)
(assert (not (= r (* n n))))
(check-sat) ; unknown
(pop)
Although it appears to only require reasoning with syntactic equality, Z3 (4.3.2 official release, and also 4.4.0 b6c40c6c0eaf) nevertheless fails to show that the final assertion is unsat
.
Unexpectedly (at least for me), setting smt.arith.nl.gb
to true
makes the example verify (i.e. the check-sat
yields unsat
).
For what it's worth, here are some further observations:
The final assertion can be shown
unsat
if the multiplication is changed to(* i n)
or(* n i)
, respectivelyIt cannot be shown
unsat
if the multiplication is changed to(* i i)
(push)
and(pop)
don't appear to affect the example, i.e. they can be removed without affecting the described observations
Is this a bug or is there a reason that smt.arith.nl.gb
is required to show this example unsat
?