From 611c12a19eaf359dd26da9d0a2b2e2215066180d Mon Sep 17 00:00:00 2001 From: Morgan Deters Date: Fri, 17 May 2013 11:12:36 -0400 Subject: [PATCH] Fix for equality-chaining of Booleans in SMT-LIBv2. Thanks to David Cok for reporting this. --- src/smt/boolean_terms.cpp | 2 +- test/regress/regress0/Makefile.am | 1 + test/regress/regress0/chained-equality.smt2 | 10 ++++++++++ 3 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 test/regress/regress0/chained-equality.smt2 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(top[i], isBoolean(top, i) ? theory::THEORY_BOOL : (top.getKind() == kind::APPLY_CONSTRUCTOR ? theory::THEORY_DATATYPES : theory::THEORY_BUILTIN), false)); + worklist.push(triple(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) -- 2.30.2