summaryrefslogtreecommitdiff
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
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
-rw-r--r--src/smt/smt_engine.cpp6
-rw-r--r--src/theory/quantifiers/sygus_inference.cpp21
2 files changed, 23 insertions, 4 deletions
diff --git a/src/smt/smt_engine.cpp b/src/smt/smt_engine.cpp
index 116d2fe23..15b6e2fc9 100644
--- a/src/smt/smt_engine.cpp
+++ b/src/smt/smt_engine.cpp
@@ -1403,6 +1403,8 @@ void SmtEngine::setDefaults() {
d_logic = d_logic.getUnlockedCopy();
d_logic.enableTheory(THEORY_DATATYPES);
d_logic.lock();
+ // since we are trying to recast as sygus, we assume the input is sygus
+ is_sygus = true;
}
if ((options::checkModels() || options::checkSynthSol())
@@ -2053,6 +2055,10 @@ void SmtEngine::setDefaults() {
if( !options::miniscopeQuantFreeVar.wasSetByUser() ){
options::miniscopeQuantFreeVar.set( false );
}
+ if (!options::quantSplit.wasSetByUser())
+ {
+ options::quantSplit.set(false);
+ }
//rewrite divk
if( !options::rewriteDivk.wasSetByUser()) {
options::rewriteDivk.set( true );
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