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())
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 );
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")
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;
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);
}
}