Skip to content

Commit

Permalink
track assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolajBjorner committed Jan 9, 2023
1 parent 64ec8ac commit a4d4e2e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/sat/smt/q_mbi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ namespace q {
if (ctx.values2root().find(e, n) && n->class_generation() <= generation_min)
eqs.push_back(m.mk_eq(sk, e));
}
m_solver->assert_expr(mk_or(eqs));
assert_expr(mk_or(eqs));
}

expr_ref mbqi::replace_model_value(expr* e) {
Expand Down Expand Up @@ -168,7 +168,7 @@ namespace q {
while (true) {
::solver::scoped_push _sp(*m_solver);
add_universe_restriction(*qb);
m_solver->assert_expr(qb->mbody);
assert_expr(qb->mbody);
++m_stats.m_num_checks;
lbool r = m_solver->check_sat(0, nullptr);
if (r == l_undef)
Expand Down Expand Up @@ -219,7 +219,7 @@ namespace q {
if (!proj)
break;
add_instantiation(q, proj);
m_solver->assert_expr(m.mk_not(mk_and(eqs)));
assert_expr(m.mk_not(mk_and(eqs)));
}
return i > 0;
}
Expand Down Expand Up @@ -392,7 +392,7 @@ namespace q {
if (!m_model->eval_expr(bounds, mbounds, true))
return;
mbounds = subst(mbounds, qb.vars);
m_solver->assert_expr(mbounds);
assert_expr(mbounds);
qb.domain_eqs.push_back(vbounds);
}

Expand Down Expand Up @@ -425,11 +425,18 @@ namespace q {
continue;
expr_ref meq = mk_or(meqs);
expr_ref veq = mk_or(veqs);
m_solver->assert_expr(meq);
assert_expr(meq);
qb.domain_eqs.push_back(veq);
}
}

void mbqi::assert_expr(expr* e) {
expr_ref _e(e, m);
TRACE("q", tout << _e << "\n");
m_solver->assert_expr(e);
}


/*
* Add bounds to sub-terms under uninterpreted functions for projection.
*/
Expand Down
1 change: 1 addition & 0 deletions src/sat/smt/q_mbi.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ namespace q {
void extract_free_vars(quantifier* q, q_body& qb);
void init_model();
void init_solver();
void assert_expr(expr* e);
mbp::project_plugin* get_plugin(app* var);
void add_plugin(mbp::project_plugin* p);
void add_instantiation(quantifier* q, expr_ref& proj);
Expand Down

0 comments on commit a4d4e2e

Please sign in to comment.