3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-23 09:05:31 +00:00

bugfix to elim_uncnstr to ensure nodes are created. Prepare smt_internalizer to replay unit literals

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2024-12-04 15:32:08 -08:00
parent 6ea4110b30
commit a17d4e68eb
4 changed files with 21 additions and 12 deletions

View file

@ -2381,7 +2381,7 @@ namespace smt {
unsigned i = units_to_reassert_lim;
unsigned sz = m_units_to_reassert.size();
for (; i < sz; i++) {
auto& [unit, sign, is_relevant] = m_units_to_reassert[i];
auto [unit, sign, is_relevant] = m_units_to_reassert[i];
bool gate_ctx = true;
internalize(unit, gate_ctx);
bool_var v = get_bool_var(unit);
@ -2389,7 +2389,7 @@ namespace smt {
assign(l, b_justification::mk_axiom());
if (is_relevant)
mark_as_relevant(l);
TRACE("reassert_units", tout << "reasserting #" << unit->get_id() << " " << sign << " @ " << m_scope_lvl << "\n";);
TRACE("reassert_units", tout << "reasserting #" << unit->get_id() << " " << sign << " @ " << m_scope_lvl << "\n";);
}
if (at_base_level())
m_units_to_reassert.reset();

View file

@ -1396,8 +1396,7 @@ namespace smt {
DEBUG_CODE(for (literal lit : simp_lits) SASSERT(get_assignment(lit) == l_true););
if (!simp_lits.empty()) {
j = mk_justification(unit_resolution_justification(*this, j, simp_lits.size(), simp_lits.data()));
}
}
break;
}
case CLS_TH_LEMMA:
@ -1423,6 +1422,7 @@ namespace smt {
unsigned activity = 1;
bool lemma = is_lemma(k);
m_stats.m_num_mk_lits += num_lits;
switch (num_lits) {
case 0:
if (j && !j->in_region())
@ -1431,12 +1431,16 @@ namespace smt {
set_conflict(j == nullptr ? b_justification::mk_axiom() : b_justification(j));
SASSERT(inconsistent());
return nullptr;
case 1:
case 1: {
literal unit = lits[0];
expr* atom = m_bool_var2expr[unit.var()];
if (j && !j->in_region())
m_justifications.push_back(j);
assign(lits[0], j);
inc_ref(lits[0]);
assign(unit, j);
inc_ref(unit);
// m_units_to_reassert.push_back({ expr_ref(atom, m), unit.sign(), is_relevant(unit) });
return nullptr;
}
case 2:
if (use_binary_clause_opt(lits[0], lits[1], lemma)) {
literal l1 = lits[0];