delete d_internal;
}
-void TheorySets::setMasterEqualityEngine(eq::EqualityEngine* eq) {
- d_internal->setMasterEqualityEngine(eq);
-}
-
void TheorySets::addSharedTerm(TNode n) {
d_internal->addSharedTerm(n);
}
d_internal->collectModelInfo(m, fullModel);
}
-void TheorySets::propagate(Effort e) {
- d_internal->propagate(e);
+void TheorySets::computeCareGraph() {
+ d_internal->computeCareGraph();
}
Node TheorySets::explain(TNode node) {
}
void TheorySets::preRegisterTerm(TNode node) {
- return d_internal->preRegisterTerm(node);
+ d_internal->preRegisterTerm(node);
+}
+
+void TheorySets::propagate(Effort e) {
+ d_internal->propagate(e);
+}
+
+void TheorySets::setMasterEqualityEngine(eq::EqualityEngine* eq) {
+ d_internal->setMasterEqualityEngine(eq);
}
}/* CVC4::theory::sets namespace */
~TheorySets();
- void setMasterEqualityEngine(eq::EqualityEngine* eq);
-
void addSharedTerm(TNode);
void check(Effort);
void collectModelInfo(TheoryModel*, bool fullModel);
+ void computeCareGraph();
+
Node explain(TNode);
std::string identify() const { return "THEORY_SETS"; }
void propagate(Effort);
+ void setMasterEqualityEngine(eq::EqualityEngine* eq);
+
};/* class TheorySets */
}/* CVC4::theory::sets namespace */
}/*TheorySetsPrivate::learnLiteral(...)*/
+/************************ Sharing ************************/
+/************************ Sharing ************************/
+/************************ Sharing ************************/
+
+void TheorySetsPrivate::addSharedTerm(TNode n) {
+ Debug("sets") << "[sets] ThoerySetsPrivate::addSharedTerm( " << n << ")" << std::endl;
+ d_equalityEngine.addTriggerTerm(n, THEORY_SETS);
+}
+
+
+void TheorySetsPrivate::computeCareGraph() {
+ Debug("sharing") << "Theory::computeCareGraph<" << d_external.identify() << ">()" << endl;
+ for (unsigned i = 0; i < d_external.d_sharedTerms.size(); ++ i) {
+ TNode a = d_external.d_sharedTerms[i];
+ TypeNode aType = a.getType();
+ for (unsigned j = i + 1; j < d_external.d_sharedTerms.size(); ++ j) {
+ TNode b = d_external.d_sharedTerms[j];
+ if (b.getType() != aType) {
+ // We don't care about the terms of different types
+ continue;
+ }
+ switch (d_external.d_valuation.getEqualityStatus(a, b)) {
+ case EQUALITY_TRUE_AND_PROPAGATED:
+ case EQUALITY_FALSE_AND_PROPAGATED:
+ // If we know about it, we should have propagated it, so we can skip
+ break;
+ default:
+ // Let's split on it
+ d_external.addCarePair(a, b);
+ break;
+ }
+ }
+ }
+}
+
+
/******************** Model generation ********************/
/******************** Model generation ********************/
/******************** Model generation ********************/
d_equalityEngine.setMasterEqualityEngine(eq);
}
-void TheorySetsPrivate::addSharedTerm(TNode n) {
- Debug("sets") << "[sets] ThoerySetsPrivate::addSharedTerm( " << n << ")" << std::endl;
- d_equalityEngine.addTriggerTerm(n, THEORY_SETS);
-}
-
void TheorySetsPrivate::conflict(TNode a, TNode b)
{
if (a.getKind() == kind::CONST_BOOLEAN) {