From 36a101481a48151cd5d8c0fa57c55c41f2f31668 Mon Sep 17 00:00:00 2001 From: Kshitij Bansal Date: Wed, 17 Apr 2013 13:30:41 -0400 Subject: [PATCH] boolean flatten: bug fix in dfs search (this is not intended to (and doesn't) address the issue with NodeBuilder limit) --- src/theory/booleans/theory_bool_rewriter.cpp | 1 + test/regress/regress0/preprocess/Makefile.am | 3 ++- test/regress/regress0/preprocess/preprocess_15.cvc | 12 ++++++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 test/regress/regress0/preprocess/preprocess_15.cvc diff --git a/src/theory/booleans/theory_bool_rewriter.cpp b/src/theory/booleans/theory_bool_rewriter.cpp index 491c52eb3..e6b714749 100644 --- a/src/theory/booleans/theory_bool_rewriter.cpp +++ b/src/theory/booleans/theory_bool_rewriter.cpp @@ -57,6 +57,7 @@ RewriteResponse flattenNode(TNode n, TNode trivialNode, TNode skipNode) } else if(child == trivialNode) { return RewriteResponse(REWRITE_DONE, trivialNode); } else { + visited.insert(child); if(child.getKind() == k) toProcess.push_back(child); else diff --git a/test/regress/regress0/preprocess/Makefile.am b/test/regress/regress0/preprocess/Makefile.am index f8cd0fb9a..fe02b230e 100644 --- a/test/regress/regress0/preprocess/Makefile.am +++ b/test/regress/regress0/preprocess/Makefile.am @@ -39,7 +39,8 @@ CVC_TESTS = \ preprocess_11.cvc \ preprocess_12.cvc \ preprocess_13.cvc \ - preprocess_14.cvc + preprocess_14.cvc \ + preprocess_15.cvc # Regression tests derived from bug reports BUG_TESTS = diff --git a/test/regress/regress0/preprocess/preprocess_15.cvc b/test/regress/regress0/preprocess/preprocess_15.cvc new file mode 100644 index 000000000..30df35e53 --- /dev/null +++ b/test/regress/regress0/preprocess/preprocess_15.cvc @@ -0,0 +1,12 @@ +% EXPECT: sat + +a0, a1, a2, a3, a4, a5, a6, a7, a8, a9: BOOLEAN; + +ASSERT (a5); + +ASSERT (a0 OR (a1 AND (a2 OR (a3 AND (a4 AND (a5 AND (TRUE AND (a3 AND (a6 AND (a7 AND (a8 AND a9))))))))))); + +CHECKSAT; + +% EXIT: 10 + -- 2.30.2