From: Tim King Date: Mon, 6 May 2013 19:00:34 +0000 (-0400) Subject: Disables justification stop only for LRA if the problem contains no ites. This is... X-Git-Tag: cvc5-1.0.0~7287^2~153 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5b0b97587e3640567ecd864171b309f39d829358;p=cvc5.git Disables justification stop only for LRA if the problem contains no ites. This is a bandaid for constraints-tempo-width family of benchmarks. --- diff --git a/src/decision/decision_engine.cpp b/src/decision/decision_engine.cpp index 687515ff0..f634a28d9 100644 --- a/src/decision/decision_engine.cpp +++ b/src/decision/decision_engine.cpp @@ -82,6 +82,13 @@ void DecisionEngine::enableStrategy(DecisionStrategy* ds) d_enabledStrategies.push_back(ds); } +void DecisionEngine::clearStrategies(){ + for(unsigned i = 0; i < d_enabledStrategies.size(); ++i){ + delete d_enabledStrategies[i]; + } + d_enabledStrategies.clear(); + d_needIteSkolemMap.clear(); +} bool DecisionEngine::isRelevant(SatVariable var) { diff --git a/src/decision/decision_engine.h b/src/decision/decision_engine.h index bc071f7f6..f28b13774 100644 --- a/src/decision/decision_engine.h +++ b/src/decision/decision_engine.h @@ -96,6 +96,10 @@ public: /* enables decision stragies based on options */ void init(); + /* clears all of the strategies */ + void clearStrategies(); + + /** * This is called by SmtEngine, at shutdown time, just before * destruction. It is important because there are destruction @@ -106,8 +110,7 @@ public: d_engineState = 2; Trace("decision") << "Shutting down decision engine" << std::endl; - for(unsigned i = 0; i < d_enabledStrategies.size(); ++i) - delete d_enabledStrategies[i]; + clearStrategies(); } // Interface for External World to use our services diff --git a/src/smt/smt_engine.cpp b/src/smt/smt_engine.cpp index 0d473a1a1..75cffefc2 100644 --- a/src/smt/smt_engine.cpp +++ b/src/smt/smt_engine.cpp @@ -292,14 +292,13 @@ class SmtEnginePrivate : public NodeManagerListener { */ Node d_modZero; +public: /** * Map from skolem variables to index in d_assertionsToCheck containing * corresponding introduced Boolean ite */ IteSkolemMap d_iteSkolemMap; -public: - /** Instance of the ITE remover */ RemoveITE d_iteRemover; @@ -2534,6 +2533,21 @@ Result SmtEngine::check() { Trace("smt") << "SmtEngine::check(): processing assertions" << endl; d_private->processAssertions(); + // Turn off stop only for QF_LRA + // TODO: Bring up in a meeting where to put this + if(options::decisionStopOnly() && !options::decisionMode.wasSetByUser() ){ + if( // QF_LRA + (not d_logic.isQuantified() && + d_logic.isPure(THEORY_ARITH) && d_logic.isLinear() && !d_logic.isDifferenceLogic() && !d_logic.areIntegersUsed() + )){ + if(d_private->d_iteSkolemMap.empty()){ + options::decisionStopOnly.set(false); + d_decisionEngine->clearStrategies(); + Trace("smt") << "SmtEngine::check(): turning off stop only" << endl; + } + } + } + unsigned long millis = 0; if(d_timeBudgetCumulative != 0) { millis = getTimeRemaining();