You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 2fccdf3
Browse filesBrowse the repository at this point in the historyBrowse files
Work around Z3 not producing models for some quantified expressions
Z3's solve_eqs preprocessor eliminates a Boolean symbol defined via
(assert (= symbol <quantified-expr>)) by substituting the quantified
expression, and then returns that quantified expression from get-value
instead of a Boolean value, which CBMC cannot parse (see
Z3Prover/z3#7743).
Emit the equivalence as two implications, (=> symbol <expr>) and
(=> <expr> symbol), which solve_eqs does not treat as an elimination
opportunity, while preserving logical equivalence. A let-binding shares
the quantified expression so that it is emitted only once. As this is a
Z3-specific problem, the workaround is gated on the Z3 solver; other
solvers keep the single equality assertion. Z3 >= 4.15.3 offers the
opt-in option smt.solve_eqs.non_ground (default: true), which avoids
this elimination when set to false, but Z3's default behaviour is
unchanged and older versions reject the option.
This reinstates
regression/cbmc-primitives/exists_memory_checks/smt_missing_range_check
as CORE: it was demoted to KNOWNBUG in b0eedde precisely because of
this Z3 misbehaviour. Likewise, regression/cbmc/z3/Issue5977.desc again
expects exactly "unknown", and Quantifiers-assertion,
Quantifiers-initialisation2, and Quantifiers-two-dimension-array now
pass with Z3 and are no longer tagged broken-z3-smt-backend. A unit test
in unit/solvers/smt2/smt2_conv.cpp additionally pins the exact SMT2
output for both Z3 and other solvers.
Quantifiers that reach Z3 via other definitions, such as an assignment
to a non-Boolean symbol, are handled in the next commit.
Runtime of `cbmc --z3` (Z3 4.8.12) is unchanged on the quantifier tests
that already passed before. Tests that previously stopped with an error
right after the first solver call now run to completion, e.g.,
Quantifiers-initialisation2 takes 11.9s (previously an error after
1.4s).
Co-authored-by: Kiro <kiro-agent@users.noreply.github.com>
0 commit comments