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

Polysat: expand conflict explanation rules (#5366)

* update example to match slides

* Add normalized view of inequalities

* workaround

* Add a conflict explanation rule

* unit clauses should be asserted at the base level

* Add src constraint to interval

* support non-strict case in first rule

* print conflict constraints only once

* update second rule

* update third rule as well
This commit is contained in:
Jakob Rath 2021-06-23 19:12:39 +02:00 committed by GitHub
parent dec37aee34
commit 20a5baeb70
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 249 additions and 159 deletions

View file

@ -919,7 +919,14 @@ namespace polysat {
void solver::propagate_bool(sat::literal lit, clause* reason) {
LOG("Propagate boolean literal " << lit << " @ " << m_level << " by " << show_deref(reason));
SASSERT(reason);
assign_bool_backtrackable(lit, reason, nullptr);
if (reason->literals().size() == 1) {
SASSERT(reason->literals()[0] == lit);
constraint* c = m_constraints.lookup(lit.var());
m_redundant.push_back(c);
activate_constraint_base(c);
}
else
assign_bool_backtrackable(lit, reason, nullptr);
}
/// Assign a boolean literal and put it on the search stack,
@ -1018,7 +1025,7 @@ namespace polysat {
if (lemma->size() < 2) {
LOG_H1("TODO: this should be treated as unit constraint and asserted at the base level!");
}
SASSERT(lemma->size() > 1);
// SASSERT(lemma->size() > 1);
clause* cl = m_constraints.insert(std::move(lemma));
m_redundant_clauses.push_back(cl);
}