{
for (const Node& e : d_state.getElements(n))
{
- checkNonNegativeCountTerms(n, e);
+ checkNonNegativeCountTerms(n, d_state.getRepresentative(e));
}
}
}
Assert(n.getKind() == BAG_EMPTY);
for (const Node& e : d_state.getElements(n))
{
- InferInfo i = d_ig.empty(n, e);
+ InferInfo i = d_ig.empty(n, d_state.getRepresentative(e));
d_im.lemmaTheoryInference(&i);
}
}
std::set<Node> elements = getElementsForBinaryOperator(n);
for (const Node& e : elements)
{
- InferInfo i = d_ig.unionDisjoint(n, e);
+ InferInfo i = d_ig.unionDisjoint(n, d_state.getRepresentative(e));
d_im.lemmaTheoryInference(&i);
}
}
std::set<Node> elements = getElementsForBinaryOperator(n);
for (const Node& e : elements)
{
- InferInfo i = d_ig.unionMax(n, e);
+ InferInfo i = d_ig.unionMax(n, d_state.getRepresentative(e));
d_im.lemmaTheoryInference(&i);
}
}
std::set<Node> elements = getElementsForBinaryOperator(n);
for (const Node& e : elements)
{
- InferInfo i = d_ig.intersection(n, e);
+ InferInfo i = d_ig.intersection(n, d_state.getRepresentative(e));
d_im.lemmaTheoryInference(&i);
}
}
std::set<Node> elements = getElementsForBinaryOperator(n);
for (const Node& e : elements)
{
- InferInfo i = d_ig.differenceSubtract(n, e);
+ InferInfo i = d_ig.differenceSubtract(n, d_state.getRepresentative(e));
d_im.lemmaTheoryInference(&i);
}
}
<< " are: " << d_state.getElements(n) << std::endl;
for (const Node& e : d_state.getElements(n))
{
- InferInfo i = d_ig.bagMake(n, e);
+ InferInfo i = d_ig.bagMake(n, d_state.getRepresentative(e));
d_im.lemmaTheoryInference(&i);
}
}
std::set<Node> elements = getElementsForBinaryOperator(n);
for (const Node& e : elements)
{
- InferInfo i = d_ig.differenceRemove(n, e);
+ InferInfo i = d_ig.differenceRemove(n, d_state.getRepresentative(e));
d_im.lemmaTheoryInference(&i);
}
}
for (const Node& e : elements)
{
- InferInfo i = d_ig.duplicateRemoval(n, e);
+ InferInfo i = d_ig.duplicateRemoval(n, d_state.getRepresentative(e));
d_im.lemmaTheoryInference(&i);
}
}
Assert(n.getKind() == BAG_MAP);
const set<Node>& downwards = d_state.getElements(n);
const set<Node>& upwards = d_state.getElements(n[1]);
- for (const Node& y : downwards)
+ for (const Node& z : downwards)
{
+ Node y = d_state.getRepresentative(z);
if (d_mapCache.count(n) && d_mapCache[n].get()->contains(y))
{
continue;
{
Node key = d_state.getRepresentative(e);
Node countTerm = NodeManager::currentNM()->mkNode(BAG_COUNT, e, r);
- Node value = d_state.getRepresentative(countTerm);
+ context::CDList<TNode>::const_iterator shared_it =
+ std::find(d_sharedTerms.begin(), d_sharedTerms.end(), countTerm);
+ eq::EqClassIterator it =
+ eq::EqClassIterator(r, d_state.getEqualityEngine());
+ while (!it.isFinished() && shared_it == d_sharedTerms.end())
+ {
+ Node bag = *(++it);
+ countTerm = NodeManager::currentNM()->mkNode(BAG_COUNT, e, bag);
+ shared_it =
+ std::find(d_sharedTerms.begin(), d_sharedTerms.end(), countTerm);
+ }
+ Node value = d_valuation.getModelValue(countTerm);
elementReps[key] = value;
}
Node rep = NormalForm::constructBagFromElements(tn, elementReps);