skolem_app_c.push_back(skolem);
skolem_app_c.insert(skolem_app_c.end(), node[0].begin(), node[0].end());
Node skolem_app = nm->mkNode(APPLY_UF, skolem_app_c);
- children.push_back(skolem_app.eqNode(node[1]));
+ skolem_app_c[0] = node;
+ Node rhs = nm->mkNode(APPLY_UF, skolem_app_c);
+ // For the sake of proofs, we use
+ // (= (k t1 ... tn) ((lambda (x1 ... xn) s) t1 ... tn)) here. This is instead of
+ // (= (k t1 ... tn) s); the former is more accurate since
+ // beta reduction uses capture-avoiding substitution, which implies that
+ // ((lambda (y1 ... yn) s) t1 ... tn) is alpha-equivalent but not
+ // necessarily syntactical equal to s.
+ children.push_back(skolem_app.eqNode(rhs));
// axiom defining skolem
assertion = nm->mkNode(FORALL, children);