Handling a corner case where a ROW's guard is a constant disequality.
authorGuy <guy@Guy-X260>
Fri, 16 Sep 2016 23:26:30 +0000 (16:26 -0700)
committerGuy <guy@Guy-X260>
Fri, 16 Sep 2016 23:26:30 +0000 (16:26 -0700)
If this is a simple proof (e.g., just 1 != 2), change the d_id from Transitivity to ConstantDisequality

src/theory/arrays/array_proof_reconstruction.cpp
src/theory/uf/equality_engine.cpp

index 8dd7fe782ef7166e4fbddaea6229b56b938a79de..9cba0592e0e6f183a47f3afd93d60c115348f227 100644 (file)
@@ -107,7 +107,7 @@ void ArrayProofReconstruction::notify(unsigned reasonType, Node reason, Node a,
 
         // It could be that the guard condition is a constant disequality. In this case,
         // we need to change it to a different format.
-        if (childProof->d_id == theory::eq::MERGED_THROUGH_CONSTANTS) {
+        if (childProof->d_id == theory::eq::MERGED_THROUGH_CONSTANTS && childProof->d_children.size() != 0) {
           // The proof has two children, explaining why each index is a (different) constant.
           Assert(childProof->d_children.size() == 2);
 
index f98ad556f2ed3baa85b42fa15f36c78b6bc1c845..5d929a708691b6adcbd1171ef4f887139c39302e 100644 (file)
@@ -987,7 +987,14 @@ void EqualityEngine::explainEquality(TNode t1, TNode t2, bool polarity, std::vec
     }
 
     if (eqp) {
-      if(eqp->d_children.size() == 1) {
+      if (eqp->d_children.size() == 0) {
+        // Corner case where this is actually a disequality between two constants
+        Debug("pf::ee") << "Encountered a constant disequality (not a transitivity proof): "
+                        << eqp->d_node << std::endl;
+        Assert(eqp->d_node[0][0].isConst());
+        Assert(eqp->d_node[0][1].isConst());
+        eqp->d_id = MERGED_THROUGH_CONSTANTS;
+      } else if (eqp->d_children.size() == 1) {
         // The transitivity proof has just one child. Simplify.
         EqProof* temp = eqp->d_children[0];
         eqp->d_children.clear();