This adds fields to equality engine setup information which will be used to hook up theories to the central equality engine.
This PR does not impact any behavior.
This is in preparation for the central equality engine.
{
esi.d_notify = &d_notify;
esi.d_name = d_instanceName + "ee";
+ esi.d_notifyNewClass = true;
+ esi.d_notifyMerge = true;
return true;
}
{
esi.d_notify = &d_notify;
esi.d_name = "theory::datatypes::ee";
+ // need notifications on new constructors, merging datatype eqcs
+ esi.d_notifyNewClass = true;
+ esi.d_notifyMerge = true;
return true;
}
struct EeSetupInfo
{
EeSetupInfo()
- : d_notify(nullptr), d_constantsAreTriggers(true), d_useMaster(false)
+ : d_notify(nullptr),
+ d_constantsAreTriggers(true),
+ d_notifyNewClass(false),
+ d_notifyMerge(false),
+ d_notifyDisequal(false),
+ d_useMaster(false)
{
}
/** The notification class of the theory */
std::string d_name;
/** Constants are triggers */
bool d_constantsAreTriggers;
+ //-------------------------- fine grained notifications
+ /** Whether we need to be notified of new equivalence classes */
+ bool d_notifyNewClass;
+ /** Whether we need to be notified of merged equivalence classes */
+ bool d_notifyMerge;
+ /** Whether we need to be notified of disequal equivalence classes */
+ bool d_notifyDisequal;
+ //-------------------------- end fine grained notifications
/**
* Whether we want our state to use the master equality engine. This should
* be true exclusively for the theory of quantifiers.
*/
bool d_useMaster;
+ /** Does it need notifications when equivalence classes are created? */
+ bool needsNotifyNewClass() const { return d_notifyNewClass; }
+ /** Does it need notifications when equivalence classes are merged? */
+ bool needsNotifyMerge() const { return d_notifyMerge; }
+ /** Does it need notifications when disequalities are generated? */
+ bool needsNotifyDisequal() const { return d_notifyDisequal; }
};
} // namespace theory
{
esi.d_notify = &d_notify;
esi.d_name = "theory::sep::ee";
+ esi.d_notifyMerge = true;
return true;
}
{
esi.d_notify = &d_notify;
esi.d_name = "theory::sets::ee";
+ esi.d_notifyNewClass = true;
+ esi.d_notifyMerge = true;
+ esi.d_notifyDisequal = true;
return true;
}
// Concatenation terms do not need to be considered here because
// their arguments have string type and do not introduce any shared
// terms.
- if (n.hasOperator() && ee->isFunctionKind(k) && k != STRING_CONCAT)
+ if (n.hasOperator() && ee->isFunctionKind(k)
+ && kindToTheoryId(k) == THEORY_STRINGS && k != STRING_CONCAT)
{
d_functionsTerms.push_back(n);
}
{
esi.d_notify = &d_notify;
esi.d_name = "theory::strings::ee";
+ esi.d_notifyNewClass = true;
+ esi.d_notifyMerge = true;
+ esi.d_notifyDisequal = true;
return true;
}
{
esi.d_notify = &d_notify;
esi.d_name = d_instanceName + "theory::uf::ee";
+ if (options::finiteModelFind()
+ && options::ufssMode() != options::UfssMode::NONE)
+ {
+ // need notifications about sorts
+ esi.d_notifyNewClass = true;
+ esi.d_notifyMerge = true;
+ esi.d_notifyDisequal = true;
+ }
return true;
}