From 5e2d39ccd22f38c6a3f2aab24136b07b65b3f81e Mon Sep 17 00:00:00 2001 From: Andrew Reynolds Date: Wed, 27 Nov 2019 15:59:36 -0600 Subject: [PATCH] Fix sygus inference for choice functions introduced at preprocess (#3500) --- src/preprocessing/passes/sygus_inference.cpp | 2 +- test/regress/CMakeLists.txt | 1 + test/regress/regress1/sygus/issue3498.smt2 | 7 +++++++ 3 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 test/regress/regress1/sygus/issue3498.smt2 diff --git a/src/preprocessing/passes/sygus_inference.cpp b/src/preprocessing/passes/sygus_inference.cpp index 930edf869..6708f3c3a 100644 --- a/src/preprocessing/passes/sygus_inference.cpp +++ b/src/preprocessing/passes/sygus_inference.cpp @@ -202,7 +202,7 @@ bool SygusInference::solveSygus(std::vector& 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; diff --git a/test/regress/CMakeLists.txt b/test/regress/CMakeLists.txt index 2182beaa8..e7252834e 100644 --- a/test/regress/CMakeLists.txt +++ b/test/regress/CMakeLists.txt @@ -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 index 000000000..9fa8fdc1e --- /dev/null +++ b/test/regress/regress1/sygus/issue3498.smt2 @@ -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) -- 2.30.2