# notifyRestart the theory supports notifyRestart()
# presolve the theory supports presolve()
# postsolve the theory supports postsolve()
-# getNextDecisionRequest the theory supports getNextDecisionRequest()
#
# In the case of the "theory-supports-function" properties, you
# need to declare these for your theory or the functions will not
d_reg_strategy[id].push_back(ds);
}
-Node DecisionManager::getNextDecisionRequest(unsigned& priority)
+Node DecisionManager::getNextDecisionRequest()
{
Trace("dec-manager-debug")
<< "DecisionManager: Get next decision..." << std::endl;
Node lit = ds->getNextDecisionRequest();
if (!lit.isNull())
{
- StrategyId sid = rs.first;
- priority = sid < STRAT_LAST_M_SOUND
- ? 0
- : (sid < STRAT_LAST_FM_COMPLETE ? 1 : 2);
Trace("dec-manager")
<< "DecisionManager: -> literal " << lit << " decided by strategy "
<< ds->identify() << std::endl;
* returns null, then no decisions are required by a decision strategy
* registered to this class. In the latter case, the SAT solver will choose
* a decision based on its given heuristic.
- *
- * The argument priority has the same role as in
- * Theory::getNextDecisionRequest.
*/
- Node getNextDecisionRequest(unsigned& priorty);
+ Node getNextDecisionRequest();
private:
/** Map containing all strategies registered to this manager */
theory_has_notifyRestart="false"
theory_has_presolve="false"
theory_has_postsolve="false"
-theory_has_getNextDecisionRequest="false"
theory_stable_infinite="false"
theory_finite="false"
static const bool hasNotifyRestart = ${theory_has_notifyRestart};
static const bool hasPresolve = ${theory_has_presolve};
static const bool hasPostsolve = ${theory_has_postsolve};
- static const bool hasGetNextDecisionRequest = ${theory_has_getNextDecisionRequest};
};/* struct TheoryTraits<${theory_id}> */
"
# warnings about theory content and properties
dir="$(dirname "$kf")/../../"
if [ -e "$dir/$theory_header" ]; then
- for function in check propagate ppStaticLearn notifyRestart presolve postsolve getNextDecisionRequest; do
+ for function in check propagate ppStaticLearn notifyRestart presolve postsolve; do
if eval "\$theory_has_$function"; then
grep '\<'"$function"' *\((\|;\)' "$dir/$theory_header" | grep -vq '^ */\(/\|\*\)' ||
echo "$kf: warning: $theory_class has property \"$function\" in its kinds file but doesn't appear to declare the function" >&2
theory_has_notifyRestart="false"
theory_has_presolve="false"
theory_has_postsolve="false"
- theory_has_getNextDecisionRequest="false"
theory_stable_infinite="false"
theory_finite="false"
ppStaticLearn) theory_has_ppStaticLearn="true";;
presolve) theory_has_presolve="true";;
postsolve) theory_has_postsolve="true";;
- getNextDecisionRequest) theory_has_getNextDecisionRequest="true";;
notifyRestart) theory_has_notifyRestart="true";;
*) echo "$kf:$lineno: error: unknown theory property \"$property\"" >&2; exit 1;;
esac
theory THEORY_STRINGS ::CVC4::theory::strings::TheoryStrings "theory/strings/theory_strings.h"
-properties check parametric propagate getNextDecisionRequest presolve
+properties check parametric propagate presolve
rewriter ::CVC4::theory::strings::TheoryStringsRewriter "theory/strings/theory_strings_rewriter.h"
virtual bool collectModelInfo(TheoryModel* m) { return true; }
/** if theories want to do something with model after building, do it here */
virtual void postProcessModel( TheoryModel* m ){ }
- /**
- * Return a decision request, if the theory has one, or the NULL node
- * otherwise.
- * If returning non-null node, should set priority to
- * 0 if decision is necessary for model-soundness,
- * 1 if decision is necessary for completeness,
- * >1 otherwise.
- */
- virtual Node getNextDecisionRequest( unsigned& priority ) { return Node(); }
-
/**
* Statically learn from assertion "in," which has been asserted
* true at the top level. The theory should only add (via
}
}
-Node TheoryEngine::getNextDecisionRequest() {
- unsigned min_priority = 0;
- Node dec = d_decManager->getNextDecisionRequest(min_priority);
-
- // Definition of the statement that is to be run by every theory
-#ifdef CVC4_FOR_EACH_THEORY_STATEMENT
-#undef CVC4_FOR_EACH_THEORY_STATEMENT
-#endif
-#define CVC4_FOR_EACH_THEORY_STATEMENT(THEORY) \
- if (theory::TheoryTraits<THEORY>::hasGetNextDecisionRequest && d_logicInfo.isTheoryEnabled(THEORY)) { \
- unsigned priority; \
- Node n = theoryOf(THEORY)->getNextDecisionRequest( priority ); \
- if(! n.isNull() && ( dec.isNull() || priority<min_priority ) ) { \
- dec = n; \
- min_priority = priority; \
- } \
- }
-
- // Request decision from each theory using the statement above
- CVC4_FOR_EACH_THEORY;
-
- return dec;
+Node TheoryEngine::getNextDecisionRequest()
+{
+ return d_decManager->getNextDecisionRequest();
}
bool TheoryEngine::properConflict(TNode conflict) const {
}
}
+ /**
+ * Returns the next decision request, or null if none exist. The next
+ * decision request is a literal that this theory engine prefers the SAT
+ * solver to make as its next decision. Decision requests are managed by
+ * the decision manager d_decManager.
+ */
Node getNextDecisionRequest();
bool properConflict(TNode conflict) const;