This option was previously a way of knowing whether higher-order was enabled, which now should be queried via LogicInfo::isHigherOrder.
It also adds an optimization to hasFreeVar required for QCF to be robust and not take a performance hit due to HO operators.
bool hasFreeVar(TNode n)
{
+ // optimization for variables and constants
+ if (n.getNumChildren() == 0)
+ {
+ return n.getKind() == kind::BOUND_VARIABLE;
+ }
std::unordered_set<Node> fvs;
return getFreeVariables(n, fvs, false);
}
default = "false"
help = "group monotone sorts when enforcing fairness for finite model finding"
-[[option]]
- name = "ufHo"
- category = "regular"
- long = "uf-ho"
- type = "bool"
- default = "false"
- help = "enable support for higher-order reasoning"
-
[[option]]
name = "ufHoExt"
category = "regular"
* of the bounds that were relevant for the original
* bit-vectors.
*/
- if (childrenTypesChanged(original) && options().uf.ufHo)
+ if (childrenTypesChanged(original) && logicInfo().isHigherOrder())
{
throw TypeCheckingExceptionPrivate(
original,
}
dumpAssertions("post-repeat-simplify", as);
- if (options().uf.ufHo)
+ if (logicInfo().isHigherOrder())
{
d_passes["ho-elim"]->apply(&assertions);
}
if (logic.isHigherOrder())
{
- opts.uf.ufHo = true;
if (!opts.theory.assignFunctionValues)
{
// must assign function values
Assert(qi->d_var_num.find(n) != qi->d_var_num.end());
// rare case where we have a free variable in an operator, we are invalid
if (n.getKind() == ITE
- || (options::ufHo() && n.getKind() == APPLY_UF
- && expr::hasFreeVar(n.getOperator())))
+ || (n.getKind() == APPLY_UF && expr::hasFreeVar(n.getOperator())))
{
d_type = typ_invalid;
}else{
<< transitivityMatrix[i].back() << "\n";
// if i == 0, first child must be REFL step, standing for (= f f), which can
// be ignored in a first-order calculus
- Assert(i > 0 || d_children[0]->d_id == MERGED_THROUGH_REFLEXIVITY
- || options::ufHo());
+ // Notice if higher-order is disabled, the following holds:
+ // i > 0 || d_children[0]->d_id == MERGED_THROUGH_REFLEXIVITY
+ // We don't have access to whether we are higher-order in this context,
+ // so the above cannot be an assertion.
// recurse
if (i > 1)
{
{
case kind::EQUAL:
{
- if (logicInfo().isHigherOrder() && options::ufHoExt())
+ if (logicInfo().isHigherOrder() && options().uf.ufHoExt)
{
if (!pol && !d_state.isInConflict() && atom[0].getType().isFunction())
{