Fix bool-to-bv preprocessing pass for non-{bv,bool} equalities. (#2251)
authorMathias Preiner <mathias.preiner@gmail.com>
Wed, 1 Aug 2018 22:14:45 +0000 (15:14 -0700)
committerGitHub <noreply@github.com>
Wed, 1 Aug 2018 22:14:45 +0000 (15:14 -0700)
src/preprocessing/passes/bool_to_bv.cpp

index b7078225a603e95e917bedd9ca509ade4754acbe..4c08d7e47f7f474b2f68e0ba878d825e25a3e48e 100644 (file)
@@ -95,7 +95,13 @@ Node BoolToBV::lowerNode(TNode current, bool topLevel)
       Kind new_kind = kind;
       switch (kind)
       {
-        case kind::EQUAL: new_kind = kind::BITVECTOR_COMP; break;
+        case kind::EQUAL:
+          if (current[0].getType().isBitVector()
+              || current[0].getType().isBoolean())
+          {
+            new_kind = kind::BITVECTOR_COMP;
+          }
+          break;
         case kind::AND: new_kind = kind::BITVECTOR_AND; break;
         case kind::OR: new_kind = kind::BITVECTOR_OR; break;
         case kind::NOT: new_kind = kind::BITVECTOR_NOT; break;