summaryrefslogtreecommitdiff
path: root/src/smt/smt_engine.cpp
diff options
context:
space:
mode:
authorTim King <taking@google.com>2016-01-05 16:29:44 -0800
committerTim King <taking@google.com>2016-01-05 16:29:44 -0800
commit5eabda0f55cee3be81aa7ae126269c32e818322f (patch)
treeb873e4cb8e5d37ff3bb70596494bc5964aaef135 /src/smt/smt_engine.cpp
parentb717513e2a1d956c4456d13e0625957fc84c2449 (diff)
Add SmtGlobals Class
- The options replayStream, lemmaInputChannel, lemmaOutputChannel have been removed due to their datatypes. These datatypes were previously pointers to types that were not usable from the options/ library. - The option replayLog has been removed due to inconsistent memory management. - SmtGlobals is a class that wraps a pointer to each of these removed options. These can each be set independently. - There is a single SmtGlobals per SmtEngine with the lifetime of the SmtEngine. - A pointer to this is freely given to the user of an SmtEngine to parameterize the solver after construction. - Selected classes have been given a copy of this pointer in their constructors. - Removed the dependence on Node from Result. Moving Result back into util/.
Diffstat (limited to 'src/smt/smt_engine.cpp')
-rw-r--r--src/smt/smt_engine.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/smt/smt_engine.cpp b/src/smt/smt_engine.cpp
index c1d49d8c8..3571ae0cb 100644
--- a/src/smt/smt_engine.cpp
+++ b/src/smt/smt_engine.cpp
@@ -724,7 +724,9 @@ SmtEngine::SmtEngine(ExprManager* em) throw() :
d_private(NULL),
d_smtAttributes(NULL),
d_statisticsRegistry(NULL),
- d_stats(NULL) {
+ d_stats(NULL),
+ d_globals(new SmtGlobals())
+{
SmtScope smts(this);
d_smtAttributes = new expr::attr::SmtAttributes(d_context);
@@ -734,7 +736,10 @@ SmtEngine::SmtEngine(ExprManager* em) throw() :
d_stats->d_resourceUnitsUsed.setData(d_private->getResourceManager()->d_cumulativeResourceUsed);
// We have mutual dependency here, so we add the prop engine to the theory
// engine later (it is non-essential there)
- d_theoryEngine = new TheoryEngine(d_context, d_userContext, d_private->d_iteRemover, const_cast<const LogicInfo&>(d_logic));
+ d_theoryEngine = new TheoryEngine(d_context, d_userContext,
+ d_private->d_iteRemover,
+ const_cast<const LogicInfo&>(d_logic),
+ d_globals);
// Add the theories
for(TheoryId id = theory::THEORY_FIRST; id < theory::THEORY_LAST; ++id) {
@@ -764,7 +769,8 @@ void SmtEngine::finishInit() {
d_decisionEngine = new DecisionEngine(d_context, d_userContext);
d_decisionEngine->init(); // enable appropriate strategies
- d_propEngine = new PropEngine(d_theoryEngine, d_decisionEngine, d_context, d_userContext);
+ d_propEngine = new PropEngine(d_theoryEngine, d_decisionEngine, d_context,
+ d_userContext, d_globals);
d_theoryEngine->setPropEngine(d_propEngine);
d_theoryEngine->setDecisionEngine(d_decisionEngine);
@@ -907,6 +913,9 @@ SmtEngine::~SmtEngine() throw() {
delete d_context;
d_context = NULL;
+ delete d_globals;
+ d_globals = NULL;
+
} catch(Exception& e) {
Warning() << "CVC4 threw an exception during cleanup." << endl
<< e << endl;
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback