Trace("srs-input") << "Make synth variables for types..." << std::endl;
// We will generate a fixed number of variables per type. These are the
// variables that appear as free variables in the rewrites we generate.
- unsigned nvars = options().quantifiers.sygusRewSynthInputNVars;
+ uint64_t nvars = options().quantifiers.sygusRewSynthInputNVars;
// must have at least one variable per type
nvars = nvars < 1 ? 1 : nvars;
std::map<TypeNode, std::vector<Node> > tvars;
std::vector<TypeNode> allVarTypes;
std::vector<Node> allVars;
- unsigned varCounter = 0;
+ uint64_t varCounter = 0;
for (std::pair<const TypeNode, bool> tfp : typesFound)
{
TypeNode tn = tfp.first;
// This ensures that no type in our grammar has zero constructors. If
// our input does not contain a Boolean variable, we need not allocate any
// Boolean variables here.
- unsigned useNVars =
+ uint64_t useNVars =
(options().quantifiers.sygusRewSynthInputUseBool || !tn.isBoolean())
? nvars
: (hasBoolVar ? 1 : 0);
- for (unsigned i = 0; i < useNVars; i++)
+ for (uint64_t i = 0; i < useNVars; i++)
{
// We must have a good name for these variables, these are
// the ones output in rewrite rules. We choose
std::stringstream ssv;
if (varCounter < 26)
{
- ssv << static_cast<char>(varCounter + 61);
+ ssv << static_cast<char>(varCounter + static_cast<uint64_t>('A'));
}
else
{
}
Trace("srs-input") << "...finished." << std::endl;
+ // if the problem is trivial, e.g. contains no non-constant terms, then we
+ // exit with an exception.
+ if (allVars.empty())
+ {
+ throw Exception("No terms to consider for synthesizing rewrites");
+ return PreprocessingPassResult::NO_CONFLICT;
+ }
+
Trace("srs-input") << "Convert subterms to free variable form..."
<< std::endl;
// Replace all free variables with bound variables. This ensures that
// add the variables for the type
TypeNode ctt = ct.getType();
- Assert(tvars.find(ctt) != tvars.end());
std::vector<TypeNode> argList;
// we add variable constructors if we are not Boolean, we are interested
// in purely propositional rewrites (via the option), or this term is
if (!ctt.isBoolean() || options().quantifiers.sygusRewSynthInputUseBool
|| ct.getKind() == BOUND_VARIABLE)
{
+ Assert(tvars.find(ctt) != tvars.end())
+ << "Unexpected type " << ctt << " for " << ct;
for (const Node& v : tvars[ctt])
{
std::stringstream ssc;