d_qe = qe;
// collect the enumerator types and form the strategy
- collectEnumeratorTypes(d_root, role_equal);
+ buildStrategyGraph(d_root, role_equal);
// add the enumerators
enums.insert(enums.end(), d_esym_list.begin(), d_esym_list.end());
// finish the initialization of the strategy
}
// ----------------------------- establishing enumeration types
-void SygusUnifStrategy::registerEnumerator(Node et,
+void SygusUnifStrategy::registerStrategyPoint(Node et,
TypeNode tn,
EnumRole enum_role,
bool inSearch)
}
}
-void SygusUnifStrategy::collectEnumeratorTypes(TypeNode tn, NodeRole nrole)
+void SygusUnifStrategy::buildStrategyGraph(TypeNode tn, NodeRole nrole)
{
NodeManager* nm = NodeManager::currentNM();
if (d_tinfo.find(tn) == d_tinfo.end())
if (nrole == role_ite_condition)
{
Trace("sygus-unif-debug") << "...this register (non-io)" << std::endl;
- registerEnumerator(ee, tn, erole, true);
+ registerStrategyPoint(ee, tn, erole, true);
return;
}
}
}
}
- if (cop_to_strat.find(cop) == cop_to_strat.end())
- {
- Trace("sygus-unif") << "...constructor " << cop
- << " does not correspond to a strategy." << std::endl;
- search_this = true;
- }
- else
+
+ std::map<Node, std::vector<StrategyType> >::iterator itcs = cop_to_strat.find(cop);
+ if (itcs != cop_to_strat.end())
{
Trace("sygus-unif") << "-> constructor " << cop
<< " matches strategy for " << eut.getKind() << "..."
// collect children types
for (unsigned k = 0, size = cop_to_carg_list[cop].size(); k < size; k++)
{
- TypeNode tn = sktns[cop_to_carg_list[cop][k]];
+ TypeNode ctn = sktns[cop_to_carg_list[cop][k]];
Trace("sygus-unif-debug")
<< " Child type " << k << " : "
- << static_cast<DatatypeType>(tn.toType()).getDatatype().getName()
+ << static_cast<DatatypeType>(ctn.toType()).getDatatype().getName()
<< std::endl;
- cop_to_child_types[cop].push_back(tn);
+ cop_to_child_types[cop].push_back(ctn);
}
+ // if there are checks on the consistency of child types wrt strategies,
+ // these should be enforced here. We currently have none.
+ }
+ if (cop_to_strat.find(cop) == cop_to_strat.end())
+ {
+ Trace("sygus-unif") << "...constructor " << cop
+ << " does not correspond to a strategy." << std::endl;
+ search_this = true;
}
}
// check whether we should also enumerate the current type
- Trace("sygus-unif-debug2") << " register this enumerator..." << std::endl;
- registerEnumerator(ee, tn, erole, search_this);
+ Trace("sygus-unif-debug2") << " register this strategy ..." << std::endl;
+ registerStrategyPoint(ee, tn, erole, search_this);
if (cop_to_strat.empty())
{
.getDatatype()
.getName()
<< std::endl;
- registerEnumerator(et, ct, erole_c, true);
+ registerStrategyPoint(et, ct, erole_c, true);
d_einfo[et].d_template = cop_to_child_templ[cop][j];
d_einfo[et].d_template_arg = cop_to_child_templ_arg[cop][j];
Assert(!d_einfo[et].d_template.isNull());
<< "...child type enumerate "
<< ((DatatypeType)ct.toType()).getDatatype().getName()
<< ", node role = " << nrole_c << std::endl;
- collectEnumeratorTypes(ct, nrole_c);
+ buildStrategyGraph(ct, nrole_c);
// otherwise use the previous
Assert(d_tinfo[ct].d_enum.find(erole_c)
!= d_tinfo[ct].d_enum.end());
if (ei.isTemplated())
{
Trace(c) << ", templated : (lambda " << ei.d_template_arg << " "
- << ei.d_template << ")";
+ << ei.d_template << ")" << std::endl;
+ return;
}
Trace(c) << std::endl;
//-----------------------end debug printing
//------------------------------ strategy registration
- /** collect enumerator types
+ /** build strategy graph
*
* This builds the strategy for enumerated values of type tn for the given
* role of nrole, for solutions to function-to-synthesize of this class.
*/
- void collectEnumeratorTypes(TypeNode tn, NodeRole nrole);
+ void buildStrategyGraph(TypeNode tn, NodeRole nrole);
/** register enumerator
*
* This registers that et is an enumerator of type tn, having enumerator
* we may use enumerators for which this flag is false to represent strategy
* nodes that have child strategies.
*/
- void registerEnumerator(Node et,
+ void registerStrategyPoint(Node et,
TypeNode tn,
EnumRole enum_role,
bool inSearch);
--- /dev/null
+; EXPECT: unsat
+; COMMAND-LINE: --sygus-out=status
+(set-logic BV)
+
+(define-fun if0 ((x (BitVec 64)) (y (BitVec 64)) (z (BitVec 64))) (BitVec 64) (ite (= x #x0000000000000001) y z))
+
+(synth-fun f ( (x (BitVec 64))) (BitVec 64)
+(
+
+(Start (BitVec 64) (#x0000000000000000 #x0000000000000001 x (bvnot Start)
+ (bvand Start Start)
+ (bvor Start Start)
+ (bvxor Start Start)
+ (bvadd Start Start)
+ (if0 Start Start2 Start2)
+ (ite StartBool Start Start2)
+ ))
+(Start2 (BitVec 64) (#x0000000000000000 #x0000000000000002))
+(StartBool Bool ((= Start Start)))
+)
+)
+(constraint (= (f #x0000000000000001) #x0000000000000001))
+(constraint (= (f #x1ED2E25068744C80) #x0000000000000000))
+(constraint (= (f #x2D2144F9D8CDCBD6) #x0000000000000000))
+(constraint (= (f #xE5D371D100002E8A) #x0000000000000000))
+(constraint (= (f #xADFF6BA34EBDAD72) #x0000000000000000))
+(constraint (= (f #xDA9299B546AAB59A) #x0000000000000000))
+(constraint (= (f #x0000000000015C8A) #x0000000000000000))
+(constraint (= (f #x0000000000017066) #x0000000000000000))
+(constraint (= (f #x000000000001D9D8) #x0000000000000000))
+(constraint (= (f #x00000000000151AE) #x0000000000000000))
+(constraint (= (f #x0000000000017A14) #x0000000000000000))
+(constraint (= (f #xF0F0F0F0F0F0F0F2) #x0000000000000000))
+(check-synth)