diff options
author | Andrew Reynolds <andrew.j.reynolds@gmail.com> | 2021-08-16 20:57:40 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-17 01:57:40 +0000 |
commit | 1d81aaef0d3a3f6a9cadc57d0e667506138af003 (patch) | |
tree | 0fc585cbb7f04262803390f7ff0e88d060c6da91 /src/smt/smt_engine.cpp | |
parent | a11de769885cf9ac4b2c2f06409976080b326fe6 (diff) |
Initial refactoring of set defaults (#7021)
This commit starts to carve out better control flow structure in setDefaults.
It makes setDefaults contained in a class, and moves a few blocks of code to their own functions.
This class also makes options manager obsolete, it is deleted in this PR.
There should be no behavior change in this PR.
Diffstat (limited to 'src/smt/smt_engine.cpp')
-rw-r--r-- | src/smt/smt_engine.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/smt/smt_engine.cpp b/src/smt/smt_engine.cpp index 5f3920929..3e4c1efa7 100644 --- a/src/smt/smt_engine.cpp +++ b/src/smt/smt_engine.cpp @@ -49,10 +49,10 @@ #include "smt/model_blocker.h" #include "smt/model_core_builder.h" #include "smt/node_command.h" -#include "smt/options_manager.h" #include "smt/preprocessor.h" #include "smt/proof_manager.h" #include "smt/quant_elim_solver.h" +#include "smt/set_defaults.h" #include "smt/smt_engine_scope.h" #include "smt/smt_engine_state.h" #include "smt/smt_engine_stats.h" @@ -103,7 +103,6 @@ SmtEngine::SmtEngine(NodeManager* nm, Options* optr) d_isInternalSubsolver(false), d_stats(nullptr), d_outMgr(this), - d_optm(nullptr), d_pp(nullptr), d_scope(nullptr) { @@ -120,8 +119,6 @@ SmtEngine::SmtEngine(NodeManager* nm, Options* optr) // On the other hand, this hack breaks use cases where multiple SmtEngine // objects are created by the user. d_scope.reset(new SmtScope(this)); - // set the options manager - d_optm.reset(new smt::OptionsManager(&getOptions())); // listen to node manager events getNodeManager()->subscribeEvents(d_snmListener.get()); // listen to resource out @@ -195,10 +192,10 @@ void SmtEngine::finishInit() // set the random seed Random::getRandom().setSeed(d_env->getOptions().driver.seed); - // Call finish init on the options manager. This inializes the resource - // manager based on the options, and sets up the best default options - // based on our heuristics. - d_optm->finishInit(d_env->d_logic, d_isInternalSubsolver); + // Call finish init on the set defaults module. This inializes the logic + // and the best default options based on our heuristics. + SetDefaults sdefaults(d_isInternalSubsolver); + sdefaults.setDefaults(d_env->d_logic, getOptions()); ProofNodeManager* pnm = nullptr; if (d_env->getOptions().smt.produceProofs) @@ -324,7 +321,6 @@ SmtEngine::~SmtEngine() getNodeManager()->unsubscribeEvents(d_snmListener.get()); d_snmListener.reset(nullptr); d_routListener.reset(nullptr); - d_optm.reset(nullptr); d_pp.reset(nullptr); // destroy the state d_state.reset(nullptr); |