Added assertions and tracing code for collectModelInfo phase
authorClark Barrett <barrett@cs.nyu.edu>
Fri, 12 Oct 2012 21:36:06 +0000 (21:36 +0000)
committerClark Barrett <barrett@cs.nyu.edu>
Fri, 12 Oct 2012 21:36:06 +0000 (21:36 +0000)
src/theory/model.cpp

index 07652918dad0e831c01fa9f39a8fb221ad304c36..dad1b5fe661e39aba6cde7608d1f8cd79bb60d84 100644 (file)
@@ -223,6 +223,8 @@ void TheoryModel::addTerm( Node n ){
 /** assert equality */
 void TheoryModel::assertEquality( Node a, Node b, bool polarity ){
   d_equalityEngine.assertEquality( a.eqNode(b), polarity, Node::null() );
+  Trace("model-builder-assertions") << "  Asserting " << (polarity ? "equality: " : "disequality: ") << a << " = " << b << endl;
+  Assert(d_equalityEngine.consistent());
 }
 
 /** assert predicate */
@@ -231,6 +233,8 @@ void TheoryModel::assertPredicate( Node a, bool polarity ){
     d_equalityEngine.assertEquality( a, polarity, Node::null() );
   }else{
     d_equalityEngine.assertPredicate( a, polarity, Node::null() );
+    Trace("model-builder-assertions") << "  Asserting predicate " << (polarity ? "true" : "false") << ": " << a << endl;
+    Assert(d_equalityEngine.consistent());
   }
 }
 
@@ -257,7 +261,9 @@ void TheoryModel::assertEqualityEngine( const eq::EqualityEngine* ee ){
           assertPredicate(*eqc_i, false);
         }
         else {
+          Trace("model-builder-assertions") << "  Merging predicates: " << *eqc_i << " and " << eqc << endl;
           d_equalityEngine.mergePredicates(*eqc_i, eqc, Node::null());
+          Assert(d_equalityEngine.consistent());
         }
       } else {
         assertEquality(*eqc_i, eqc, true);