3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-29 20:05:51 +00:00
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2021-09-12 18:14:25 +02:00
commit e365ad0e9e
8 changed files with 39 additions and 42 deletions

View file

@ -138,14 +138,6 @@ namespace polysat {
m_constraints.shrink(j);
}
void conflict_core::keep(signed_constraint c) {
SASSERT(!c->has_bvar());
cm().ensure_bvar(c.get());
LOG("new constraint: " << c);
// Insert the temporary constraint from saturation into \Gamma.
handle_saturation_premises(c);
}
void conflict_core::resolve(constraint_manager const& m, sat::bool_var var, clause const& cl) {
// Note: core: x, y, z; corresponds to clause ~x \/ ~y \/ ~z
// clause: x \/ u \/ v
@ -177,7 +169,9 @@ namespace polysat {
}
/** If the constraint c is a temporary constraint derived by core saturation, insert it (and recursively, its premises) into \Gamma */
void conflict_core::handle_saturation_premises(signed_constraint c) {
void conflict_core::keep(signed_constraint c) {
cm().ensure_bvar(c.get());
LOG_H3("keeping: " << c);
// NOTE: maybe we should skip intermediate steps and just collect the leaf premises for c?
auto it = m_saturation_premises.find_iterator(c);
if (it == m_saturation_premises.end())
@ -186,9 +180,7 @@ namespace polysat {
auto& premises = it->m_value;
clause_builder c_lemma(s());
for (auto premise : premises) {
cm().ensure_bvar(premise.get());
// keep(premise);
handle_saturation_premises(premise);
keep(premise);
SASSERT(premise->has_bvar());
c_lemma.push(~premise.blit());
active_level = std::max(active_level, s().m_bvars.level(premise.blit()));
@ -246,8 +238,8 @@ namespace polysat {
for (unsigned v : m_vars) {
if (!is_pmarked(v))
continue;
// SASSERT(!s().is_assigned()); // TODO: why does this trigger????
if (!s().is_assigned())
// SASSERT(!s().is_assigned(v)); // TODO: why does this trigger????
if (!s().is_assigned(v))
continue;
if (s().m_justification[v].level() > model_level)
continue;