Debug("equality") << d_name << "::eq::newNode(" << node << ") => " << newId << std::endl;
- // notify e.g. the theory that owns this equality engine.
- if (d_performNotify) {
- d_notify.eqNotifyNewClass(node);
- }
-
return newId;
}
EqualityNodeId result;
- if (t.getKind() == kind::EQUAL) {
+ Kind tk = t.getKind();
+ if (tk == kind::EQUAL)
+ {
addTermInternal(t[0]);
addTermInternal(t[1]);
EqualityNodeId t0id = getNodeId(t[0]);
result = newApplicationNode(t, t0id, t1id, APP_EQUALITY);
d_isInternal[result] = false;
d_isConstant[result] = false;
- } else if (t.getNumChildren() > 0 && d_congruenceKinds[t.getKind()]) {
+ }
+ else if (t.getNumChildren() > 0 && d_congruenceKinds[tk])
+ {
TNode tOp = t.getOperator();
// Add the operator
- addTermInternal(tOp, !isExternalOperatorKind(t.getKind()));
+ addTermInternal(tOp, !isExternalOperatorKind(tk));
result = getNodeId(tOp);
// Add all the children and Curryfy
- bool isInterpreted = isInterpretedFunctionKind(t.getKind());
+ bool isInterpreted = isInterpretedFunctionKind(tk);
for (unsigned i = 0; i < t.getNumChildren(); ++ i) {
// Add the child
addTermInternal(t[i]);
}
}
}
- } else {
+ }
+ else
+ {
// Otherwise we just create the new id
result = newNode(t);
// Is this an operator
d_isConstant[result] = !isOperator && t.isConst();
}
- if (t.getKind() == kind::EQUAL) {
+ if (tk == kind::EQUAL)
+ {
// We set this here as this only applies to actual terms, not the
// intermediate application terms
d_isEquality[result] = true;
- } else if (d_constantsAreTriggers && d_isConstant[result]) {
- // Non-Boolean constants are trigger terms for all tags
- EqualityNodeId tId = getNodeId(t);
- // Setup the new set
- Theory::Set newSetTags = 0;
- EqualityNodeId newSetTriggers[THEORY_LAST];
- unsigned newSetTriggersSize = THEORY_LAST;
- for (TheoryId currentTheory = THEORY_FIRST; currentTheory != THEORY_LAST; ++ currentTheory) {
- newSetTags = Theory::setInsert(currentTheory, newSetTags);
- newSetTriggers[currentTheory] = tId;
+ }
+ else
+ {
+ // Notify e.g. the theory that owns this equality engine that there is a
+ // new equivalence class.
+ if (d_performNotify)
+ {
+ d_notify.eqNotifyNewClass(t);
+ }
+ if (d_constantsAreTriggers && d_isConstant[result])
+ {
+ // Non-Boolean constants are trigger terms for all tags
+ EqualityNodeId tId = getNodeId(t);
+ // Setup the new set
+ Theory::Set newSetTags = 0;
+ EqualityNodeId newSetTriggers[THEORY_LAST];
+ unsigned newSetTriggersSize = THEORY_LAST;
+ for (TheoryId currentTheory = THEORY_FIRST; currentTheory != THEORY_LAST;
+ ++currentTheory)
+ {
+ newSetTags = Theory::setInsert(currentTheory, newSetTags);
+ newSetTriggers[currentTheory] = tId;
+ }
+ // Add it to the list for backtracking
+ d_triggerTermSetUpdates.push_back(TriggerSetUpdate(tId, null_set_id));
+ d_triggerTermSetUpdatesSize = d_triggerTermSetUpdatesSize + 1;
+ // Mark the the new set as a trigger
+ d_nodeIndividualTrigger[tId] =
+ newTriggerTermSet(newSetTags, newSetTriggers, newSetTriggersSize);
}
- // Add it to the list for backtracking
- d_triggerTermSetUpdates.push_back(TriggerSetUpdate(tId, null_set_id));
- d_triggerTermSetUpdatesSize = d_triggerTermSetUpdatesSize + 1;
- // Mark the the new set as a trigger
- d_nodeIndividualTrigger[tId] = newTriggerTermSet(newSetTags, newSetTriggers, newSetTriggersSize);
}
// If this is not an internal node, add it to the master