diff options
author | Andrew Reynolds <andrew.j.reynolds@gmail.com> | 2020-09-26 10:07:42 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-26 10:07:42 -0500 |
commit | 1fe9c2efe36b126c70097b0f83db5654e0abcabe (patch) | |
tree | 46323cb7c712618a974092bced6f66dd07be3862 /src/theory/combination_engine.cpp | |
parent | 6ad02b5e0599149e0bd1548855aec8ac890f5a87 (diff) |
Connect the shared solver to theory engine (#5103)
This makes SharedSolver the main communication point for TheoryEngine during solving for combination-related solving tasks. This class is a generalization of SharedTermsDatabase, and in the distributed architecture is a wrapper around shared terms database.
It has 5 callbacks in theory engine: for preregistration, preNotifyFact (which calls addSharedTerms on theories), assertSharedEquality, explain, getEqualityStatus.
This PR has no intended behavior changes.
FYI @barrettcw
Diffstat (limited to 'src/theory/combination_engine.cpp')
-rw-r--r-- | src/theory/combination_engine.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/theory/combination_engine.cpp b/src/theory/combination_engine.cpp index d972a4d8e..32af15054 100644 --- a/src/theory/combination_engine.cpp +++ b/src/theory/combination_engine.cpp @@ -18,6 +18,7 @@ #include "theory/care_graph.h" #include "theory/ee_manager_distributed.h" #include "theory/model_manager_distributed.h" +#include "theory/shared_solver_distributed.h" #include "theory/theory_engine.h" namespace CVC4 { @@ -31,6 +32,7 @@ CombinationEngine::CombinationEngine(TheoryEngine& te, d_paraTheories(paraTheories), d_eemanager(nullptr), d_mmanager(nullptr), + d_sharedSolver(nullptr), d_cmbsPg(pnm ? new EagerProofGenerator(pnm, te.getUserContext()) : nullptr) { @@ -43,8 +45,11 @@ void CombinationEngine::finishInit() // create the equality engine, model manager, and shared solver if (options::eeMode() == options::EqEngineMode::DISTRIBUTED) { + // use the distributed shared solver + d_sharedSolver.reset(new SharedSolverDistributed(d_te)); // make the distributed equality engine manager - d_eemanager.reset(new EqEngineManagerDistributed(d_te)); + d_eemanager.reset( + new EqEngineManagerDistributed(d_te, *d_sharedSolver.get())); // make the distributed model manager d_mmanager.reset(new ModelManagerDistributed(d_te, *d_eemanager.get())); } @@ -95,6 +100,10 @@ theory::TheoryModel* CombinationEngine::getModel() return d_mmanager->getModel(); } +SharedSolver* CombinationEngine::getSharedSolver() +{ + return d_sharedSolver.get(); +} bool CombinationEngine::isProofEnabled() const { return d_cmbsPg != nullptr; } eq::EqualityEngineNotify* CombinationEngine::getModelEqualityEngineNotify() |