From 79a5b133d796f267563ddcc80e75475f78bac896 Mon Sep 17 00:00:00 2001 From: Nikolaj Bjorner Date: Mon, 11 Jan 2016 11:04:44 -0800 Subject: [PATCH] fix debugging code in ast.cpp to take into account that literals may be repeated Signed-off-by: Nikolaj Bjorner --- src/ast/ast.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/ast/ast.cpp b/src/ast/ast.cpp index ab1a5a5af..a74ab90c1 100644 --- a/src/ast/ast.cpp +++ b/src/ast/ast.cpp @@ -2866,22 +2866,24 @@ proof * ast_manager::mk_unit_resolution(unsigned num_proofs, proof * const * pro svector found; #endif for (unsigned i = 0; i < num_args; i++) { + bool found_complement = false; expr * lit = cls->get_arg(i); - unsigned j = 1; - for (; j < num_proofs; j++) { + for (unsigned j = 1; j < num_proofs; j++) { expr const * _fact = get_fact(proofs[j]); if (is_complement(lit, _fact)) { - DEBUG_CODE(found.setx(j, true, false);); + found_complement = true; + DEBUG_CODE(found.setx(j, true, false); continue;); break; } } - if (j == num_proofs) + if (!found_complement) new_lits.push_back(lit); } DEBUG_CODE({ for (unsigned i = 1; m_proof_mode == PGM_FINE && i < num_proofs; i++) { CTRACE("mk_unit_resolution_bug", !found.get(i, false), for (unsigned j = 0; j < num_proofs; j++) { + if (j == i) tout << "Index " << i << " was not found:\n"; tout << mk_ll_pp(get_fact(proofs[j]), *this); }); SASSERT(found.get(i, false));