Node HoExtension::ppRewrite(Node node)
{
// convert HO_APPLY to APPLY_UF if fully applied
- if (node[0].getType().getNumChildren() == 2)
+ if (node.getKind() == HO_APPLY)
{
- Trace("uf-ho") << "uf-ho : expanding definition : " << node << std::endl;
- Node ret = getApplyUfForHoApply(node);
- Trace("uf-ho") << "uf-ho : ppRewrite : " << node << " to " << ret
- << std::endl;
- return ret;
+ if (node[0].getType().getNumChildren() == 2)
+ {
+ Trace("uf-ho") << "uf-ho : expanding definition : " << node << std::endl;
+ Node ret = getApplyUfForHoApply(node);
+ Trace("uf-ho") << "uf-ho : ppRewrite : " << node << " to " << ret
+ << std::endl;
+ return ret;
+ }
}
return node;
}
Trace("uf-exp-def") << "TheoryUF::ppRewrite: expanding definition : " << node
<< std::endl;
Kind k = node.getKind();
- if (k == kind::HO_APPLY)
+ if (k == kind::HO_APPLY || (node.isVar() && node.getType().isFunction()))
{
if (!logicInfo().isHigherOrder())
{
ASSERT_NE(cvc5::null_os.rdbuf(), d_solver.getOutput("inst").rdbuf());
}
+
+TEST_F(TestApiBlackSolver, issue7000)
+{
+ Sort s1 = d_solver.getIntegerSort();
+ Sort s2 = d_solver.mkFunctionSort(s1, s1);
+ Sort s3 = d_solver.getRealSort();
+ Term t4 = d_solver.mkPi();
+ Term t7 = d_solver.mkConst(s3, "_x5");
+ Term t37 = d_solver.mkConst(s2, "_x32");
+ Term t59 = d_solver.mkConst(s2, "_x51");
+ Term t72 = d_solver.mkTerm(EQUAL, t37, t59);
+ Term t74 = d_solver.mkTerm(GT, t4, t7);
+ // throws logic exception since logic is not higher order by default
+ ASSERT_THROW(d_solver.checkEntailed({t72, t74, t72, t72}), CVC5ApiException);
+}
+
} // namespace test
} // namespace cvc5