summaryrefslogtreecommitdiff
path: root/test/unit
diff options
context:
space:
mode:
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>2020-03-06 14:27:10 -0600
committerGitHub <noreply@github.com>2020-03-06 14:27:10 -0600
commit89337334236176bff2d561c42b9b55ab9d91bd62 (patch)
treea7ca068313b3625865bedc425a9607b814e5868e /test/unit
parentb9347f7d0ca130f85df103e5271536a165a04a64 (diff)
Remove tester name from APIs (#3929)
This removes the field "tester name" from the Expr-level and Term-level APIs. This field is an artifact of parsing and thus should be handled in the parsers. This refactor uncovered an issue in our regressions, namely our smt version >= 2.6 was not strictly complaint, since the symbol is-cons was being automatically defined for testers of constructors cons. This disables this behavior when strict mode is enabled. It updates the regressions with this issue. This is work towards parser migration.
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/api/datatype_api_black.h3
-rw-r--r--test/unit/util/datatype_black.h48
2 files changed, 24 insertions, 27 deletions
diff --git a/test/unit/api/datatype_api_black.h b/test/unit/api/datatype_api_black.h
index 2d7a9c12b..dcccd2628 100644
--- a/test/unit/api/datatype_api_black.h
+++ b/test/unit/api/datatype_api_black.h
@@ -83,9 +83,6 @@ void DatatypeBlack::testDatatypeStructs()
DatatypeConstructor dcons = dt[0];
Term consTerm = dcons.getConstructorTerm();
TS_ASSERT(dcons.getNumSelectors() == 2);
- // get tester name: notice this is only to support the Z3-style datatypes
- // prior to SMT-LIB 2.6 where testers where changed to indexed symbols.
- TS_ASSERT_THROWS_NOTHING(dcons.getTesterName());
// create datatype sort to test
DatatypeDecl dtypeSpecEnum = d_solver.mkDatatypeDecl("enum");
diff --git a/test/unit/util/datatype_black.h b/test/unit/util/datatype_black.h
index e81caf36f..5b98f4d13 100644
--- a/test/unit/util/datatype_black.h
+++ b/test/unit/util/datatype_black.h
@@ -49,10 +49,10 @@ class DatatypeBlack : public CxxTest::TestSuite {
void testEnumeration() {
Datatype colors(d_em, "colors");
- DatatypeConstructor yellow("yellow", "is_yellow");
- DatatypeConstructor blue("blue", "is_blue");
- DatatypeConstructor green("green", "is_green");
- DatatypeConstructor red("red", "is_red");
+ DatatypeConstructor yellow("yellow");
+ DatatypeConstructor blue("blue");
+ DatatypeConstructor green("green");
+ DatatypeConstructor red("red");
colors.addConstructor(yellow);
colors.addConstructor(blue);
@@ -87,11 +87,11 @@ class DatatypeBlack : public CxxTest::TestSuite {
void testNat() {
Datatype nat(d_em, "nat");
- DatatypeConstructor succ("succ", "is_succ");
+ DatatypeConstructor succ("succ");
succ.addArg("pred", DatatypeSelfType());
nat.addConstructor(succ);
- DatatypeConstructor zero("zero", "is_zero");
+ DatatypeConstructor zero("zero");
nat.addConstructor(zero);
Debug("datatypes") << nat << std::endl;
@@ -115,12 +115,12 @@ class DatatypeBlack : public CxxTest::TestSuite {
Datatype tree(d_em, "tree");
Type integerType = d_em->integerType();
- DatatypeConstructor node("node", "is_node");
+ DatatypeConstructor node("node");
node.addArg("left", DatatypeSelfType());
node.addArg("right", DatatypeSelfType());
tree.addConstructor(node);
- DatatypeConstructor leaf("leaf", "is_leaf");
+ DatatypeConstructor leaf("leaf");
leaf.addArg("leaf", integerType);
tree.addConstructor(leaf);
@@ -147,12 +147,12 @@ class DatatypeBlack : public CxxTest::TestSuite {
Datatype list(d_em, "list");
Type integerType = d_em->integerType();
- DatatypeConstructor cons("cons", "is_cons");
+ DatatypeConstructor cons("cons");
cons.addArg("car", integerType);
cons.addArg("cdr", DatatypeSelfType());
list.addConstructor(cons);
- DatatypeConstructor nil("nil", "is_nil");
+ DatatypeConstructor nil("nil");
list.addConstructor(nil);
Debug("datatypes") << list << std::endl;
@@ -172,12 +172,12 @@ class DatatypeBlack : public CxxTest::TestSuite {
Datatype list(d_em, "list");
Type realType = d_em->realType();
- DatatypeConstructor cons("cons", "is_cons");
+ DatatypeConstructor cons("cons");
cons.addArg("car", realType);
cons.addArg("cdr", DatatypeSelfType());
list.addConstructor(cons);
- DatatypeConstructor nil("nil", "is_nil");
+ DatatypeConstructor nil("nil");
list.addConstructor(nil);
Debug("datatypes") << list << std::endl;
@@ -197,12 +197,12 @@ class DatatypeBlack : public CxxTest::TestSuite {
Datatype list(d_em, "list");
Type booleanType = d_em->booleanType();
- DatatypeConstructor cons("cons", "is_cons");
+ DatatypeConstructor cons("cons");
cons.addArg("car", booleanType);
cons.addArg("cdr", DatatypeSelfType());
list.addConstructor(cons);
- DatatypeConstructor nil("nil", "is_nil");
+ DatatypeConstructor nil("nil");
list.addConstructor(nil);
Debug("datatypes") << list << std::endl;
@@ -227,24 +227,24 @@ class DatatypeBlack : public CxxTest::TestSuite {
* END;
*/
Datatype tree(d_em, "tree");
- DatatypeConstructor node("node", "is_node");
+ DatatypeConstructor node("node");
node.addArg("left", DatatypeSelfType());
node.addArg("right", DatatypeSelfType());
tree.addConstructor(node);
- DatatypeConstructor leaf("leaf", "is_leaf");
+ DatatypeConstructor leaf("leaf");
leaf.addArg("leaf", DatatypeUnresolvedType("list"));
tree.addConstructor(leaf);
Debug("datatypes") << tree << std::endl;
Datatype list(d_em, "list");
- DatatypeConstructor cons("cons", "is_cons");
+ DatatypeConstructor cons("cons");
cons.addArg("car", DatatypeUnresolvedType("tree"));
cons.addArg("cdr", DatatypeSelfType());
list.addConstructor(cons);
- DatatypeConstructor nil("nil", "is_nil");
+ DatatypeConstructor nil("nil");
list.addConstructor(nil);
Debug("datatypes") << list << std::endl;
@@ -281,27 +281,27 @@ class DatatypeBlack : public CxxTest::TestSuite {
void testMutualListTrees2()
{
Datatype tree(d_em, "tree");
- DatatypeConstructor node("node", "is_node");
+ DatatypeConstructor node("node");
node.addArg("left", DatatypeSelfType());
node.addArg("right", DatatypeSelfType());
tree.addConstructor(node);
- DatatypeConstructor leaf("leaf", "is_leaf");
+ DatatypeConstructor leaf("leaf");
leaf.addArg("leaf", DatatypeUnresolvedType("list"));
tree.addConstructor(leaf);
Datatype list(d_em, "list");
- DatatypeConstructor cons("cons", "is_cons");
+ DatatypeConstructor cons("cons");
cons.addArg("car", DatatypeUnresolvedType("tree"));
cons.addArg("cdr", DatatypeSelfType());
list.addConstructor(cons);
- DatatypeConstructor nil("nil", "is_nil");
+ DatatypeConstructor nil("nil");
list.addConstructor(nil);
// add another constructor to list datatype resulting in an
// "otherNil-list"
- DatatypeConstructor otherNil("otherNil", "is_otherNil");
+ DatatypeConstructor otherNil("otherNil");
list.addConstructor(otherNil);
vector<Datatype> dts;
@@ -329,7 +329,7 @@ class DatatypeBlack : public CxxTest::TestSuite {
void testNotSoWellFounded() {
Datatype tree(d_em, "tree");
- DatatypeConstructor node("node", "is_node");
+ DatatypeConstructor node("node");
node.addArg("left", DatatypeSelfType());
node.addArg("right", DatatypeSelfType());
tree.addConstructor(node);
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback