"be declared in logic ");
}
// we allow overloading for function declarations
- Expr func = PARSER_STATE->mkVar(name, t, ExprManager::VAR_FLAG_NONE, true);
- cmd->reset(new DeclareFunctionCommand(name, func, t));
+ if (PARSER_STATE->sygus())
+ {
+ // it is a higher-order universal variable
+ PARSER_STATE->mkSygusVar(name, t);
+ cmd->reset(new EmptyCommand());
+ }
+ else
+ {
+ Expr func = PARSER_STATE->mkVar(name, t, ExprManager::VAR_FLAG_NONE, true);
+ cmd->reset(new DeclareFunctionCommand(name, func, t));
+ }
}
| /* function definition */
DEFINE_FUN_TOK { PARSER_STATE->checkThatLogicIsSet(); }
d_sygusVars.push_back(e);
d_sygusVarPrimed[e] = false;
if( isPrimed ){
+ d_sygusInvVars.push_back(e);
std::stringstream ss;
ss << name << "'";
Expr ep = mkBoundVar(ss.str(), type);
d_sygusVars.push_back(ep);
+ d_sygusInvVars.push_back(ep);
d_sygusVarPrimed[ep] = true;
}
return e;
}
const void Smt2::getSygusPrimedVars( std::vector<Expr>& vars, bool isPrimed ) {
- for( unsigned i=0; i<d_sygusVars.size(); i++ ){
- Expr v = d_sygusVars[i];
+ for (unsigned i = 0, size = d_sygusInvVars.size(); i < size; i++)
+ {
+ Expr v = d_sygusInvVars[i];
std::map< Expr, bool >::iterator it = d_sygusVarPrimed.find( v );
if( it!=d_sygusVarPrimed.end() ){
if( it->second==isPrimed ){
vars.push_back( v );
}
- }else{
- //should never happen
}
}
}
std::unordered_map<std::string, Kind> operatorKindMap;
std::pair<Expr, std::string> d_lastNamedTerm;
// for sygus
- std::vector<Expr> d_sygusVars, d_sygusConstraints, d_sygusFunSymbols;
+ std::vector<Expr> d_sygusVars, d_sygusInvVars, d_sygusConstraints,
+ d_sygusFunSymbols;
std::map< Expr, bool > d_sygusVarPrimed;
protected: