diff options
author | Andrew Reynolds <andrew.j.reynolds@gmail.com> | 2020-09-20 10:59:36 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-20 10:59:36 -0500 |
commit | 63e7c6bb6d9c99a5282241be8b32a04ea67dfb8d (patch) | |
tree | 8841b287b35143ff7470811ae164f74c71bc2cad /src/theory/model_manager.cpp | |
parent | 5f04a78336d648b02bc5cfdaaf734b6b350ee805 (diff) |
More flexible design for model manager distributed (#4976)
This PR makes it so that the distributed model manager can be used independently of the architecture for equality engine management for theories, meaning the choice of using a separate equality engine for the model can be done in both the current distributed architecture, or the proposed central architecture (where there would be 2 equality engines, the central one and the model one). The "central model manager" on the other hand will only be combined with the central architecture. This will make it easier to test the centralized equality engine manager, since all things related to model construction can be preserved when using a central architecture.
This PR moves some of the responsibilities from the (distributed) equality engine manager to the distributed model manager, including the management of the context of the model equality engine and the allocation of its equality engine.
This PR is not intended to make any behavior changes to the current architecture.
Diffstat (limited to 'src/theory/model_manager.cpp')
-rw-r--r-- | src/theory/model_manager.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/theory/model_manager.cpp b/src/theory/model_manager.cpp index 89daa922c..530aec190 100644 --- a/src/theory/model_manager.cpp +++ b/src/theory/model_manager.cpp @@ -21,9 +21,12 @@ namespace CVC4 { namespace theory { -ModelManager::ModelManager(TheoryEngine& te) +ModelManager::ModelManager(TheoryEngine& te, EqEngineManager& eem) : d_te(te), d_logicInfo(te.getLogicInfo()), + d_eem(eem), + d_modelEqualityEngine(nullptr), + d_modelEqualityEngineAlloc(nullptr), d_model(nullptr), d_modelBuilder(nullptr), d_modelBuilt(false), @@ -33,7 +36,7 @@ ModelManager::ModelManager(TheoryEngine& te) ModelManager::~ModelManager() {} -void ModelManager::finishInit() +void ModelManager::finishInit(eq::EqualityEngineNotify* notify) { // construct the model const LogicInfo& logicInfo = d_te.getLogicInfo(); @@ -61,6 +64,7 @@ void ModelManager::finishInit() d_modelBuilder = d_alocModelBuilder.get(); } // notice that the equality engine of the model has yet to be assigned. + initializeModelEqEngine(notify); } void ModelManager::resetModel() @@ -209,7 +213,6 @@ void ModelManager::collectTerms(TheoryId tid, // only add to term set if a relevant kind if (irrKinds.find(k) == irrKinds.end()) { - Assert(Theory::theoryOf(cur) == tid); termSet.insert(cur); } // traverse owned terms, don't go under quantifiers |