3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-27 19:05:51 +00:00
This commit is contained in:
Jakob Rath 2022-09-29 18:25:28 +02:00
parent 8242069ba6
commit 9b907d709f
4 changed files with 23 additions and 8 deletions

View file

@ -287,7 +287,7 @@ namespace polysat {
if (c.is_always_true())
return;
LOG("Inserting " << lit_pp(s, c));
SASSERT(c.bvalue(s) == l_true);
SASSERT_EQ(c.bvalue(s), l_true);
SASSERT(!c.is_always_false()); // if we added c, the core would be a tautology
SASSERT(!c->vars().empty());
m_literals.insert(c.blit().index());

View file

@ -102,7 +102,7 @@ namespace polysat {
core.insert_eval(d);
if (c.bvalue(s) != l_false) // conflict is due to the evaluation of c, so it depends on the variable values
core.insert_vars(c);
core.insert(~c);
core.insert_eval(~c);
core.set_backjump();
core.logger().log(inf_name);
LOG("Core " << core);

View file

@ -246,6 +246,7 @@ namespace polysat {
*/
void solver::propagate(sat::literal lit) {
LOG_H2("Propagate bool " << lit << "@" << m_bvars.level(lit) << " " << m_level << " qhead: " << m_qhead);
LOG("Literal " << lit_pp(*this, lit));
signed_constraint c = lit2cnstr(lit);
SASSERT(c);
// TODO: review active and activate_constraint
@ -471,6 +472,7 @@ namespace polysat {
case trail_instr_t::pwatch_i: {
constraint* c = m_pwatch_trail.back();
erase_pwatch(c);
c->set_active(false); // TODO: review meaning of "active"
m_pwatch_trail.pop_back();
break;
}
@ -789,7 +791,7 @@ namespace polysat {
*/
void solver::revert_decision(pvar v) {
rational val = m_value[v];
LOG_H3("Reverting decision: pvar " << v << " := " << val);
LOG_H2("Reverting decision: pvar " << v << " := " << val);
SASSERT(m_justification[v].is_decision());
clause_ref lemma = m_conflict.build_lemma();
@ -1015,6 +1017,10 @@ namespace polysat {
}
if (c->is_pwatched())
out << " pwatched";
if (c->is_active())
out << " active";
if (c->is_external())
out << " ext";
out << " ]";
return out;
}
@ -1087,8 +1093,8 @@ namespace polysat {
}
unsigned expected_watches = std::min(2u, c->vars().size());
if (num_watches != expected_watches)
LOG("wrong number of watches: " << sc.blit() << ": " << sc << " (vars: " << sc->vars() << ")");
SASSERT_EQ(num_watches, expected_watches);
LOG("Wrong number of watches: " << sc.blit() << ": " << sc << " (vars: " << sc->vars() << ")");
VERIFY_EQ(num_watches, expected_watches);
}
return true;
}