3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-12 12:08:18 +00:00

fix bug in qe-lite reported in #1086: bookkeeping of unconstrained variables only works for quantifier-free formulas

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2017-06-19 18:22:30 -05:00
parent 02161f2ff7
commit 894c60bdf9
3 changed files with 13 additions and 3 deletions

View file

@ -558,6 +558,7 @@ extern "C" {
Z3_TRY; Z3_TRY;
LOG_Z3_get_sort(c, a); LOG_Z3_get_sort(c, a);
RESET_ERROR_CODE(); RESET_ERROR_CODE();
CHECK_IS_EXPR(a, 0);
Z3_sort r = of_sort(mk_c(c)->m().get_sort(to_expr(a))); Z3_sort r = of_sort(mk_c(c)->m().get_sort(to_expr(a)));
RETURN_Z3(r); RETURN_Z3(r);
Z3_CATCH_RETURN(0); Z3_CATCH_RETURN(0);

View file

@ -1491,8 +1491,10 @@ namespace fm {
unsigned sz = g.size(); unsigned sz = g.size();
for (unsigned i = 0; i < sz; i++) { for (unsigned i = 0; i < sz; i++) {
expr * f = g[i]; expr * f = g[i];
if (is_occ(f)) if (is_occ(f)) {
TRACE("qe_lite", tout << "OCC: " << mk_ismt2_pp(f, m) << "\n";);
continue; continue;
}
TRACE("qe_lite", tout << "not OCC:\n" << mk_ismt2_pp(f, m) << "\n";); TRACE("qe_lite", tout << "not OCC:\n" << mk_ismt2_pp(f, m) << "\n";);
quick_for_each_expr(proc, visited, f); quick_for_each_expr(proc, visited, f);
} }
@ -2221,6 +2223,9 @@ namespace fm {
void operator()(expr_ref_vector& fmls) { void operator()(expr_ref_vector& fmls) {
init(fmls); init(fmls);
init_use_list(fmls); init_use_list(fmls);
for (auto & f : fmls) {
if (has_quantifiers(f)) return;
}
if (m_inconsistent) { if (m_inconsistent) {
m_new_fmls.reset(); m_new_fmls.reset();
m_new_fmls.push_back(m.mk_false()); m_new_fmls.push_back(m.mk_false());

View file

@ -2180,8 +2180,12 @@ void theory_seq::internalize_eq_eh(app * atom, bool_var v) {
} }
bool theory_seq::internalize_atom(app* a, bool) { bool theory_seq::internalize_atom(app* a, bool) {
return internalize_term(a);
#if 0 #if 0
return internalize_term(a);
#else
if (is_skolem(m_eq, a)) {
return internalize_term(a);
}
context & ctx = get_context(); context & ctx = get_context();
bool_var bv = ctx.mk_bool_var(a); bool_var bv = ctx.mk_bool_var(a);
ctx.set_var_theory(bv, get_id()); ctx.set_var_theory(bv, get_id());
@ -2196,7 +2200,7 @@ bool theory_seq::internalize_atom(app* a, bool) {
m_util.str.is_suffix(a, e1, e2)) { m_util.str.is_suffix(a, e1, e2)) {
return internalize_term(to_app(e1)) && internalize_term(to_app(e2)); return internalize_term(to_app(e1)) && internalize_term(to_app(e2));
} }
if (is_accept(a) || is_reject(a) || is_skolem(m_eq, a) || is_step(a) || is_skolem(symbol("seq.is_digit"), a)) { if (is_accept(a) || is_reject(a) || is_step(a) || is_skolem(symbol("seq.is_digit"), a)) {
return true; return true;
} }
UNREACHABLE(); UNREACHABLE();