3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-06-06 06:03:23 +00:00

handle proof-wrapper justifications

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2013-12-16 11:25:50 +02:00
parent e38729a1c6
commit 1ca44ed316
2 changed files with 19 additions and 17 deletions

View file

@ -1032,12 +1032,8 @@ namespace smt {
} }
else if (lvl > ctx.get_base_level()) { else if (lvl > ctx.get_base_level()) {
if (is_marked(v)) { if (is_marked(v)) {
numeral& lcoeff = m_lemma.m_args[m_conseq_index[v]].second; m_lemma.m_args[m_conseq_index[v]].second += coeff;
lcoeff += coeff; SASSERT(m_lemma.m_args[m_conseq_index[v]].second.is_pos());
if (lcoeff.is_zero()) {
IF_VERBOSE(1, display(verbose_stream() << "remove 0 consequence", m_lemma, true););
remove_from_lemma(m_lemma, m_conseq_index[v]);
}
} }
else { else {
if (lvl == m_conflict_lvl) { if (lvl == m_conflict_lvl) {
@ -1135,12 +1131,12 @@ namespace smt {
TRACE("pb_verbose", display(tout << "lemma ", m_lemma, true);); TRACE("pb_verbose", display(tout << "lemma ", m_lemma, true););
lbool is_sat = m_lemma.normalize(); lbool is_sat = m_lemma.normalize();
if (is_sat != l_undef) {
if (is_sat == l_false) { if (is_sat == l_false) {
break; break;
} }
IF_VERBOSE(0, display(verbose_stream() << "lemma already evaluated ", m_lemma, true);); if (is_sat == l_true) {
TRACE("pb", display(tout << "lemma already evaluated ", m_lemma, true);); IF_VERBOSE(0, verbose_stream() << "lemma already evaluated ";);
TRACE("pb", tout << "lemma already evaluated ";);
return false; return false;
} }
TRACE("pb", display(tout, m_lemma, true);); TRACE("pb", display(tout, m_lemma, true););
@ -1189,9 +1185,9 @@ namespace smt {
case b_justification::CLAUSE: { case b_justification::CLAUSE: {
clause& cls = *js.get_clause(); clause& cls = *js.get_clause();
justification* cjs = cls.get_justification(); justification* cjs = cls.get_justification();
if (cjs) { if (cjs && !is_proof_justification(*cjs)) {
IF_VERBOSE(1, verbose_stream() << "skipping justification for clause over: " << conseq << "\n";); TRACE("pb", tout << "skipping justification for clause over: " << conseq << " "
TRACE("pb", tout << "skipping justification for clause over: " << conseq << "\n";); << typeid(*cjs).name() << "\n";);
m_ineq_literals.push_back(conseq); m_ineq_literals.push_back(conseq);
break; break;
} }
@ -1221,10 +1217,10 @@ namespace smt {
break; break;
case b_justification::JUSTIFICATION: { case b_justification::JUSTIFICATION: {
justification& j = *js.get_justification(); justification& j = *js.get_justification();
// only process pb justifications.
if (j.get_from_theory() != get_id()) { if (j.get_from_theory() != get_id()) {
TRACE("pb", tout << "skipping justification for " << conseq TRACE("pb", tout << "skipping justification for " << conseq
<< " from theory " << j.get_from_theory() << "\n";); << " from theory " << j.get_from_theory() << " "
<< typeid(j).name() << "\n";);
m_ineq_literals.push_back(conseq); m_ineq_literals.push_back(conseq);
} }
else { else {
@ -1275,6 +1271,11 @@ namespace smt {
return true; return true;
} }
bool theory_pb::is_proof_justification(justification const& j) const {
return typeid(smt::justification_proof_wrapper) == typeid(j);
}
void theory_pb::hoist_maximal_values() { void theory_pb::hoist_maximal_values() {
for (unsigned i = 0; i < m_lemma.size(); ++i) { for (unsigned i = 0; i < m_lemma.size(); ++i) {
if (m_lemma.coeff(i) == m_lemma.k()) { if (m_lemma.coeff(i) == m_lemma.k()) {

View file

@ -157,6 +157,7 @@ namespace smt {
void process_antecedent(literal l, numeral coeff); void process_antecedent(literal l, numeral coeff);
void process_ineq(ineq& c, literal conseq, numeral coeff); void process_ineq(ineq& c, literal conseq, numeral coeff);
void remove_from_lemma(ineq& c, unsigned idx); void remove_from_lemma(ineq& c, unsigned idx);
bool is_proof_justification(justification const& j) const;
void hoist_maximal_values(); void hoist_maximal_values();