* Applying Andy's fix for datatypes bug #286; thanks for the quick work, Andy!
authorMorgan Deters <mdeters@gmail.com>
Wed, 16 Nov 2011 00:48:42 +0000 (00:48 +0000)
committerMorgan Deters <mdeters@gmail.com>
Wed, 16 Nov 2011 00:48:42 +0000 (00:48 +0000)
* Also some better configure script wording

config/bindings.m4
src/theory/datatypes/theory_datatypes.cpp
test/regress/regress0/datatypes/Makefile.am
test/regress/regress0/datatypes/bug286.cvc [new file with mode: 0644]

index 416a338da4a886199a2417832238be7f17b7dc9b..5306c8c774c545be805467d68740e4b036328b23 100644 (file)
@@ -143,9 +143,9 @@ else
       esac
       if test "$binding_error" = yes; then
         if test "$cvc4_check_for_bindings" = no; then
-          AC_MSG_ERROR([Language binding \`$binding' requested by user, but it cannot be built.])
+          AC_MSG_ERROR([Language binding \`$binding' requested by user, but it cannot be built (the preceding few lines should give an indication why this is).])
         else
-          AC_MSG_WARN([Language binding \`$binding' cannot be built.])
+          AC_MSG_WARN([Language binding \`$binding' cannot be built (the preceding few lines should give an indication why this is).])
         fi
       else
         CVC4_LANGUAGE_BINDINGS="${CVC4_LANGUAGE_BINDINGS:+$CVC4_LANGUAGE_BINDINGS }$binding"
index 08b142fe3c1c43571639107d92e5eed3f9d66728..6b067c6816e6b3b8fe0c3358bb2ea18c3447316f 100644 (file)
@@ -854,7 +854,8 @@ void TheoryDatatypes::merge(TNode a, TNode b) {
 }
 
 void TheoryDatatypes::addTermToLabels( Node t ) {
-  if( t.getKind() == VARIABLE || t.getKind() == APPLY_SELECTOR ) {
+  if( ( t.getKind() == VARIABLE || t.getKind() == APPLY_SELECTOR ) &&
+      t.getType().isDatatype() ) {
     Node tmp = find( t );
     if( tmp == t ) {
       //add to labels
index aa9b9ce0b543952e21502384296ad9557669f829..c4a4e2fdd281597598bfbd2392bb2cee51f963e0 100644 (file)
@@ -31,7 +31,8 @@ TESTS =       \
        v1l20009.cvc \
        v2l40025.cvc \
        v3l60006.cvc \
-       v5l30058.cvc
+       v5l30058.cvc \
+       bug286.cvc
 
 
 EXTRA_DIST = $(TESTS)
diff --git a/test/regress/regress0/datatypes/bug286.cvc b/test/regress/regress0/datatypes/bug286.cvc
new file mode 100644 (file)
index 0000000..d9b4d82
--- /dev/null
@@ -0,0 +1,6 @@
+% EXPECT: invalid
+% EXIT: 10
+DATATYPE foo = f(i:INT) END;
+x : foo;
+y : INT;
+QUERY x = f(y);