summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMorgan Deters <mdeters@cs.nyu.edu>2013-05-17 11:12:36 -0400
committerMorgan Deters <mdeters@cs.nyu.edu>2013-05-20 16:55:49 -0400
commit611c12a19eaf359dd26da9d0a2b2e2215066180d (patch)
tree569bd0114e8cc622913fb18614b01a71ccaa0af8
parent6f0bdcf8dc8cbe2090c337aedb700571873b9a49 (diff)
Fix for equality-chaining of Booleans in SMT-LIBv2.
Thanks to David Cok for reporting this.
-rw-r--r--src/smt/boolean_terms.cpp2
-rw-r--r--test/regress/regress0/Makefile.am1
-rw-r--r--test/regress/regress0/chained-equality.smt210
3 files changed, 12 insertions, 1 deletions
diff --git a/src/smt/boolean_terms.cpp b/src/smt/boolean_terms.cpp
index 0063035ff..166a695a4 100644
--- a/src/smt/boolean_terms.cpp
+++ b/src/smt/boolean_terms.cpp
@@ -715,7 +715,7 @@ Node BooleanTermConverter::rewriteBooleanTermsRec(TNode top, theory::TheoryId pa
// push children
for(int i = top.getNumChildren() - 1; i >= 0; --i) {
Debug("bt") << "rewriting: " << top[i] << endl;
- worklist.push(triple<TNode, theory::TheoryId, bool>(top[i], isBoolean(top, i) ? theory::THEORY_BOOL : (top.getKind() == kind::APPLY_CONSTRUCTOR ? theory::THEORY_DATATYPES : theory::THEORY_BUILTIN), false));
+ worklist.push(triple<TNode, theory::TheoryId, bool>(top[i], top.getKind() == kind::CHAIN ? parentTheory : (isBoolean(top, i) ? theory::THEORY_BOOL : (top.getKind() == kind::APPLY_CONSTRUCTOR ? theory::THEORY_DATATYPES : theory::THEORY_BUILTIN)), false));
//b << rewriteBooleanTermsRec(top[i], isBoolean(top, i) ? , quantBoolVars);
//Debug("bt") << "got: " << b[b.getNumChildren() - 1] << endl;
}
diff --git a/test/regress/regress0/Makefile.am b/test/regress/regress0/Makefile.am
index 12d7ab397..fec081ca8 100644
--- a/test/regress/regress0/Makefile.am
+++ b/test/regress/regress0/Makefile.am
@@ -42,6 +42,7 @@ SMT_TESTS = \
# Regression tests for SMT2 inputs
SMT2_TESTS = \
+ chained-equality.smt2 \
ite2.smt2 \
ite3.smt2 \
ite4.smt2 \
diff --git a/test/regress/regress0/chained-equality.smt2 b/test/regress/regress0/chained-equality.smt2
new file mode 100644
index 000000000..fb3a25b94
--- /dev/null
+++ b/test/regress/regress0/chained-equality.smt2
@@ -0,0 +1,10 @@
+(set-option :produce-models true)
+(set-info :status unsat)
+(set-logic QF_UF)
+(declare-fun x () Bool)
+(declare-fun y () Bool)
+(declare-fun z () Bool)
+(assert (= x y z))
+(assert (not x))
+(assert z)
+(check-sat)
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback