From 06a8987314f8f740c2c3b28f2e58ecf788a9ab5a Mon Sep 17 00:00:00 2001 From: Nikolaj Bjorner Date: Wed, 7 Jun 2023 15:59:25 -0700 Subject: [PATCH] fix #6748 destructive equality resolution uses an occurs check function that is only safe for quantifier-free formulas. In the special case where a bound variable is Boolean and occurs on a side of an equality the other side cannot have a quantifier. --- src/ast/rewriter/der.cpp | 4 ++-- src/smt/smt_context_pp.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ast/rewriter/der.cpp b/src/ast/rewriter/der.cpp index 0e28cf6f6..1e2a19d72 100644 --- a/src/ast/rewriter/der.cpp +++ b/src/ast/rewriter/der.cpp @@ -176,9 +176,9 @@ void der::reduce1(quantifier * q, expr_ref & r, proof_ref & pr) { var * v = nullptr; expr_ref t(m); - if (is_forall(q) && is_var_diseq(e, num_decls, v, t) && !occurs(v, t)) + if (is_forall(q) && is_var_diseq(e, num_decls, v, t) && !has_quantifiers(t) && !occurs(v, t)) r = m.mk_false(); - else if (is_exists(q) && is_var_eq(e, num_decls, v, t) && !occurs(v, t)) + else if (is_exists(q) && is_var_eq(e, num_decls, v, t) && !has_quantifiers(t) && !occurs(v, t)) r = m.mk_true(); else { expr_ref_vector literals(m); diff --git a/src/smt/smt_context_pp.cpp b/src/smt/smt_context_pp.cpp index a6088fdf7..fe86c6811 100644 --- a/src/smt/smt_context_pp.cpp +++ b/src/smt/smt_context_pp.cpp @@ -635,7 +635,7 @@ namespace smt { literal_vector lits; const_cast(*m_conflict_resolution).justification2literals(j.get_justification(), lits); out << "justification " << j.get_justification()->get_from_theory() << ": "; - // display_literals_smt2(out, lits); + display_literals_smt2(out, lits); break; } default: