Fix sygus inference for choice functions introduced at preprocess (#3500)
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>
Wed, 27 Nov 2019 21:59:36 +0000 (15:59 -0600)
committerGitHub <noreply@github.com>
Wed, 27 Nov 2019 21:59:36 +0000 (15:59 -0600)
src/preprocessing/passes/sygus_inference.cpp
test/regress/CMakeLists.txt
test/regress/regress1/sygus/issue3498.smt2 [new file with mode: 0644]

index 930edf869034f3f6848882dbed23bb48cdb3d10f..6708f3c3ab381a8d5a61f150ebe8533e71969eec 100644 (file)
@@ -202,7 +202,7 @@ bool SygusInference::solveSygus(std::vector<Node>& assertions,
                  == free_functions.end());
           free_functions.push_back(cur);
         }
-        else if (cur.getKind() == FORALL)
+        else if (cur.isClosure())
         {
           Trace("sygus-infer")
               << "...fail: non-top-level quantifier." << std::endl;
index 2182beaa8d37ebb6a2ab195dfe36c48bf204dd89..e7252834ee690f34abe20cab0ff37003f8d67748 100644 (file)
@@ -1722,6 +1722,7 @@ set(regress_1_tests
   regress1/sygus/issue3247.smt2
   regress1/sygus/issue3320-quant.sy
   regress1/sygus/issue3461.sy
+  regress1/sygus/issue3498.smt2
   regress1/sygus/large-const-simp.sy
   regress1/sygus/let-bug-simp.sy
   regress1/sygus/list-head-x.sy
diff --git a/test/regress/regress1/sygus/issue3498.smt2 b/test/regress/regress1/sygus/issue3498.smt2
new file mode 100644 (file)
index 0000000..9fa8fdc
--- /dev/null
@@ -0,0 +1,7 @@
+; EXPECT: sat
+; COMMAND-LINE: --sygus-inference --no-check-models
+(set-logic ALL)
+(declare-fun x () Real)
+(assert (= x 1))
+(assert (= (sqrt x) x))
+(check-sat)