mirror of
https://github.com/Z3Prover/z3
synced 2025-07-23 12:48:53 +00:00
fix assertion violations (reported by Christoph Wintersteiger) at sage/bench_1300.smt2 and sage/bench/2861.smt2
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
825b72719c
commit
88675ec728
1 changed files with 8 additions and 7 deletions
|
@ -596,18 +596,19 @@ namespace sat {
|
||||||
clause_offset cls_off = it->get_clause_offset();
|
clause_offset cls_off = it->get_clause_offset();
|
||||||
clause & c = *(m_cls_allocator.get_clause(cls_off));
|
clause & c = *(m_cls_allocator.get_clause(cls_off));
|
||||||
TRACE("propagate_clause_bug", tout << "processing... " << c << "\nwas_removed: " << c.was_removed() << "\n";);
|
TRACE("propagate_clause_bug", tout << "processing... " << c << "\nwas_removed: " << c.was_removed() << "\n";);
|
||||||
if (c.was_removed()) {
|
if (c[0] == not_l)
|
||||||
|
std::swap(c[0], c[1]);
|
||||||
|
CTRACE("propagate_bug", c[1] != not_l, tout << "l: " << l << " " << c << "\n";);
|
||||||
|
if (c.was_removed() || c[1] != not_l) {
|
||||||
// Remark: this method may be invoked when the watch lists are not in a consistent state,
|
// Remark: this method may be invoked when the watch lists are not in a consistent state,
|
||||||
// and may contain dead/removed clauses.
|
// and may contain dead/removed clauses, or clauses with removed literals.
|
||||||
// See: sat_simplifier.cpp
|
// See: method propagate_unit at sat_simplifier.cpp
|
||||||
// So, we must check whether the clause was marked for deletion, and ignore it.
|
// So, we must check whether the clause was marked for deletion, or
|
||||||
|
// c[1] != not_l
|
||||||
*it2 = *it;
|
*it2 = *it;
|
||||||
it2++;
|
it2++;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (c[0] == not_l)
|
|
||||||
std::swap(c[0], c[1]);
|
|
||||||
CTRACE("propagate_bug", c[1] != not_l, tout << "l: " << l << " " << c << "\n";);
|
|
||||||
SASSERT(c[1] == not_l);
|
SASSERT(c[1] == not_l);
|
||||||
if (value(c[0]) == l_true) {
|
if (value(c[0]) == l_true) {
|
||||||
it2->set_clause(c[0], cls_off);
|
it2->set_clause(c[0], cls_off);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue