//bool d_lazyRIntro1 = true;
//bool d_eagerIndexSplitting = false;
-TheoryArrays::TheoryArrays(context::Context* c, context::UserContext* u,
- OutputChannel& out, Valuation valuation,
- const LogicInfo& logicInfo, std::string name)
+TheoryArrays::TheoryArrays(context::Context* c,
+ context::UserContext* u,
+ OutputChannel& out,
+ Valuation valuation,
+ const LogicInfo& logicInfo,
+ std::string name)
: Theory(THEORY_ARRAYS, c, u, out, valuation, logicInfo, name),
d_numRow(name + "theory::arrays::number of Row lemmas", 0),
d_numExt(name + "theory::arrays::number of Ext lemmas", 0),
d_numProp(name + "theory::arrays::number of propagations", 0),
d_numExplain(name + "theory::arrays::number of explanations", 0),
- d_numNonLinear(name + "theory::arrays::number of calls to setNonLinear", 0),
- d_numSharedArrayVarSplits(name + "theory::arrays::number of shared array var splits", 0),
- d_numGetModelValSplits(name + "theory::arrays::number of getModelVal splits", 0),
- d_numGetModelValConflicts(name + "theory::arrays::number of getModelVal conflicts", 0),
- d_numSetModelValSplits(name + "theory::arrays::number of setModelVal splits", 0),
- d_numSetModelValConflicts(name + "theory::arrays::number of setModelVal conflicts", 0),
- d_ppEqualityEngine(u, name + "theory::arrays::pp" , true),
+ d_numNonLinear(name + "theory::arrays::number of calls to setNonLinear",
+ 0),
+ d_numSharedArrayVarSplits(
+ name + "theory::arrays::number of shared array var splits", 0),
+ d_numGetModelValSplits(
+ name + "theory::arrays::number of getModelVal splits", 0),
+ d_numGetModelValConflicts(
+ name + "theory::arrays::number of getModelVal conflicts", 0),
+ d_numSetModelValSplits(
+ name + "theory::arrays::number of setModelVal splits", 0),
+ d_numSetModelValConflicts(
+ name + "theory::arrays::number of setModelVal conflicts", 0),
+ d_ppEqualityEngine(u, name + "theory::arrays::pp", true),
d_ppFacts(u),
// d_ppCache(u),
d_literalsToPropagate(c),
d_readTableContext(new context::Context()),
d_arrayMerges(c),
d_inCheckModel(false),
- d_proofReconstruction(&d_equalityEngine)
+ d_proofReconstruction(&d_equalityEngine),
+ d_dstrat(new TheoryArraysDecisionStrategy(this))
{
smtStatisticsRegistry()->registerStat(&d_numRow);
smtStatisticsRegistry()->registerStat(&d_numExt);
d_equalityEngine.setMasterEqualityEngine(eq);
}
-
/////////////////////////////////////////////////////////////////////////////
// PREPROCESSING
/////////////////////////////////////////////////////////////////////////////
void TheoryArrays::presolve()
{
Trace("arrays")<<"Presolving \n";
+ // add the decision strategy
+ getDecisionManager()->registerStrategy(DecisionManager::STRAT_ARRAYS,
+ d_dstrat.get());
}
}
}
-
-Node TheoryArrays::getNextDecisionRequest( unsigned& priority ) {
+Node TheoryArrays::getNextDecisionRequest()
+{
if(! d_decisionRequests.empty()) {
Node n = d_decisionRequests.front();
d_decisionRequests.pop();
- priority = 2;
return n;
- } else {
- return Node::null();
}
+ return Node::null();
}
d_conflict = true;
}
+TheoryArrays::TheoryArraysDecisionStrategy::TheoryArraysDecisionStrategy(
+ TheoryArrays* ta)
+ : d_ta(ta)
+{
+}
+void TheoryArrays::TheoryArraysDecisionStrategy::initialize() {}
+Node TheoryArrays::TheoryArraysDecisionStrategy::getNextDecisionRequest()
+{
+ return d_ta->getNextDecisionRequest();
+}
+std::string TheoryArrays::TheoryArraysDecisionStrategy::identify() const
+{
+ return std::string("th_arrays_dec");
+}
+
}/* CVC4::theory::arrays namespace */
}/* CVC4::theory namespace */
}/* CVC4 namespace */
// NOTIFICATIONS
/////////////////////////////////////////////////////////////////////////////
- public:
- Node getNextDecisionRequest(unsigned& priority) override;
void presolve() override;
void shutdown() override {}
/** An equality-engine callback for proof reconstruction */
ArrayProofReconstruction d_proofReconstruction;
+ /**
+ * The decision strategy for the theory of arrays, which calls the
+ * getNextDecisionEngineRequest function below.
+ */
+ class TheoryArraysDecisionStrategy : public DecisionStrategy
+ {
+ public:
+ TheoryArraysDecisionStrategy(TheoryArrays* ta);
+ /** initialize */
+ void initialize() override;
+ /** get next decision request */
+ Node getNextDecisionRequest() override;
+ /** identify */
+ std::string identify() const override;
+
+ private:
+ /** pointer to the theory of arrays */
+ TheoryArrays* d_ta;
+ };
+ /** an instance of the above decision strategy */
+ std::unique_ptr<TheoryArraysDecisionStrategy> d_dstrat;
+ /** get the next decision request
+ *
+ * If the "arrays-eager-index" option is enabled, then whenever a
+ * read-over-write lemma is generated, a decision request is also generated
+ * for the comparison between the indexes that appears in the lemma.
+ */
+ Node getNextDecisionRequest();
+
public:
eq::EqualityEngine* getEqualityEngine() override { return &d_equalityEngine; }