fixing bv inequality solver explanation bug
authorlianah <lianahady@gmail.com>
Thu, 12 Jun 2014 19:00:27 +0000 (15:00 -0400)
committerlianah <lianahady@gmail.com>
Thu, 12 Jun 2014 19:00:27 +0000 (15:00 -0400)
src/theory/bv/bv_inequality_graph.cpp
src/theory/bv/bv_subtheory_inequality.cpp

index feb061ee1bb24cd0d72b26c71dce212ce82de018..ff344d3075e9514a55054d9aac7d8745950ae432 100644 (file)
@@ -141,6 +141,11 @@ bool InequalityGraph::processQueue(BFSQueue& queue, TermId start) {
         // it means we have an overflow and hence a conflict
         std::vector<TermId> 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; 
 }
 
index 222ba303915048a5aba24771b7132518965ce4a3..c6a92a439591d6fd48d1c0598d00b0add51616cb 100644 (file)
@@ -79,7 +79,9 @@ bool InequalitySolver::check(Theory::Effort e) {
   if (!ok) {
     std::vector<TNode> 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;
 }