Implements TheoryArith::collectModelInfo(). The current implementation is quite...
authorTim King <taking@cs.nyu.edu>
Tue, 14 Aug 2012 18:01:02 +0000 (18:01 +0000)
committerTim King <taking@cs.nyu.edu>
Tue, 14 Aug 2012 18:01:02 +0000 (18:01 +0000)
src/theory/arith/theory_arith.cpp

index 6b7efa1eecb29b59b13be67f7c8bafdea8832414..ca2d74cf7f9045de864c49f812cf2615be6c0cfb 100644 (file)
@@ -1926,7 +1926,35 @@ DeltaRational TheoryArith::getDeltaValue(TNode n) {
 }
 
 void TheoryArith::collectModelInfo( TheoryModel* m ){
+  Assert(d_qflraStatus ==  Result::SAT);
 
+  Debug("arith::collectModelInfo") << "collectModelInfo() begin " << endl;  
+
+  // Delta lasts at least the duration of the function call
+  const Rational& delta = d_partialModel.getDelta();
+
+  // TODO:
+  // This is not very good for user push/pop....
+  // Revisit when implementing push/pop 
+  for(ArithVar v = 0; v < d_variables.size(); ++v){
+    if(!isSlackVariable(v)){
+      Node term = d_arithvarNodeMap.asNode(v);
+
+      const DeltaRational& mod = d_partialModel.getAssignment(v);
+      Rational qmodel = mod.substituteDelta(delta);
+
+      Node qNode = mkRationalNode(qmodel);
+      Debug("arith::collectModelInfo") << "m->assertEquality(" << term << ", " << qmodel << ", true)" << endl;
+
+      m->assertEquality(term, qNode, true);
+    }
+  }
+
+  // Iterate over equivalence classes in LinearEqualityModule
+  // const eq::EqualityEngine& ee = d_congruenceManager.getEqualityEngine();
+  // m->assertEqualityEngine(&ee);
+
+  Debug("arith::collectModelInfo") << "collectModelInfo() end " << endl;
 }
 
 bool TheoryArith::safeToReset() const {