3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-27 02:45:51 +00:00

Merge branch 'polysat' of https://github.com/z3prover/z3 into polysat

This commit is contained in:
Nikolaj Bjorner 2021-09-13 13:14:29 +02:00
commit 6ffcea0bde
3 changed files with 27 additions and 77 deletions

View file

@ -495,18 +495,7 @@ namespace polysat {
/** Conflict resolution case where propagation 'v := ...' is on top of the stack */
void solver::resolve_value(pvar v) {
if (m_conflict.is_bailout()) {
for (auto c : m_cjust[v])
m_conflict.insert(c);
return;
}
// Value Resolution
if (!m_conflict.resolve_value(v, m_cjust[v])) {
// Failed to resolve => bail out
++m_stats.m_num_bailouts;
m_conflict.set_bailout();
}
m_conflict.resolve_value(v, m_cjust[v]);
}
/** Conflict resolution case where boolean literal 'lit' is on top of the stack */
@ -600,12 +589,11 @@ namespace polysat {
rational val = m_value[v];
LOG_H3("Reverting decision: pvar " << v << " := " << val);
SASSERT(m_justification[v].is_decision());
unsigned const lvl = m_justification[v].level();
clause_ref lemma = m_conflict.build_lemma(lvl).build();
clause_ref lemma = m_conflict.build_lemma().build();
m_conflict.reset();
backjump(lvl - 1);
backjump(m_justification[v].level() - 1);
// The justification for this restriction is the guessed constraint from the lemma.
// cjust[v] will be updated accordingly by decide_bool.
@ -653,9 +641,8 @@ namespace polysat {
// - propagation of L' from L
// (L')^{L' \/ ¬L \/ ...}
// again L is in core, unless we core-reduced it away
unsigned const lvl = m_bvars.level(var);
clause_builder reason_builder = m_conflict.build_lemma(lvl);
clause_builder reason_builder = m_conflict.build_lemma();
m_conflict.reset();
bool contains_lit = std::find(reason_builder.begin(), reason_builder.end(), ~lit);
@ -679,7 +666,7 @@ namespace polysat {
clause* lemma = m_bvars.lemma(var); // need to grab this while 'lit' is still assigned
SASSERT(lemma);
backjump(lvl - 1);
backjump(m_bvars.level(var) - 1);
add_lemma(reason);
propagate_bool(~lit, reason.get());