summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>2019-12-02 11:15:16 -0600
committerGitHub <noreply@github.com>2019-12-02 11:15:16 -0600
commit74ca9f79b0285a1139c217fbd6f3937ed66ac885 (patch)
tree598cc97c50c11d161ae216d824c43aa19fdacd31
parenta39f1719ede136579cbd15c34b6a763a2b08a464 (diff)
Fix case of higher-order + sygus inference (#3509)
-rw-r--r--src/preprocessing/passes/sygus_inference.cpp13
-rw-r--r--test/regress/CMakeLists.txt1
-rw-r--r--test/regress/regress1/sygus/issue3507.smt28
3 files changed, 16 insertions, 6 deletions
diff --git a/src/preprocessing/passes/sygus_inference.cpp b/src/preprocessing/passes/sygus_inference.cpp
index 6708f3c3a..24484359a 100644
--- a/src/preprocessing/passes/sygus_inference.cpp
+++ b/src/preprocessing/passes/sygus_inference.cpp
@@ -189,15 +189,16 @@ bool SygusInference::solveSygus(std::vector<Node>& assertions,
if (cur.getKind() == APPLY_UF)
{
Node op = cur.getOperator();
- if (std::find(free_functions.begin(), free_functions.end(), op)
- == free_functions.end())
- {
- free_functions.push_back(op);
- }
+ // visit the operator, which might not be a variable
+ visit.push_back(op);
}
else if (cur.isVar() && cur.getKind() != BOUND_VARIABLE)
{
- // a free variable is a 0-argument function to synthesize
+ // We are either in the case of a free first-order constant or a
+ // function in a higher-order context. We add to free_functions
+ // in either case. Note that a free constant that is not in a
+ // higher-order context is a 0-argument function-to-synthesize.
+ // We should not have traversed here before due to our visited cache.
Assert(std::find(free_functions.begin(), free_functions.end(), cur)
== free_functions.end());
free_functions.push_back(cur);
diff --git a/test/regress/CMakeLists.txt b/test/regress/CMakeLists.txt
index da9679e2d..946f54650 100644
--- a/test/regress/CMakeLists.txt
+++ b/test/regress/CMakeLists.txt
@@ -1724,6 +1724,7 @@ set(regress_1_tests
regress1/sygus/issue3320-quant.sy
regress1/sygus/issue3461.sy
regress1/sygus/issue3498.smt2
+ regress1/sygus/issue3507.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/issue3507.smt2 b/test/regress/regress1/sygus/issue3507.smt2
new file mode 100644
index 000000000..aca7a61b0
--- /dev/null
+++ b/test/regress/regress1/sygus/issue3507.smt2
@@ -0,0 +1,8 @@
+; EXPECT: sat
+; COMMAND-LINE: --sygus-inference --uf-ho
+(set-logic ALL)
+(declare-fun f (Int) Bool)
+(declare-fun g (Int) Bool)
+(assert (and (distinct f g) (g 0)))
+(assert (exists ((x Int)) (f x)))
+(check-sat)
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback