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

assign_eh: check always-false before bool-false

This commit is contained in:
Jakob Rath 2023-02-22 08:58:11 +01:00
parent e3b3cd58ea
commit c76379c0cf

View file

@ -154,21 +154,10 @@ namespace polysat {
return; // no need to do anything if we already have a conflict at base level
sat::literal lit = c.blit();
LOG("New constraint " << c << " for " << dep);
switch (m_bvars.value(lit)) {
case l_false:
// Input literal contradicts current boolean state (e.g., opposite literals in the input)
// => conflict only flags the inconsistency
set_conflict_at_base_level(dep);
m_conflict.insert(~c); // ~c is true in the solver, need to track its original dependencies
return;
case l_true:
if (m_bvars.is_true(lit)) {
// constraint c is already asserted => ignore
SASSERT(m_bvars.level(lit) <= m_level);
return;
case l_undef:
break;
default:
UNREACHABLE();
}
switch (c.eval()) {
case l_false:
@ -183,6 +172,13 @@ namespace polysat {
default:
UNREACHABLE();
}
if (m_bvars.is_false(lit)) {
// Input literal contradicts current boolean state (e.g., opposite literals in the input)
// => conflict only flags the inconsistency
set_conflict_at_base_level(dep);
m_conflict.insert(~c); // ~c is true in the solver, need to track its original dependencies
return;
}
m_bvars.assumption(lit, m_level, dep);
m_trail.push_back(trail_instr_t::assign_bool_i);
m_search.push_boolean(lit);