ITE removal in TheoryEngine was not properly handling PARAMETERIZED kinds. Fixed...
authorMorgan Deters <mdeters@gmail.com>
Thu, 10 Mar 2011 07:28:32 +0000 (07:28 +0000)
committerMorgan Deters <mdeters@gmail.com>
Thu, 10 Mar 2011 07:28:32 +0000 (07:28 +0000)
src/theory/theory_engine.cpp
test/regress/regress0/Makefile.am
test/regress/regress0/buggy-ite.smt2 [new file with mode: 0644]

index 3c59b43e4a5fef614670a84f52731934cb621511..f8eece3df0a068d63cae4881f855b1dbbee18e4d 100644 (file)
@@ -310,6 +310,12 @@ Node TheoryEngine::removeITEs(TNode node) {
   }
   vector<Node> newChildren;
   bool somethingChanged = false;
+  if(node.getMetaKind() == kind::metakind::PARAMETERIZED) {
+    // Make sure to push operator or it will be missing in new
+    // (reformed) node.  This was crashing on the very simple input
+    // "(f (ite c 0 1))"
+    newChildren.push_back(node.getOperator());
+  }
   for(TNode::const_iterator it = node.begin(), end = node.end();
       it != end;
       ++it) {
index 50c43fcb9bd7cd9bc79221f3cca7650e9d89c818..37020d48e50c4ebc5db8cb7a50444b23daaebbcd 100644 (file)
@@ -86,7 +86,8 @@ BUG_TESTS = \
        bug187.smt2 \
        bug216.smt2 \
        bug220.smt2 \
-       bug239.smt
+       bug239.smt \
+       buggy-ite.smt2
 
 TESTS =        $(SMT_TESTS) $(SMT2_TESTS) $(CVC_TESTS) $(BUG_TESTS)
 
diff --git a/test/regress/regress0/buggy-ite.smt2 b/test/regress/regress0/buggy-ite.smt2
new file mode 100644 (file)
index 0000000..79e91b5
--- /dev/null
@@ -0,0 +1,13 @@
+; This was causing trouble in CVC4 r1434 due to mishandling of ITE
+; removal for PARAMETERIZED kinds.
+; Thanks to Andrew Reynolds for catching this.
+(set-logic QF_UF)
+(set-info :smt-lib-version 2.0)
+(set-info :status sat)
+(declare-sort U 0)
+(declare-fun a () U)
+(declare-fun c () Bool)
+(declare-fun g (U) Bool)
+(assert (g (ite c a a)))
+(check-sat)
+(exit)