Fix type enumeration for non first-class sorts in FMF (#6719)
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>
Tue, 22 Jun 2021 16:51:07 +0000 (11:51 -0500)
committerGitHub <noreply@github.com>
Tue, 22 Jun 2021 16:51:07 +0000 (16:51 +0000)
Fixes #6690.

src/theory/quantifiers/fmf/full_model_check.cpp
test/regress/CMakeLists.txt
test/regress/regress1/fmf/issue6690-re-enum.smt2 [new file with mode: 0644]

index 808db7aec59c715eb64edb0f49bf92e21d1c0203..c6f38f29815c84aaef0b5479165ebd7dd11a0ce8 100644 (file)
@@ -941,8 +941,9 @@ void FullModelChecker::doCheck(FirstOrderModelFmc * fm, Node f, Def & d, Node n
   else if( n.getNumChildren()==0 ){
     Node r = n;
     if( !n.isConst() ){
-      if( !fm->hasTerm(n) ){
-        r = getSomeDomainElement(fm, n.getType() );
+      TypeNode tn = n.getType();
+      if( !fm->hasTerm(n) && tn.isFirstClass() ){
+        r = getSomeDomainElement(fm, tn );
       }
       r = fm->getRepresentative( r );
     }
index 444e4c7f6e5725b61911973c970579f30186a9b1..ca281af7b97e2077ec6ee1c6638538d5999ada08 100644 (file)
@@ -1590,6 +1590,7 @@ set(regress_1_tests
   regress1/fmf/issue4068-si-qf.smt2
   regress1/fmf/issue4225-univ-fun.smt2
   regress1/fmf/issue5738-dt-interp-finite.smt2
+  regress1/fmf/issue6690-re-enum.smt2
   regress1/fmf/issue916-fmf-or.smt2
   regress1/fmf/jasmin-cdt-crash.smt2
   regress1/fmf/loopy_coda.smt2
diff --git a/test/regress/regress1/fmf/issue6690-re-enum.smt2 b/test/regress/regress1/fmf/issue6690-re-enum.smt2
new file mode 100644 (file)
index 0000000..35c8eab
--- /dev/null
@@ -0,0 +1,5 @@
+(set-logic ALL)
+(set-info :status unsat)
+(set-option :finite-model-find true)
+(assert (forall ((a String)) (forall ((b String)) (str.in_re a (re.++ re.allchar (str.to_re b))))))
+(check-sat)