summaryrefslogtreecommitdiff
path: root/src/prop/prop_engine.cpp
diff options
context:
space:
mode:
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>2021-01-11 11:23:15 -0600
committerGitHub <noreply@github.com>2021-01-11 11:23:15 -0600
commit8c04f1639607b34b56e3eaa8d3188b27e1454b41 (patch)
treeb4427f298b2fde0686b7fdd98008f2fdc0173321 /src/prop/prop_engine.cpp
parentb8841e768a37131c492508cd0e12b9acd8bf4c2b (diff)
Merge theory registrar and theory proxy (#5758)
The motivation of this PR is to make TheoryProxy the single point of contact to TheoryEngine from PropEngine. This merges the helper class TheoryRegistrar into TheoryProxy.
Diffstat (limited to 'src/prop/prop_engine.cpp')
-rw-r--r--src/prop/prop_engine.cpp22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/prop/prop_engine.cpp b/src/prop/prop_engine.cpp
index 8ea3507f0..384734100 100644
--- a/src/prop/prop_engine.cpp
+++ b/src/prop/prop_engine.cpp
@@ -37,7 +37,6 @@
#include "smt/smt_statistics_registry.h"
#include "theory/output_channel.h"
#include "theory/theory_engine.h"
-#include "theory/theory_registrar.h"
#include "util/resource_manager.h"
#include "util/result.h"
@@ -75,7 +74,6 @@ PropEngine::PropEngine(TheoryEngine* te,
d_context(satContext),
d_theoryProxy(nullptr),
d_satSolver(nullptr),
- d_registrar(nullptr),
d_pnm(pnm),
d_cnfStream(nullptr),
d_pfCnfStream(nullptr),
@@ -91,17 +89,24 @@ PropEngine::PropEngine(TheoryEngine* te,
d_satSolver = SatSolverFactory::createCDCLTMinisat(smtStatisticsRegistry());
- d_registrar = new theory::TheoryRegistrar(d_theoryEngine);
- d_cnfStream = new CVC4::prop::CnfStream(
- d_satSolver, d_registrar, userContext, &d_outMgr, rm, FormulaLitPolicy::TRACK);
-
+ // CNF stream and theory proxy required pointers to each other, make the
+ // theory proxy first
d_theoryProxy = new TheoryProxy(this,
d_theoryEngine,
d_decisionEngine.get(),
- d_context,
+ satContext,
userContext,
- d_cnfStream,
pnm);
+ d_cnfStream = new CnfStream(d_satSolver,
+ d_theoryProxy,
+ userContext,
+ &d_outMgr,
+ rm,
+ FormulaLitPolicy::TRACK);
+
+ // connect theory proxy
+ d_theoryProxy->finishInit(d_cnfStream);
+ // connect SAT solver
d_satSolver->initialize(d_context, d_theoryProxy, userContext, pnm);
d_decisionEngine->setSatSolver(d_satSolver);
@@ -144,7 +149,6 @@ PropEngine::~PropEngine() {
d_decisionEngine->shutdown();
d_decisionEngine.reset(nullptr);
delete d_cnfStream;
- delete d_registrar;
delete d_satSolver;
delete d_theoryProxy;
}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback