From 5cb4e490bc222d1e8a3853b2f975a64af2976baf Mon Sep 17 00:00:00 2001 From: Kshitij Bansal Date: Wed, 18 Jun 2014 16:09:18 -0400 Subject: [PATCH] forgot to add the test with fix according to bug report, fix was in 6267f3 --- test/regress/regress0/Makefile.am | 3 +- test/regress/regress0/bug567.smt2 | 48 +++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 test/regress/regress0/bug567.smt2 diff --git a/test/regress/regress0/Makefile.am b/test/regress/regress0/Makefile.am index 18931e3fa..3c9ec7eb0 100644 --- a/test/regress/regress0/Makefile.am +++ b/test/regress/regress0/Makefile.am @@ -157,7 +157,8 @@ BUG_TESTS = \ bug528a.smt2 \ bug541.smt2 \ bug544.smt2 \ - bug548a.smt2 + bug548a.smt2 \ + bug567.smt2 TESTS = $(SMT_TESTS) $(SMT2_TESTS) $(CVC_TESTS) $(TPTP_TESTS) $(BUG_TESTS) diff --git a/test/regress/regress0/bug567.smt2 b/test/regress/regress0/bug567.smt2 new file mode 100644 index 000000000..265d456b6 --- /dev/null +++ b/test/regress/regress0/bug567.smt2 @@ -0,0 +1,48 @@ +(set-logic ALL_SUPPORTED) +; COMMAND-LINE: --incremental +; EXPECT: unknown +; EXPECT: unknown +; EXPECT: unknown +(declare-datatypes () ((OptInt0 (Some (value0 Int)) (None)))) +(declare-datatypes () ((List0 (Cons (head0 Int) (tail0 List0)) (Nil)))) + +(declare-fun errorValue2 () Bool) +(declare-fun errorValue1 () Bool) + + + + + +(declare-fun size (List0) Int) +(declare-fun mergeInto (List0 List0) List0) +(declare-fun isSorted (List0) Bool) +(declare-fun buggySortedIns (Int List0) List0) +(declare-fun sortedIns (Int List0) List0) +(declare-fun sort (List0) List0) +(declare-fun contents (List0) (Set Int)) + +(assert (forall ((l List0)) (! (= (size l) (ite (is-Nil l) 0 (+ 1 (size (tail0 l))))) :pattern ((size l))))) +(assert (forall ((l1 List0) (l2 List0)) (! (= (mergeInto l1 l2) (ite (is-Nil l1) l2 (mergeInto (tail0 l1) (sortedIns (head0 l1) l2)))) :pattern ((mergeInto l1 l2))))) +(assert (forall ((l2 List0)) (! (= (isSorted l2) (ite (is-Nil l2) true (ite (and (is-Cons l2) (is-Nil (tail0 l2))) true (ite (and (is-Cons l2) (is-Cons (tail0 l2))) (and (<= (head0 l2) (head0 (tail0 l2))) (isSorted (Cons (head0 (tail0 l2)) (tail0 (tail0 l2))))) errorValue1)))) :pattern ((isSorted l2))))) +(assert (forall ((l4 List0) (e1 Int)) (! (= (buggySortedIns e1 l4) (ite (is-Nil l4) (Cons e1 Nil) (ite (<= (head0 l4) e1) (Cons (head0 l4) (buggySortedIns e1 (tail0 l4))) (Cons e1 l4)))) :pattern ((buggySortedIns e1 l4))))) +(assert (forall ((l3 List0) (e Int)) (! (= (sortedIns e l3) (ite (is-Nil l3) (Cons e Nil) (ite (<= (head0 l3) e) (Cons (head0 l3) (sortedIns e (tail0 l3))) (Cons e l3)))) :pattern ((sortedIns e l3))))) +(assert (forall ((l5 List0)) (! (= (sort l5) (ite (is-Nil l5) Nil (sortedIns (head0 l5) (sort (tail0 l5))))) :pattern ((sort l5))))) +(assert (forall ((l1 List0)) (! (= (contents l1) (ite (is-Nil l1) (as emptyset (Set Int)) (union (contents (tail0 l1)) (setenum (head0 l1))))) :pattern ((contents l1))))) + + + +(push) +(assert (forall ((l List0)) (not (let ((result (ite (is-Nil l) 0 (+ 1 (size (tail0 l)))))) (>= result 0))))) +(check-sat) +(pop) + +(push) +(assert (forall ((l2 List0)) (not (not (and (not (is-Nil l2)) (not (and (is-Cons l2) (is-Nil (tail0 l2)))) (not (and (is-Cons l2) (is-Cons (tail0 l2))))))))) +(check-sat) +(pop) + +(push) +(assert (forall ((l4 List0) (e1 Int)) (not (let ((result2 (ite (is-Nil l4) (Cons e1 Nil) (ite (<= (head0 l4) e1) (Cons (head0 l4) (buggySortedIns e1 (tail0 l4))) (Cons e1 l4))))) (and (= (contents result2) (union (contents l4) (setenum e1))) (isSorted result2) (= (size result2) (+ (size l4) 1))))))) +(check-sat) +(pop) + -- 2.30.2