This is work towards a configurable approach to theory combination.
Setting the master equality engine in QuantifiersEngine mimics setting EqualityEngine in Theory.
context::UserContext* u,
TheoryEngine* te)
: d_te(te),
+ d_masterEqualityEngine(nullptr),
d_eq_query(new quantifiers::EqualityQueryQuantifiersEngine(c, this)),
d_tr_trie(new inst::TriggerTrie),
d_model(nullptr),
QuantifiersEngine::~QuantifiersEngine() {}
+void QuantifiersEngine::setMasterEqualityEngine(eq::EqualityEngine* mee)
+{
+ d_masterEqualityEngine = mee;
+}
+
context::Context* QuantifiersEngine::getSatContext()
{
return d_te->theoryOf(THEORY_QUANTIFIERS)->getSatContext();
eq::EqualityEngine* QuantifiersEngine::getMasterEqualityEngine() const
{
- return d_te->getMasterEqualityEngine();
+ return d_masterEqualityEngine;
}
Node QuantifiersEngine::getInternalRepresentative( Node a, Node q, int index ){
// TODO: organize this more/review this, github issue #1163
class QuantifiersEngine {
+ friend class ::CVC4::TheoryEngine;
typedef context::CDHashMap< Node, bool, NodeHashFunction > BoolMap;
typedef context::CDList<Node> NodeList;
typedef context::CDList<bool> BoolList;
inst::TriggerTrie* getTriggerDatabase() const;
//---------------------- end utilities
private:
+ //---------------------- private initialization
+ /** Set the master equality engine */
+ void setMasterEqualityEngine(eq::EqualityEngine* mee);
+ //---------------------- end private initialization
/**
* Maps quantified formulas to the module that owns them, if any module has
* specifically taken ownership of it.
private:
/** reference to theory engine object */
TheoryEngine* d_te;
+ /** Pointer to the master equality engine */
+ eq::EqualityEngine* d_masterEqualityEngine;
/** vector of utilities for quantifiers */
std::vector<QuantifiersUtil*> d_util;
/** vector of modules for quantifiers */
d_aloc_curr_model_builder = true;
}
+ // set the core equality engine on quantifiers engine
+ if (d_logicInfo.isQuantified())
+ {
+ d_quantEngine->setMasterEqualityEngine(
+ d_eeDistributed->getMasterEqualityEngine());
+ }
+
// finish initializing the theories
for(TheoryId theoryId = theory::THEORY_FIRST; theoryId != theory::THEORY_LAST; ++ theoryId) {
Theory* t = d_theoryTable[theoryId];
if( Theory::fullEffort(effort) && !d_inConflict && !needCheck()) {
// case where we are about to answer SAT, the master equality engine,
// if it exists, must be consistent.
- eq::EqualityEngine* mee = getMasterEqualityEngine();
+ eq::EqualityEngine* mee = d_eeDistributed->getMasterEqualityEngine();
if (mee != NULL)
{
AlwaysAssert(mee->consistent());
return &d_sharedTerms;
}
-theory::eq::EqualityEngine* TheoryEngine::getMasterEqualityEngine()
-{
- Assert(d_eeDistributed != nullptr);
- return d_eeDistributed->getMasterEqualityEngine();
-}
-
void TheoryEngine::getExplanation(std::vector<NodeTheoryPair>& explanationVector, LemmaProofRecipe* proofRecipe) {
Assert(explanationVector.size() > 0);
SharedTermsDatabase* getSharedTermsDatabase();
- theory::eq::EqualityEngine* getMasterEqualityEngine();
-
SortInference* getSortInference() { return &d_sortInfer; }
/** Prints the assertions to the debug stream */