summaryrefslogtreecommitdiff
path: root/src/smt/smt_engine.cpp
diff options
context:
space:
mode:
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>2020-03-31 14:27:04 -0500
committerGitHub <noreply@github.com>2020-03-31 14:27:04 -0500
commit63f887783e003546bf8de4501774a79dbcf8d4b0 (patch)
tree2932cf5aa5c81746f5747d48c1ea73ea47c0a624 /src/smt/smt_engine.cpp
parent5272f5d02f109b7dbfdb5088a1efbf7d13b64487 (diff)
Remove replay and use-theory options and idl (#4186)
Towards disentangling Options / NodeManager / SmtEngine. This PR removes options --use-theory=NAME and --replay/--replay-log. Both of these options are highly complex, unused, and lead to complications when implementing the way options and our build system work. The first is motivated by making TheoryEngine use an "alternate" theory, which appears to e.g. make it so that TheoryIdl could entirely replace TheoryArith. I believe this is too heavy handed of a solution: there should a consistent TheoryArith class, and options should be used to enable/disable alternate modules within it. The second attempts to replay low level decisions from the SAT solver. It is documented as not working (in 1.0). I do not believe this is worth salvaging. It also removes the solver in src/theory/idl, which cannot be enabled after this commit.
Diffstat (limited to 'src/smt/smt_engine.cpp')
-rw-r--r--src/smt/smt_engine.cpp76
1 files changed, 4 insertions, 72 deletions
diff --git a/src/smt/smt_engine.cpp b/src/smt/smt_engine.cpp
index 30c1cd0f5..10fc76bf7 100644
--- a/src/smt/smt_engine.cpp
+++ b/src/smt/smt_engine.cpp
@@ -294,40 +294,6 @@ class BeforeSearchListener : public Listener {
SmtEngine* d_smt;
}; /* class BeforeSearchListener */
-class UseTheoryListListener : public Listener {
- public:
- UseTheoryListListener(TheoryEngine* theoryEngine)
- : d_theoryEngine(theoryEngine)
- {}
-
- void notify() override
- {
- std::stringstream commaList(options::useTheoryList());
- std::string token;
-
- Debug("UseTheoryListListener") << "UseTheoryListListener::notify() "
- << options::useTheoryList() << std::endl;
-
- while(std::getline(commaList, token, ',')){
- if(token == "help") {
- puts(theory::useTheoryHelp);
- exit(1);
- }
- if(theory::useTheoryValidate(token)) {
- d_theoryEngine->enableTheoryAlternative(token);
- } else {
- throw OptionException(
- std::string("unknown option for --use-theory : `") + token +
- "'. Try --use-theory=help.");
- }
- }
- }
-
- private:
- TheoryEngine* d_theoryEngine;
-}; /* class UseTheoryListListener */
-
-
class SetDefaultExprDepthListener : public Listener {
public:
void notify() override
@@ -433,15 +399,11 @@ class SmtEnginePrivate : public NodeManagerListener {
/** Manager for the memory of --dump-to. */
ManagedDumpOStream d_managedDumpChannel;
- /** Manager for --replay-log. */
- ManagedReplayLogOstream d_managedReplayLog;
-
/**
* This list contains:
* softResourceOut
* hardResourceOut
* beforeSearchListener
- * UseTheoryListListener
*
* This needs to be deleted before both NodeManager's Options,
* SmtEngine, d_resourceManager, and TheoryEngine.
@@ -554,7 +516,6 @@ class SmtEnginePrivate : public NodeManagerListener {
d_managedRegularChannel(),
d_managedDiagnosticChannel(),
d_managedDumpChannel(),
- d_managedReplayLog(),
d_listenerRegistrations(new ListenerRegistrationList()),
d_propagator(true, true),
d_assertions(),
@@ -618,9 +579,6 @@ class SmtEnginePrivate : public NodeManagerListener {
d_listenerRegistrations->add(
nodeManagerOptions.registerDumpToFileNameListener(
new SetToDefaultSourceListener(&d_managedDumpChannel), true));
- d_listenerRegistrations->add(
- nodeManagerOptions.registerSetReplayLogFilename(
- new SetToDefaultSourceListener(&d_managedReplayLog), true));
}
catch (OptionException& e)
{
@@ -814,17 +772,6 @@ class SmtEnginePrivate : public NodeManagerListener {
return retval;
}
- void addUseTheoryListListener(TheoryEngine* theoryEngine){
- Options& nodeManagerOptions = NodeManager::currentNM()->getOptions();
- d_listenerRegistrations->add(
- nodeManagerOptions.registerUseTheoryListListener(
- new UseTheoryListListener(theoryEngine), true));
- }
-
- std::ostream* getReplayLog() const {
- return d_managedReplayLog.getReplayLog();
- }
-
//------------------------------- expression names
// implements setExpressionName, as described in smt_engine.h
void setExpressionName(Expr e, std::string name) {
@@ -874,7 +821,6 @@ SmtEngine::SmtEngine(ExprManager* em)
d_status(),
d_expectedStatus(),
d_smtMode(SMT_MODE_START),
- d_replayStream(nullptr),
d_private(nullptr),
d_statisticsRegistry(nullptr),
d_stats(nullptr)
@@ -923,8 +869,6 @@ void SmtEngine::finishInit()
#endif
}
- d_private->addUseTheoryListListener(getTheoryEngine());
-
// set the random seed
Random::getRandom().setSeed(options::seed());
@@ -938,11 +882,8 @@ void SmtEngine::finishInit()
* are unregistered by the obsolete PropEngine object before registered
* again by the new PropEngine object */
d_propEngine.reset(nullptr);
- d_propEngine.reset(new PropEngine(getTheoryEngine(),
- getContext(),
- getUserContext(),
- d_private->getReplayLog(),
- d_replayStream));
+ d_propEngine.reset(
+ new PropEngine(getTheoryEngine(), getContext(), getUserContext()));
Trace("smt-debug") << "Setting up theory engine..." << std::endl;
d_theoryEngine->setPropEngine(getPropEngine());
@@ -4337,11 +4278,8 @@ void SmtEngine::resetAssertions()
* statistics are unregistered by the obsolete PropEngine object before
* registered again by the new PropEngine object */
d_propEngine.reset(nullptr);
- d_propEngine.reset(new PropEngine(getTheoryEngine(),
- getContext(),
- getUserContext(),
- d_private->getReplayLog(),
- d_replayStream));
+ d_propEngine.reset(
+ new PropEngine(getTheoryEngine(), getContext(), getUserContext()));
d_theoryEngine->setPropEngine(getPropEngine());
}
@@ -4534,12 +4472,6 @@ CVC4::SExpr SmtEngine::getOption(const std::string& key) const
return SExpr::parseAtom(nodeManagerOptions.getOption(key));
}
-void SmtEngine::setReplayStream(ExprStream* replayStream) {
- AlwaysAssert(!d_fullyInited)
- << "Cannot set replay stream once fully initialized";
- d_replayStream = replayStream;
-}
-
bool SmtEngine::getExpressionName(Expr e, std::string& name) const {
return d_private->getExpressionName(e, name);
}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback