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

generalize level

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2021-09-15 16:46:30 +01:00
parent 7e7f88ae3d
commit 689c5b4e12
6 changed files with 40 additions and 18 deletions

View file

@ -744,15 +744,22 @@ namespace polysat {
void solver::add_lemma(clause_ref lemma) {
if (!lemma)
return;
bool non_propagated_literal = false;
LOG("Lemma: " << show_deref(lemma));
for (sat::literal lit : *lemma) {
LOG(" Literal " << lit << " is: " << m_constraints.lookup(lit));
signed_constraint c = m_constraints.lookup(lit);
// Check that fully evaluated constraints are on the stack
SASSERT(m_bvars.is_assigned(lit) || !c.is_currently_false(*this));
SASSERT(m_bvars.is_assigned(lit) || !c.is_currently_true(*this));
SASSERT(!c.is_currently_true(*this));
// literals that are added from m_conflict.m_vars have not been assigned.
// they are false in the current model.
if (!m_bvars.is_assigned(lit) && c.is_currently_false(*this)) {
non_propagated_literal = true;
}
// SASSERT(m_bvars.is_assigned(lit) || !c.is_currently_false(*this));
// TODO: work out invariant for the lemma. It should be impossible to extend the model in a way that makes the lemma true.
}
// SASSERT(!non_propagated_literal);
SASSERT(lemma->size() > 0);
clause* cl = m_constraints.store(std::move(lemma));
if (cl->size() == 1) {