adding additional checks for theories propagating literals that already have a value
authorDejan Jovanović <dejan.jovanovic@gmail.com>
Sat, 10 Dec 2011 08:34:41 +0000 (08:34 +0000)
committerDejan Jovanović <dejan.jovanovic@gmail.com>
Sat, 10 Dec 2011 08:34:41 +0000 (08:34 +0000)
src/theory/theory_engine.cpp

index 5ef7480e8f51eab8c9bf46b6e9e75fa95bae666f..4c289b5c10abd069c70993b9a726a832ffcefbf7 100644 (file)
@@ -573,7 +573,14 @@ void TheoryEngine::propagate(TNode literal, theory::TheoryId theory) {
     Node normalizedEquality = Rewriter::rewrite(literal);
     if (d_propEngine->isSatLiteral(normalizedEquality)) {
       // If there is a literal, just enqueue it, same as above
-      d_propagatedLiterals.push_back(normalizedEquality);
+      bool value;
+      if (d_propEngine->hasValue(normalizedEquality, value)) {
+        // if we are propagting something that already has a sat value we better be the same
+        Debug("theory") << "literal " << literal << " (" << normalizedEquality << ") propagated by " << theory << " but already has a sat value" << std::endl;
+        Assert((value && (literal.getKind() != kind::NOT)) || (!value && literal.getKind() == kind::NOT));
+      } else {
+        d_propagatedLiterals.push_back(normalizedEquality);
+      }
     }
     // Otherwise, we assert it to all interested theories
     Theory::Set lhsNotified = d_sharedTerms.getNotifiedTheories(atom[0]);