I am trying to use Z3 to explore the difference between two predicates, but the model contains exist
-expressions where I would expect boolean constants.
I have the following program in smtlib:
(set-option :produce-models true)
(declare-fun a (Int) Bool)
(declare-const t1 Bool)
(declare-const t2 Bool)
(assert (= t1 (exists ((i Int)) (and (a i) (or (= i 10) (= i 11) )))))
(assert (= t2 (exists ((i Int)) (and (a i) (and (< i 13) (< 9 i))))))
(assert (distinct t1 t2))
(check-sat)
(get-value (a))
(get-value (t1 t2))
I am trying to find the values for t1
and t2
when the problem is satisfiable.
Z3 responds with
sat
((a (store (store ((as const Array) true) 11 false) 10 false)))
((t1 (exists ((i Int)) (and (not (= i 10)) (not (= i 11)) (or (= i 10) (= i 11)))))
(t2 (exists ((i Int))
(and (not (= i 10)) (not (= i 11)) (not (<= 13 i)) (not (<= i 9))))))
The model for t1
and t2
does not give me boolean constants, but expressions. How can I persuade Z3 to give me the values of these expressions? (I believe the model for t1
is actually a contradiction, so it is always false.
I don't need to do this through smtlib, using the Z3 api would be sufficient.