read_only = true
help = "abort if synthesis conjecture is not single invocation"
+[[option]]
+ name = "sygusConstRepairAbort"
+ category = "regular"
+ long = "sygus-crepair-abort"
+ type = "bool"
+ default = "false"
+ read_only = true
+ help = "abort if constant repair techniques are not applicable"
+
[[option]]
name = "sygusUnif"
category = "regular"
// initialize the sygus constant repair utility
if (options::sygusRepairConst())
{
- d_sygus_rconst->initialize(d_base_inst, d_candidates);
+ d_sygus_rconst->initialize(d_base_inst.negate(), d_candidates);
+ if (options::sygusConstRepairAbort())
+ {
+ if (!d_sygus_rconst->isActive())
+ {
+ // no constant repair is possible: abort
+ std::stringstream ss;
+ ss << "Grammar does not allow repair constants." << std::endl;
+ throw LogicException(ss.str());
+ }
+ }
}
// register this term with sygus database and other utilities that impact
lems.push_back(rlem);
}
-bool Cegis::usingRepairConst() { return d_using_gr_repair; }
+bool Cegis::usingRepairConst() { return true; }
void Cegis::getRefinementEvalLemmas(const std::vector<Node>& vs,
const std::vector<Node>& ms,
}
}
+bool SygusRepairConst::isActive() const
+{
+ return !d_base_inst.isNull() && d_allow_constant_grammar;
+}
+
bool SygusRepairConst::repairSolution(const std::vector<Node>& candidates,
const std::vector<Node>& candidate_values,
std::vector<Node>& repair_cv,
Assert(candidates.size() == candidate_values.size());
// if no grammar type allows constants, no repair is possible
- if (d_base_inst.isNull() || !d_allow_constant_grammar)
+ if (!isActive())
{
return false;
}
const std::vector<Node>& sk_vars)
{
NodeManager* nm = NodeManager::currentNM();
- Node body = d_base_inst.negate();
+ Node body = d_base_inst;
Trace("sygus-repair-const") << " Substitute skeletons..." << std::endl;
body = body.substitute(candidates.begin(),
candidates.end(),
const std::vector<Node>& candidate_values,
std::vector<Node>& repair_cv,
bool useConstantsAsHoles = false);
+ /**
+ * Return whether this module has the possibility to repair solutions. This is
+ * true if this module has been initialized, and at least one candidate has
+ * an "any constant" constructor.
+ */
+ bool isActive() const;
/** must repair?
*
* This returns true if n must be repaired for it to be a valid solution.