summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>2020-05-20 07:47:24 -0500
committerGitHub <noreply@github.com>2020-05-20 07:47:24 -0500
commit6ae3e7167132e9060257d4f3d876f4e49e67b2a8 (patch)
tree59c18c32abcded14e6694468f2dae0b4c486203c /test
parentc3620b97ea7fac5dd16f5bd99f8dd10226c60d92 (diff)
Fix parametric datatype instantiation (#4493)
A bug was introduced when adding the Node-level datatype implementation in d803e7f. The code did not probably get the arity of a sort constructor. This adds TypeNode::getSortConstructorArity and uses it during parametric datatype type resolution.
Diffstat (limited to 'test')
-rw-r--r--test/regress/CMakeLists.txt1
-rw-r--r--test/regress/regress0/datatypes/parametric-alt-list.cvc13
2 files changed, 14 insertions, 0 deletions
diff --git a/test/regress/CMakeLists.txt b/test/regress/CMakeLists.txt
index 6f948b02b..d5174af5e 100644
--- a/test/regress/CMakeLists.txt
+++ b/test/regress/CMakeLists.txt
@@ -416,6 +416,7 @@ set(regress_0_tests
regress0/datatypes/mutually-recursive.cvc
regress0/datatypes/pair-bool-bool.cvc
regress0/datatypes/pair-real-bool.smt2
+ regress0/datatypes/parametric-alt-list.cvc
regress0/datatypes/rec1.cvc
regress0/datatypes/rec2.cvc
regress0/datatypes/rec4.cvc
diff --git a/test/regress/regress0/datatypes/parametric-alt-list.cvc b/test/regress/regress0/datatypes/parametric-alt-list.cvc
new file mode 100644
index 000000000..f523272ae
--- /dev/null
+++ b/test/regress/regress0/datatypes/parametric-alt-list.cvc
@@ -0,0 +1,13 @@
+% EXPECT: sat
+DATATYPE
+List[X,Y] = nil | cons (head: X, tail: List[Y,X])
+END;
+
+x : List[INT,STRING]; % = cons(1, nil::List[STRING,INT]);
+y : List[INT,STRING];
+
+ASSERT NOT( x = y );
+
+ASSERT NOT ( x = tail(tail(x)) );
+
+CHECKSAT;
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback