mirror of
https://github.com/Z3Prover/z3
synced 2025-07-31 08:23:17 +00:00
Fix missing boolean propagation after boolean conflict
Usually in SAT solving, the conflict clause has at least two false literals at the max level (otherwise, the last literal would have been propagated at an earlier level). But here we are adding clauses on demand; so after backtracking we may have the case that the conflict clause has exactly one undefined literal that must be propagated explicitly.
This commit is contained in:
parent
783bd60598
commit
0d56edb65c
7 changed files with 66 additions and 20 deletions
|
@ -216,7 +216,7 @@ namespace polysat {
|
|||
logger().begin_conflict();
|
||||
}
|
||||
|
||||
void conflict::init(clause const& cl) {
|
||||
void conflict::init(clause& cl) {
|
||||
LOG("Conflict: clause " << cl);
|
||||
SASSERT(empty());
|
||||
m_level = s.m_level;
|
||||
|
@ -225,6 +225,14 @@ namespace polysat {
|
|||
SASSERT_EQ(c.bvalue(s), l_false);
|
||||
insert(~c);
|
||||
}
|
||||
|
||||
// NOTE: usually in SAT solving, the conflict clause has at least two false literals at the max level.
|
||||
// (otherwise, the last literal would have been propagated at an earlier level.)
|
||||
// This is not true if we add clauses on demand;
|
||||
// after backtracking we may have the case that the conflict clause has
|
||||
// exactly one undefined literal that must be propagated explicitly.
|
||||
m_lemmas.push_back(&cl);
|
||||
|
||||
SASSERT(!empty());
|
||||
logger().begin_conflict();
|
||||
}
|
||||
|
@ -330,6 +338,10 @@ namespace polysat {
|
|||
// TODO: pass to inference_logger (with name)
|
||||
}
|
||||
|
||||
void conflict::restore_lemma(clause_ref lemma) {
|
||||
m_lemmas.push_back(std::move(lemma));
|
||||
}
|
||||
|
||||
void conflict::remove(signed_constraint c) {
|
||||
SASSERT(contains(c));
|
||||
m_literals.remove(c.blit().index());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue