From 47224a4596a4131a260d9dd9ceec8e55ede0aad3 Mon Sep 17 00:00:00 2001 From: lianah Date: Thu, 12 Jun 2014 15:00:27 -0400 Subject: [PATCH] fixing bv inequality solver explanation bug --- src/theory/bv/bv_inequality_graph.cpp | 6 ++++++ src/theory/bv/bv_subtheory_inequality.cpp | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/theory/bv/bv_inequality_graph.cpp b/src/theory/bv/bv_inequality_graph.cpp index feb061ee1..ff344d307 100644 --- a/src/theory/bv/bv_inequality_graph.cpp +++ b/src/theory/bv/bv_inequality_graph.cpp @@ -141,6 +141,11 @@ bool InequalityGraph::processQueue(BFSQueue& queue, TermId start) { // it means we have an overflow and hence a conflict std::vector conflict; conflict.push_back(it->reason); + Assert (hasModelValue(start)); + ReasonId start_reason = getModelValue(start).reason; + if (start_reason != UndefinedReasonId) { + conflict.push_back(start_reason); + } computeExplanation(start, current, conflict); Debug("bv-inequality") << "InequalityGraph::addInequality conflict: cycle \n"; setConflict(conflict); @@ -261,6 +266,7 @@ ReasonId InequalityGraph::registerReason(TNode reason) { ReasonId id = d_reasonNodes.size(); d_reasonNodes.push_back(reason); d_reasonToIdMap[reason] = id; + Debug("bv-inequality-internal") << "InequalityGraph::registerReason " << reason << " => id"<< id << "\n"; return id; } diff --git a/src/theory/bv/bv_subtheory_inequality.cpp b/src/theory/bv/bv_subtheory_inequality.cpp index 222ba3039..c6a92a439 100644 --- a/src/theory/bv/bv_subtheory_inequality.cpp +++ b/src/theory/bv/bv_subtheory_inequality.cpp @@ -79,7 +79,9 @@ bool InequalitySolver::check(Theory::Effort e) { if (!ok) { std::vector conflict; d_inequalityGraph.getConflict(conflict); - d_bv->setConflict(utils::flattenAnd(conflict)); + Node confl = utils::flattenAnd(conflict); + d_bv->setConflict(confl); + Debug("bv-subtheory-inequality") << "InequalitySolver::conflict: "<< confl <<"\n"; return false; } @@ -92,6 +94,7 @@ bool InequalitySolver::check(Theory::Effort e) { d_bv->lemma(lemmas[i]); } } + Debug("bv-subtheory-inequality") << "InequalitySolver done. "; return true; } -- 2.30.2