{
size_t ii = (nchild - 1) - i;
Node v = n[0][ii];
- // use the partial operator for variables beyond the first
+ // use the partial operator for variables except the last one. This
+ // avoids type errors in internal representation of LFSC terms.
Node vop = getOperatorOfBoundVar(ii == 0 ? cop : pcop, v);
ret = nm->mkNode(APPLY_UF, vop, ret);
}
return false;
}
Node cop = d_tproc.getOperatorOfClosure(res[0]);
+ Node pcop = d_tproc.getOperatorOfClosure(res[0], false, true);
Trace("lfsc-pp-qcong") << "Operator for closure " << cop << std::endl;
// start with base case body = body'
Node curL = children[1][0];
Trace("lfsc-pp-qcong") << "Base congruence " << currEq << std::endl;
for (size_t i = 0, nvars = res[0][0].getNumChildren(); i < nvars; i++)
{
+ size_t ii = (nvars - 1) - i;
Trace("lfsc-pp-qcong") << "Process child " << i << std::endl;
// CONG rules for each variable
- Node v = res[0][0][nvars - 1 - i];
- Node vop = d_tproc.getOperatorOfBoundVar(cop, v);
+ Node v = res[0][0][ii];
+ // Use partial version for each argument except the last one. This
+ // avoids type errors in internal representation of LFSC terms.
+ Node vop = d_tproc.getOperatorOfBoundVar(ii == 0 ? cop : pcop, v);
Node vopEq = vop.eqNode(vop);
cdp->addStep(vopEq, PfRule::REFL, {}, {vop});
Node nextEq;