void TheorySetsPrivate::checkReduceComprehensions()
{
NodeManager* nm = NodeManager::currentNM();
+ SkolemManager* sm = nm->getSkolemManager();
const std::vector<Node>& comps = d_state.getComprehensionSets();
for (const Node& n : comps)
{
body = body.substitute(vars.begin(), vars.end(), subs.begin(), subs.end());
Node bvl = nm->mkNode(BOUND_VAR_LIST, subs);
body = nm->mkNode(EXISTS, bvl, body);
- Node mem = nm->mkNode(SET_MEMBER, v, n);
- Node lem =
- nm->mkNode(FORALL, nm->mkNode(BOUND_VAR_LIST, v), body.eqNode(mem));
+ Node k = sm->mkPurifySkolem(n, "kcomp");
+ Node mem = nm->mkNode(SET_MEMBER, v, k);
+ Node lem = nm->mkNode(
+ AND,
+ k.eqNode(n),
+ nm->mkNode(FORALL, nm->mkNode(BOUND_VAR_LIST, v), body.eqNode(mem)));
Trace("sets-comprehension")
<< "Comprehension reduction: " << lem << std::endl;
d_im.lemma(lem, InferenceId::SETS_COMPREHENSION);