3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-24 01:25:31 +00:00

fix another bug uncovered by Dunlop, prepare grounds for equality solving within NNFs

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2019-01-14 01:25:25 -08:00
parent eaa80d5b02
commit 0b84c60886
13 changed files with 283 additions and 122 deletions

View file

@ -567,12 +567,9 @@ namespace smt {
case b_justification::AXIOM:
out << "axiom";
break;
case b_justification::BIN_CLAUSE: {
literal l2 = j.get_literal();
out << "bin-clause ";
display_literal(out, l2);
case b_justification::BIN_CLAUSE:
out << "bin " << j.get_literal();
break;
}
case b_justification::CLAUSE: {
clause * cls = j.get_clause();
out << "clause ";
@ -580,10 +577,9 @@ namespace smt {
break;
}
case b_justification::JUSTIFICATION: {
out << "justification " << j.get_justification()->get_from_theory() << ": ";
literal_vector lits;
const_cast<conflict_resolution&>(*m_conflict_resolution).justification2literals(j.get_justification(), lits);
display_literals(out, lits);
out << "justification " << j.get_justification()->get_from_theory() << ": " << lits;
break;
}
default:

View file

@ -1836,8 +1836,6 @@ namespace smt {
return false;
}
// std::cout << c.lit() << "\n";
reset_coeffs();
m_num_marks = 0;
m_bound = c.k();
@ -1936,7 +1934,10 @@ namespace smt {
}
if (pbj == nullptr) {
TRACE("pb", tout << "skip justification for " << conseq << "\n";);
inc_coeff(conseq, offset);
// this is possible when conseq is an assumption.
// The justification of conseq is itself,
// don't increment the cofficient here because it assumes
// conseq is justified further. it isnt'. conseq becomes part of the lemma.
}
else {
card& c2 = pbj->get_card();
@ -1944,7 +1945,6 @@ namespace smt {
bound = c2.k();
}
// std::cout << " offset: " << offset << " bound: " << bound << "\n";
break;
}
default:
@ -2020,6 +2020,7 @@ namespace smt {
SASSERT(slack < 0);
SASSERT(validate_antecedents(m_antecedents));
TRACE("pb", tout << "antecedents " << m_antecedents << "\n";);
ctx.assign(alit, ctx.mk_justification(theory_propagation_justification(get_id(), ctx.get_region(), m_antecedents.size(), m_antecedents.c_ptr(), alit, 0, nullptr)));
DEBUG_CODE(
@ -2127,7 +2128,7 @@ namespace smt {
break;
}
}
TRACE("pb", display(tout << "validate: ", c, true);
TRACE("pb_verbose", display(tout << "validate: ", c, true);
tout << "sum: " << sum << " " << maxsum << " ";
tout << ctx.get_assignment(c.lit()) << "\n";);
@ -2215,15 +2216,11 @@ namespace smt {
void theory_pb::display_resolved_lemma(std::ostream& out) const {
context& ctx = get_context();
bool_var v;
unsigned lvl;
out << "num marks: " << m_num_marks << "\n";
out << "conflict level: " << m_conflict_lvl << "\n";
for (unsigned i = 0; i < m_resolved.size(); ++i) {
v = m_resolved[i].var();
lvl = ctx.get_assign_level(v);
out << lvl << ": " << m_resolved[i] << " ";
ctx.display(out, ctx.get_justification(v));
for (literal r : m_resolved) {
out << ctx.get_assign_level(r) << ": " << r << " ";
ctx.display(out, ctx.get_justification(r.var()));
}
if (!m_antecedents.empty()) {