summaryrefslogtreecommitdiff
path: root/src/theory
diff options
context:
space:
mode:
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>2018-08-06 18:55:29 -0500
committerAndres Noetzli <andres.noetzli@gmail.com>2018-08-06 16:55:29 -0700
commit79121aeeb03bf70323208d5059e23dfb62a83903 (patch)
tree11d96cd290f59f506d039de3df008d97ed8451e8 /src/theory
parent352034696fdce868452d097d155f195ea1fa949c (diff)
Fixes for sygus inference (#2238)
This includes: - Enabling sygus-specific options in SmtEngine::setDefaults, - Disabling a variant of miniscoping (triggered by many chc-comp18 benchmarks), - Treating free constants as functions to synthesize
Diffstat (limited to 'src/theory')
-rw-r--r--src/theory/quantifiers/sygus_inference.cpp21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/theory/quantifiers/sygus_inference.cpp b/src/theory/quantifiers/sygus_inference.cpp
index fe5761e03..6232de6fe 100644
--- a/src/theory/quantifiers/sygus_inference.cpp
+++ b/src/theory/quantifiers/sygus_inference.cpp
@@ -144,6 +144,13 @@ bool SygusInference::simplify(std::vector<Node>& assertions)
free_functions.push_back(op);
}
}
+ else if (cur.getKind() == VARIABLE)
+ {
+ // a free variable is a 0-argument function to synthesize
+ Assert(std::find(free_functions.begin(), free_functions.end(), cur)
+ == free_functions.end());
+ free_functions.push_back(cur);
+ }
else if (cur.getKind() == FORALL)
{
Trace("sygus-infer")
@@ -159,7 +166,7 @@ bool SygusInference::simplify(std::vector<Node>& assertions)
processed_assertions.push_back(pas);
}
- // if no free function symbols, there is no use changing into SyGuS
+ // no functions to synthesize
if (free_functions.empty())
{
Trace("sygus-infer") << "...fail: no free function symbols." << std::endl;
@@ -252,16 +259,22 @@ bool SygusInference::simplify(std::vector<Node>& assertions)
if (itffv != ff_var_to_ff.end())
{
Node ff = itffv->second;
+ Expr body = it->second;
std::vector<Expr> args;
- for (const Node& v : lambda[0])
+ // if it is a non-constant function
+ if (lambda.getKind() == LAMBDA)
{
- args.push_back(v.toExpr());
+ for (const Node& v : lambda[0])
+ {
+ args.push_back(v.toExpr());
+ }
+ body = it->second[1];
}
Trace("sygus-infer") << "Define " << ff << " as " << it->second
<< std::endl;
final_ff.push_back(ff);
final_ff_sol.push_back(it->second);
- master_smte->defineFunction(ff.toExpr(), args, it->second[1]);
+ master_smte->defineFunction(ff.toExpr(), args, body);
}
}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback