I am using the following code snippet in z3 4.0 to convert a formula to CNF.
(set-logic QF_UF) ( set-option :produce-models true ) ; ------ snip ------- ; ; declarations, ; and assert statement ; of "original" formula ; here. ; ; ------ snap ------- ( apply ( then ( ! simplify :elim-and true ) tseitin-cnf ) )
I get something like the following:
(goals (goal ; ------ snip ------- ; ; Lot of lines here ; ; ------ snap ------- :precision precise :depth 2) )
I assumed that each of the expressions following goal is one of the CNF points, i.e. all of these expressions must be combined to get the actual formula. I will refer to this connection as a βcodedβ formula.
Obviously, the original formula and the encoded formula are not equivalent, since the encoded formula contains the new variables k!0, k!1, ... that encode Zeitin. However, I expected that they would be satisfactory or actually be satisfied with the same models (if you do not take into account the variables k!i ).
Ie, I expected (encoded formula) AND (NOT original formula) be unsatisfactory. Unfortunately, this does not seem to be the case; I have a counterexample where this check really returns sat .
Is this a bug in z3, am I using it incorrectly or are any of my assumptions invalid?
Georg source share