3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-20 23:56:37 +00:00

each overlapping variable needs to be explained only once

This commit is contained in:
Jakob Rath 2023-12-01 15:47:54 +01:00
parent e1d23642bc
commit 6ce63154d2

View file

@ -1973,15 +1973,20 @@ namespace polysat {
// e.g.: v^2 + w^2 == 0; w := 1
// - but we could use side constraints on the coefficients instead (coefficients when viewed as polynomial over v):
// e.g.: v^2 + w^2 == 0; w^2 == 1
uint_set to_explain;
for (unsigned d : us.unsat_core()) {
auto [x, lit] = deps[d];
s.m_slicing.explain_simple_overlap(v, x, [this, &core](sat::literal l) {
core.insert(s.lit2cnstr(l));
});
if (x != v)
to_explain.insert(x);
signed_constraint c = s.lit2cnstr(lit);
core.insert(c);
core.insert_vars(c);
}
for (pvar x : to_explain) {
s.m_slicing.explain_simple_overlap(v, x, [this, &core](sat::literal l) {
core.insert(s.lit2cnstr(l));
});
}
SASSERT(!core.vars().contains(v));
core.add_lemma("viable unsat core", core.build_lemma());
IF_VERBOSE(10, verbose_stream() << "unsat core " << core << "\n";);