, d_equalityTriggersCount(context, 0)
, d_individualTriggersSize(context, 0)
, d_constantRepresentativesSize(context, 0)
+, d_constantsSize(context, 0)
, d_stats(name)
{
init();
, d_equalityTriggersCount(context, 0)
, d_individualTriggersSize(context, 0)
, d_constantRepresentativesSize(context, 0)
+, d_constantsSize(context, 0)
, d_stats(name)
{
init();
Debug("equality") << "EqualityEngine::newNode(" << node << ") => " << newId << std::endl;
+ // If the node is a constant, assert all the dis-eqalities
+ if (node.isConst() && node.getKind() != kind::CONST_BOOLEAN) {
+
+ TypeNode nodeType = node.getType();
+ for (unsigned i = 0; i < d_constants.size(); ++ i) {
+ TNode constant = d_constants[i];
+ if (constant.getType().isComparableTo(nodeType)) {
+ Debug("equality::constants") << "adding const dis-equality " << node << " != " << constant << std::endl;
+ assertEquality(node.eqNode(constant), false, d_true);
+ }
+ }
+
+ d_constants.push_back(node);
+ d_constantsSize = d_constantsSize + 1;
+
+ propagate();
+ }
+
return newId;
}
} while (currentId != class2Id);
-
// Update class2 table lookup and information
Debug("equality") << "EqualityEngine::merge(" << class1.getFind() << "," << class2.getFind() << "): updating lookups of " << class2Id << std::endl;
do {
d_equalityGraph.resize(d_nodesCount);
d_equalityNodes.resize(d_nodesCount);
}
+
+ d_constants.resize(d_constantsSize);
}
void EqualityEngine::addGraphEdge(EqualityNodeId t1, EqualityNodeId t2, MergeReasonType type, TNode reason) {
/** The list of representatives that became constant. */
std::vector<EqualityNodeId> d_constantRepresentatives;
+ /** List of all the constants. */
+ std::vector<TNode> d_constants;
+
+ /** Size of the constants list */
+ context::CDO<unsigned> d_constantsSize;
+
/**
* Adds the trigger with triggerId to the beginning of the trigger list of the node with id nodeId.
*/