summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMorgan Deters <mdeters@gmail.com>2012-10-05 22:46:27 +0000
committerMorgan Deters <mdeters@gmail.com>2012-10-05 22:46:27 +0000
commit129dadba47447148096acd216d61f93e14539cb4 (patch)
treefd0053624ee96ee84eb35d1542d1977e40830750 /test
parent4c87c0794b7e954afd090cfbf441caa0b09c3ef5 (diff)
Bug-related:
* ITE removal fixed to be context-dependent (on UserContext). Resolves incrementality bugs 376 and 396 (which had given wrong answers). * some bugfixes for incrementality that Dejan found (fixes bug 394) * fix for bug in SmtEngine::getValue() where definitions weren't respected (partially resolves bug 411, but get-model is still broken). * change status of microwave21.ec.minimized.smt2 (it's actually unsat, but was labeled sat); re-enable it for "make regress" Also: * --check-model doesn't fail if quantified assertions don't simplify away. * fix some examples, and the Java system test, for the disappearance of the BoolExpr class * add copy constructor to array type enumerator (the type enumerator framework requires copy ctors, and the automatically-generated copy ctor was copying pointers that were then deleted, leaving dangling pointers in the copy and causing segfaults) * --dump=assertions now implies --dump=skolems * --dump=assertions:pre-<PASS> and --dump=assertions:post-<PASS> now allow you to dump before/after a particular preprocessing pass. E.g., --dump=assertions:pre-ite-removal or --dump=assertions:post-static-learning. "--dump=assertions" by itself is after all preprocessing, just before CNF conversion. * minor fixes to dumping output * include Model in language bindings Minor refactoring/misc: * fix compiler warning in src/theory/model.cpp * remove unnecessary SmtEngine::printModel(). * mkoptions script doesn't give progress output if stdout isn't a terminal (e.g., if it's written to a log, or piped through less(1), or whatever). * add some type enumerator unit tests * de-emphasize --parse-only and --preprocess-only (they aren't really "common" options) * fix some exception throw() specifications in SmtEngine * minor documentation clarifications
Diffstat (limited to 'test')
-rw-r--r--test/regress/regress0/push-pop/Makefile.am8
-rw-r--r--test/regress/regress0/push-pop/bug394.smt272
-rw-r--r--test/regress/regress0/uflia/Makefile.am8
-rw-r--r--test/regress/regress0/uflia/microwave21.ec.minimized.smt24
-rw-r--r--test/system/CVC4JavaTest.java3
-rw-r--r--test/unit/theory/type_enumerator_white.h105
6 files changed, 133 insertions, 67 deletions
diff --git a/test/regress/regress0/push-pop/Makefile.am b/test/regress/regress0/push-pop/Makefile.am
index 0af49ee1a..ca86f920d 100644
--- a/test/regress/regress0/push-pop/Makefile.am
+++ b/test/regress/regress0/push-pop/Makefile.am
@@ -30,14 +30,14 @@ SMT2_TESTS = \
BUG_TESTS = \
bug216.smt2 \
bug233.cvc \
- bug326.smt2
+ bug326.smt2 \
+ bug394.smt2 \
+ bug396.smt2
TESTS = $(SMT_TESTS) $(SMT2_TESTS) $(CVC_TESTS) $(BUG_TESTS)
EXTRA_DIST = $(TESTS) \
- bug216.smt2.expect \
- bug394.smt2 \
- bug396.smt2
+ bug216.smt2.expect
# synonyms for "check" in this directory
.PHONY: regress regress0 test
diff --git a/test/regress/regress0/push-pop/bug394.smt2 b/test/regress/regress0/push-pop/bug394.smt2
index 5b045812d..38e59be4f 100644
--- a/test/regress/regress0/push-pop/bug394.smt2
+++ b/test/regress/regress0/push-pop/bug394.smt2
@@ -1,7 +1,7 @@
;(set-option :produce-unsat-cores true)
(set-option :print-success false)
(set-info :smt-lib-version 2.0)
-(set-option :produce-models true)
+;(set-option :produce-models true)
(set-logic ALL_SUPPORTED)
; done setting options
@@ -1500,9 +1500,9 @@ _b44
_b45) $getIdx)
))
(check-sat)
-(get-value ((ControlFlow 0 0)))
-(get-value ((ControlFlow 0 9318)))
-(get-value ((ControlFlow 0 823)))
+;(get-value ((ControlFlow 0 0)))
+;(get-value ((ControlFlow 0 9318)))
+;(get-value ((ControlFlow 0 823)))
(assert (not (= (ControlFlow 0 823) (- 10729))))
(check-sat)
(pop 1)
@@ -1613,34 +1613,34 @@ _b44
_b45) $DCT)
))
(check-sat)
-(get-value ((ControlFlow 0 0)))
-(get-value ((ControlFlow 0 11167)))
-(get-value ((ControlFlow 0 4117)))
-(get-value ((ControlFlow 0 4199)))
+;(get-value ((ControlFlow 0 0)))
+;(get-value ((ControlFlow 0 11167)))
+;(get-value ((ControlFlow 0 4117)))
+;(get-value ((ControlFlow 0 4199)))
(assert (not (= (ControlFlow 0 4199) (- 13495))))
(check-sat)
-(get-value ((ControlFlow 0 0)))
-(get-value ((ControlFlow 0 11167)))
-(get-value ((ControlFlow 0 4117)))
-(get-value ((ControlFlow 0 4199)))
+;(get-value ((ControlFlow 0 0)))
+;(get-value ((ControlFlow 0 11167)))
+;(get-value ((ControlFlow 0 4117)))
+;(get-value ((ControlFlow 0 4199)))
(assert (not (= (ControlFlow 0 4199) (- 13487))))
(check-sat)
-(get-value ((ControlFlow 0 0)))
-(get-value ((ControlFlow 0 11167)))
-(get-value ((ControlFlow 0 4117)))
-(get-value ((ControlFlow 0 4199)))
+;(get-value ((ControlFlow 0 0)))
+;(get-value ((ControlFlow 0 11167)))
+;(get-value ((ControlFlow 0 4117)))
+;(get-value ((ControlFlow 0 4199)))
(assert (not (= (ControlFlow 0 4199) (- 13509))))
(check-sat)
-(get-value ((ControlFlow 0 0)))
-(get-value ((ControlFlow 0 11167)))
-(get-value ((ControlFlow 0 4117)))
-(get-value ((ControlFlow 0 4199)))
+;(get-value ((ControlFlow 0 0)))
+;(get-value ((ControlFlow 0 11167)))
+;(get-value ((ControlFlow 0 4117)))
+;(get-value ((ControlFlow 0 4199)))
(assert (not (= (ControlFlow 0 4199) (- 13553))))
(check-sat)
-(get-value ((ControlFlow 0 0)))
-(get-value ((ControlFlow 0 11167)))
-(get-value ((ControlFlow 0 4117)))
-(get-value ((ControlFlow 0 4199)))
+;(get-value ((ControlFlow 0 0)))
+;(get-value ((ControlFlow 0 11167)))
+;(get-value ((ControlFlow 0 4117)))
+;(get-value ((ControlFlow 0 4199)))
(pop 1)
(push 1)
(set-info :boogie-vc-id $DCT)
@@ -1695,21 +1695,21 @@ _b44
_b45) $DCT)
))
(check-sat)
-(get-value ((ControlFlow 0 0)))
-(get-value ((ControlFlow 0 11167)))
-(get-value ((ControlFlow 0 4117)))
-(get-value ((ControlFlow 0 4199)))
+;(get-value ((ControlFlow 0 0)))
+;(get-value ((ControlFlow 0 11167)))
+;(get-value ((ControlFlow 0 4117)))
+;(get-value ((ControlFlow 0 4199)))
(assert (not (= (ControlFlow 0 4199) (- 13575))))
(check-sat)
-(get-value ((ControlFlow 0 0)))
-(get-value ((ControlFlow 0 11167)))
-(get-value ((ControlFlow 0 4117)))
-(get-value ((ControlFlow 0 4199)))
+;(get-value ((ControlFlow 0 0)))
+;(get-value ((ControlFlow 0 11167)))
+;(get-value ((ControlFlow 0 4117)))
+;(get-value ((ControlFlow 0 4199)))
(assert (not (= (ControlFlow 0 4199) (- 13712))))
(check-sat)
-(get-value ((ControlFlow 0 0)))
-(get-value ((ControlFlow 0 11167)))
-(get-value ((ControlFlow 0 4117)))
-(get-value ((ControlFlow 0 4199)))
+;(get-value ((ControlFlow 0 0)))
+;(get-value ((ControlFlow 0 11167)))
+;(get-value ((ControlFlow 0 4117)))
+;(get-value ((ControlFlow 0 4199)))
(assert (not (= (ControlFlow 0 4199) (- 13700))))
(check-sat)
diff --git a/test/regress/regress0/uflia/Makefile.am b/test/regress/regress0/uflia/Makefile.am
index 751d69fe5..27487b962 100644
--- a/test/regress/regress0/uflia/Makefile.am
+++ b/test/regress/regress0/uflia/Makefile.am
@@ -40,15 +40,13 @@ SMT2_TESTS = \
FIREFLY_luke_1b_e2_3049_e7_1173.ec.minimized.smt2 \
stalmark_e7_27_e7_31.ec.minimized.smt2 \
stalmark_e7_27_e7_31.ec.smt2 \
- tiny.smt2
+ tiny.smt2 \
+ speed2_e8_449_e8_517.ec.smt2 \
+ microwave21.ec.minimized.smt2
# simplify.javafe.ast.ArrayInit.35_without_quantification2.smt2
# javafe.ast.StandardPrettyPrint.319_no_forall.smt2
# javafe.ast.WhileStmt.447_no_forall.smt2
-# CURRENTLY FAILING:
-# speed2_e8_449_e8_517.ec.smt2
-# microwave21.ec.minimized.smt2
-
# Regression tests for PL inputs
CVC_TESTS =
diff --git a/test/regress/regress0/uflia/microwave21.ec.minimized.smt2 b/test/regress/regress0/uflia/microwave21.ec.minimized.smt2
index 0d9accb91..b37db9a1e 100644
--- a/test/regress/regress0/uflia/microwave21.ec.minimized.smt2
+++ b/test/regress/regress0/uflia/microwave21.ec.minimized.smt2
@@ -1,7 +1,7 @@
; initialize_defs
; PROPERTY DEFGEN
(set-logic QF_UFNIA)
-(set-info :status sat)
+(set-info :status unsat)
(declare-fun _base () Int)
(declare-fun _n () Int)
(assert (>= _n 0))
@@ -441,4 +441,4 @@
; not refinement_pass
(assert (not (=> (= _base (- 0 1)) (and (P (- 0 1)) (P 0)))))
(assert true)
-(check-sat) \ No newline at end of file
+(check-sat)
diff --git a/test/system/CVC4JavaTest.java b/test/system/CVC4JavaTest.java
index 5a654d03f..80b7d1abd 100644
--- a/test/system/CVC4JavaTest.java
+++ b/test/system/CVC4JavaTest.java
@@ -4,7 +4,6 @@ import edu.nyu.acsys.CVC4.SmtEngine;
import edu.nyu.acsys.CVC4.ExprManager;
import edu.nyu.acsys.CVC4.Expr;
import edu.nyu.acsys.CVC4.Type;
-import edu.nyu.acsys.CVC4.BoolExpr;
import edu.nyu.acsys.CVC4.Kind;
import edu.nyu.acsys.CVC4.Result;
import edu.nyu.acsys.CVC4.Configuration;
@@ -36,7 +35,7 @@ public class CVC4JavaTest {
Type t = em.booleanType();
Expr a = em.mkVar("a", em.booleanType());
Expr b = em.mkVar("b", em.booleanType());
- BoolExpr e = new BoolExpr(em.mkExpr(Kind.AND, a, b, new BoolExpr(a).notExpr()));
+ Expr e = new Expr(em.mkExpr(Kind.AND, a, b, new Expr(a).notExpr()));
System.out.println("==> " + e);
Result r = smt.checkSat(e);
diff --git a/test/unit/theory/type_enumerator_white.h b/test/unit/theory/type_enumerator_white.h
index 64dfe6fea..6ff36b900 100644
--- a/test/unit/theory/type_enumerator_white.h
+++ b/test/unit/theory/type_enumerator_white.h
@@ -25,6 +25,7 @@
#include "expr/kind.h"
#include "theory/type_enumerator.h"
#include "util/language.h"
+#include "util/array_store_all.h"
using namespace CVC4;
using namespace CVC4::theory;
@@ -52,11 +53,17 @@ public:
void testBooleans() {
TypeEnumerator te(d_nm->booleanType());
+ TS_ASSERT( ! te.isFinished() );
TS_ASSERT_EQUALS(*te, d_nm->mkConst(false));
+ TS_ASSERT( ! te.isFinished() );
TS_ASSERT_EQUALS(*++te, d_nm->mkConst(true));
+ TS_ASSERT( ! te.isFinished() );
TS_ASSERT_THROWS(*++te, NoMoreValuesException);
+ TS_ASSERT( te.isFinished() );
TS_ASSERT_THROWS(*++te, NoMoreValuesException);
+ TS_ASSERT( te.isFinished() );
TS_ASSERT_THROWS(*++te, NoMoreValuesException);
+ TS_ASSERT( te.isFinished() );
}
void testUF() {
@@ -76,13 +83,18 @@ public:
void testArith() {
TypeEnumerator te(d_nm->integerType());
+ TS_ASSERT( ! te.isFinished() );
TS_ASSERT_EQUALS(*te, d_nm->mkConst(Rational(0)));
for(int i = 1; i <= 100; ++i) {
+ TS_ASSERT( ! te.isFinished() );
TS_ASSERT_EQUALS(*++te, d_nm->mkConst(Rational(i)));
+ TS_ASSERT( ! te.isFinished() );
TS_ASSERT_EQUALS(*++te, d_nm->mkConst(Rational(-i)));
}
+ TS_ASSERT( ! te.isFinished() );
te = TypeEnumerator(d_nm->realType());
+ TS_ASSERT( ! te.isFinished() );
TS_ASSERT_EQUALS(*te, d_nm->mkConst(Rational(0, 1)));
TS_ASSERT_EQUALS(*++te, d_nm->mkConst(Rational(1, 1)));
TS_ASSERT_EQUALS(*++te, d_nm->mkConst(Rational(-1, 1)));
@@ -93,6 +105,7 @@ public:
TS_ASSERT_EQUALS(*++te, d_nm->mkConst(Rational(3, 1)));
TS_ASSERT_EQUALS(*++te, d_nm->mkConst(Rational(-3, 1)));
TS_ASSERT_EQUALS(*++te, d_nm->mkConst(Rational(1, 3)));
+ TS_ASSERT( ! te.isFinished() );
TS_ASSERT_EQUALS(*++te, d_nm->mkConst(Rational(-1, 3)));
TS_ASSERT_EQUALS(*++te, d_nm->mkConst(Rational(4, 1)));
TS_ASSERT_EQUALS(*++te, d_nm->mkConst(Rational(-4, 1)));
@@ -104,6 +117,7 @@ public:
TS_ASSERT_EQUALS(*++te, d_nm->mkConst(Rational(-1, 4)));
TS_ASSERT_EQUALS(*++te, d_nm->mkConst(Rational(5, 1)));
TS_ASSERT_EQUALS(*++te, d_nm->mkConst(Rational(-5, 1)));
+ TS_ASSERT( ! te.isFinished() );
TS_ASSERT_EQUALS(*++te, d_nm->mkConst(Rational(1, 5)));
TS_ASSERT_EQUALS(*++te, d_nm->mkConst(Rational(-1, 5)));
TS_ASSERT_EQUALS(*++te, d_nm->mkConst(Rational(6, 1)));
@@ -117,6 +131,7 @@ public:
TS_ASSERT_EQUALS(*++te, d_nm->mkConst(Rational(2, 5)));
TS_ASSERT_EQUALS(*++te, d_nm->mkConst(Rational(-2, 5)));
TS_ASSERT_EQUALS(*++te, d_nm->mkConst(Rational(1, 6)));
+ TS_ASSERT( ! te.isFinished() );
TS_ASSERT_EQUALS(*++te, d_nm->mkConst(Rational(-1, 6)));
TS_ASSERT_EQUALS(*++te, d_nm->mkConst(Rational(7, 1)));
TS_ASSERT_EQUALS(*++te, d_nm->mkConst(Rational(-7, 1)));
@@ -126,6 +141,7 @@ public:
TS_ASSERT_EQUALS(*++te, d_nm->mkConst(Rational(-3, 5)));
TS_ASSERT_EQUALS(*++te, d_nm->mkConst(Rational(1, 7)));
TS_ASSERT_EQUALS(*++te, d_nm->mkConst(Rational(-1, 7)));
+ TS_ASSERT( ! te.isFinished() );
}
void testDatatypesFinite() {
@@ -165,32 +181,40 @@ public:
listColors.addConstructor(consC);
listColors.addConstructor(DatatypeConstructor("nil"));
TypeNode listColorsType = TypeNode::fromType(d_em->mkDatatypeType(listColors));
+
TypeEnumerator te(listColorsType);
+ TS_ASSERT( ! te.isFinished() );
Node cons = Node::fromExpr(DatatypeType(listColorsType.toType()).getDatatype().getConstructor("cons"));
Node nil = d_nm->mkNode(APPLY_CONSTRUCTOR, DatatypeType(listColorsType.toType()).getDatatype().getConstructor("nil"));
Node red = d_nm->mkNode(APPLY_CONSTRUCTOR, DatatypeType(colorsType.toType()).getDatatype().getConstructor("red"));
TS_ASSERT_EQUALS(*te, nil);
TS_ASSERT_EQUALS(*++te, d_nm->mkNode(APPLY_CONSTRUCTOR, cons, red, nil));
+ TS_ASSERT( ! te.isFinished() );
TS_ASSERT_EQUALS(*++te, d_nm->mkNode(APPLY_CONSTRUCTOR, cons, red,
d_nm->mkNode(APPLY_CONSTRUCTOR, cons, red, nil)));
+ TS_ASSERT( ! te.isFinished() );
TS_ASSERT_EQUALS(*++te, d_nm->mkNode(APPLY_CONSTRUCTOR, cons, red,
d_nm->mkNode(APPLY_CONSTRUCTOR, cons, red,
d_nm->mkNode(APPLY_CONSTRUCTOR, cons, red, nil))));
+ TS_ASSERT( ! te.isFinished() );
TS_ASSERT_EQUALS(*++te, d_nm->mkNode(APPLY_CONSTRUCTOR, cons, red,
d_nm->mkNode(APPLY_CONSTRUCTOR, cons, red,
d_nm->mkNode(APPLY_CONSTRUCTOR, cons, red,
d_nm->mkNode(APPLY_CONSTRUCTOR, cons, red, nil)))));
+ TS_ASSERT( ! te.isFinished() );
TS_ASSERT_EQUALS(*++te, d_nm->mkNode(APPLY_CONSTRUCTOR, cons, red,
d_nm->mkNode(APPLY_CONSTRUCTOR, cons, red,
d_nm->mkNode(APPLY_CONSTRUCTOR, cons, red,
d_nm->mkNode(APPLY_CONSTRUCTOR, cons, red,
d_nm->mkNode(APPLY_CONSTRUCTOR, cons, red, nil))))));
+ TS_ASSERT( ! te.isFinished() );
TS_ASSERT_EQUALS(*++te, d_nm->mkNode(APPLY_CONSTRUCTOR, cons, red,
d_nm->mkNode(APPLY_CONSTRUCTOR, cons, red,
d_nm->mkNode(APPLY_CONSTRUCTOR, cons, red,
d_nm->mkNode(APPLY_CONSTRUCTOR, cons, red,
d_nm->mkNode(APPLY_CONSTRUCTOR, cons, red,
d_nm->mkNode(APPLY_CONSTRUCTOR, cons, red, nil)))))));
+ TS_ASSERT( ! te.isFinished() );
TS_ASSERT_EQUALS(*++te, d_nm->mkNode(APPLY_CONSTRUCTOR, cons, red,
d_nm->mkNode(APPLY_CONSTRUCTOR, cons, red,
d_nm->mkNode(APPLY_CONSTRUCTOR, cons, red,
@@ -198,36 +222,81 @@ public:
d_nm->mkNode(APPLY_CONSTRUCTOR, cons, red,
d_nm->mkNode(APPLY_CONSTRUCTOR, cons, red,
d_nm->mkNode(APPLY_CONSTRUCTOR, cons, red, nil))))))));
+ TS_ASSERT( ! te.isFinished() );
}
- void NOtestDatatypesInfinite2() {
- TypeNode datatype;
- TypeEnumerator te(datatype);
+ void NOTYETtestDatatypesInfinite2() {
+ //TypeNode datatype;
+ //TypeEnumerator te(datatype);
+ //TS_ASSERT( ! te.isFinished() );
TS_FAIL("unimplemented");
}
- void NOtestArraysInfinite() {
+ void testArraysInfinite() {
TypeEnumerator te(d_nm->mkArrayType(d_nm->integerType(), d_nm->integerType()));
+ hash_set<Node, NodeHashFunction> elts;
+ for(size_t i = 0; i < 1000; ++i) {
+ TS_ASSERT( ! te.isFinished() );
+ Node elt = *te++;
+ std::cout << elt << std::endl;
+ // ensure no duplicates
+ TS_ASSERT( elts.find(elt) == elts.end() );
+ elts.insert(elt);
+ }
+ TS_ASSERT( ! te.isFinished() );
- TS_FAIL("unimplemented");
+ // ensure that certain items were found
+ ArrayType arrayType(d_em->mkArrayType(d_em->integerType(), d_em->integerType()));
+ Node zeroes = d_nm->mkConst(ArrayStoreAll(arrayType, d_em->mkConst(Rational(0))));
+ Node ones = d_nm->mkConst(ArrayStoreAll(arrayType, d_em->mkConst(Rational(1))));
+ Node twos = d_nm->mkConst(ArrayStoreAll(arrayType, d_em->mkConst(Rational(2))));
+ Node threes = d_nm->mkConst(ArrayStoreAll(arrayType, d_em->mkConst(Rational(3))));
+ Node fours = d_nm->mkConst(ArrayStoreAll(arrayType, d_em->mkConst(Rational(4))));
+ Node tens = d_nm->mkConst(ArrayStoreAll(arrayType, d_em->mkConst(Rational(10))));
+
+ Node zero = d_nm->mkConst(Rational(0));
+ Node one = d_nm->mkConst(Rational(1));
+ Node two = d_nm->mkConst(Rational(2));
+ Node three = d_nm->mkConst(Rational(3));
+ Node four = d_nm->mkConst(Rational(4));
+ Node five = d_nm->mkConst(Rational(5));
+ Node eleven = d_nm->mkConst(Rational(11));
+
+ // FIXME: the arrays enumerator isn't currently a fair enumerator,
+ // so these will fail; disable them for now
+ //TS_ASSERT( elts.find( d_nm->mkNode(STORE, ones, zero, zero) ) != elts.end() );
+ //TS_ASSERT( elts.find( d_nm->mkNode(STORE, tens, four, five) ) != elts.end() );
+ //TS_ASSERT( elts.find( d_nm->mkNode(STORE, d_nm->mkNode(STORE, d_nm->mkNode(STORE, fours, eleven, two), two, one), zero, two) ) != elts.end() );
+ //TS_ASSERT( elts.find( threes ) != elts.end() );
+ //TS_ASSERT( elts.find( d_nm->mkNode(STORE, d_nm->mkNode(STORE, d_nm->mkNode(STORE, d_nm->mkNode(STORE, twos, three, zero), two, zero), one, zero), zero, zero) ) != elts.end() );
}
- // remove this when ArrayConst is available
- template <class T, class U> inline bool ArrayConst(const T&, const U&) { return false; }
-
- void NOtestArraysFinite() {
- TypeEnumerator te(d_nm->mkArrayType(d_nm->mkBitVectorType(2), d_nm->booleanType()));
- TS_ASSERT_EQUALS(*te, d_nm->mkConst(ArrayConst(d_nm->mkConst(BitVector(0)), d_nm->mkConst(false))));
- TS_ASSERT_EQUALS(*++te, d_nm->mkConst(ArrayConst(d_nm->mkConst(BitVector(0)), d_nm->mkConst(true))));
- TS_ASSERT_EQUALS(*++te, d_nm->mkConst(ArrayConst(d_nm->mkConst(BitVector(1)), d_nm->mkConst(false))));
- TS_ASSERT_EQUALS(*++te, d_nm->mkConst(ArrayConst(d_nm->mkConst(BitVector(1)), d_nm->mkConst(true))));
- TS_ASSERT_EQUALS(*++te, d_nm->mkConst(ArrayConst(d_nm->mkConst(BitVector(2)), d_nm->mkConst(false))));
- TS_ASSERT_EQUALS(*++te, d_nm->mkConst(ArrayConst(d_nm->mkConst(BitVector(2)), d_nm->mkConst(true))));
- TS_ASSERT_EQUALS(*++te, d_nm->mkConst(ArrayConst(d_nm->mkConst(BitVector(3)), d_nm->mkConst(false))));
- TS_ASSERT_EQUALS(*++te, d_nm->mkConst(ArrayConst(d_nm->mkConst(BitVector(3)), d_nm->mkConst(true))));
+ void testArraysFinite() {
+ ArrayType arrType(d_em->mkArrayType(d_em->mkBitVectorType(2), d_em->booleanType()));
+ TypeEnumerator te(TypeNode::fromType(arrType));
+ TS_ASSERT( ! te.isFinished() );
+ TS_ASSERT_EQUALS(*te, d_nm->mkConst(ArrayStoreAll(arrType, d_em->mkConst(false))));
+ TS_ASSERT( ! te.isFinished() );
+ TS_ASSERT_EQUALS(*++te, d_nm->mkConst(ArrayStoreAll(arrType, d_em->mkConst(true))));
+ TS_ASSERT( ! te.isFinished() );
+ TS_ASSERT_EQUALS(*++te, d_nm->mkConst(ArrayStoreAll(arrType, d_em->mkConst(false))));
+ TS_ASSERT( ! te.isFinished() );
+ TS_ASSERT_EQUALS(*++te, d_nm->mkConst(ArrayStoreAll(arrType, d_em->mkConst(true))));
+ TS_ASSERT( ! te.isFinished() );
+ TS_ASSERT_EQUALS(*++te, d_nm->mkConst(ArrayStoreAll(arrType, d_em->mkConst(false))));
+ TS_ASSERT( ! te.isFinished() );
+ TS_ASSERT_EQUALS(*++te, d_nm->mkConst(ArrayStoreAll(arrType, d_em->mkConst(true))));
+ TS_ASSERT( ! te.isFinished() );
+ TS_ASSERT_EQUALS(*++te, d_nm->mkConst(ArrayStoreAll(arrType, d_em->mkConst(false))));
+ TS_ASSERT( ! te.isFinished() );
+ TS_ASSERT_EQUALS(*++te, d_nm->mkConst(ArrayStoreAll(arrType, d_em->mkConst(true))));
+ TS_ASSERT( ! te.isFinished() );
TS_ASSERT_THROWS(*++te, NoMoreValuesException);
+ TS_ASSERT( te.isFinished() );
TS_ASSERT_THROWS(*++te, NoMoreValuesException);
+ TS_ASSERT( te.isFinished() );
TS_ASSERT_THROWS(*++te, NoMoreValuesException);
+ TS_ASSERT( te.isFinished() );
}
void testBV() {
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback