summaryrefslogtreecommitdiff
path: root/src/decision/justification_heuristic.cpp
diff options
context:
space:
mode:
authorMathias Preiner <mathias.preiner@gmail.com>2019-12-17 13:43:44 -0800
committerGitHub <noreply@github.com>2019-12-17 13:43:44 -0800
commite9499c41f405df8b42fd9ae10004b1b91a869106 (patch)
treefa1475f43a3e61b8f6ffdcb903b65919eba28661 /src/decision/justification_heuristic.cpp
parent9b2914ed9f7b14ecf535ffe9e1328d0fa042e072 (diff)
Generate code for options with modes. (#3561)
This commit adds support for code generation of options with modes (enums). From now on option enums can be specified in the corresponding *.toml files without the need of extra code. All option enums are now in the options namespace.
Diffstat (limited to 'src/decision/justification_heuristic.cpp')
-rw-r--r--src/decision/justification_heuristic.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/decision/justification_heuristic.cpp b/src/decision/justification_heuristic.cpp
index f7e5b84fc..a6b6cbd8f 100644
--- a/src/decision/justification_heuristic.cpp
+++ b/src/decision/justification_heuristic.cpp
@@ -248,7 +248,9 @@ DecisionWeight JustificationHeuristic::getWeightPolarized(TNode n, SatValue satV
DecisionWeight JustificationHeuristic::getWeightPolarized(TNode n, bool polarity)
{
- if(options::decisionWeightInternal() != DECISION_WEIGHT_INTERNAL_USR1) {
+ if (options::decisionWeightInternal()
+ != options::DecisionWeightInternal::USR1)
+ {
return getWeight(n);
}
@@ -297,10 +299,11 @@ DecisionWeight JustificationHeuristic::getWeightPolarized(TNode n, bool polarity
DecisionWeight JustificationHeuristic::getWeight(TNode n) {
if(!n.hasAttribute(DecisionWeightAttr()) ) {
+ options::DecisionWeightInternal combiningFn =
+ options::decisionWeightInternal();
- DecisionWeightInternal combiningFn = options::decisionWeightInternal();
-
- if (combiningFn == DECISION_WEIGHT_INTERNAL_OFF || n.getNumChildren() == 0)
+ if (combiningFn == options::DecisionWeightInternal::OFF
+ || n.getNumChildren() == 0)
{
if (options::decisionRandomWeight() != 0)
{
@@ -308,15 +311,15 @@ DecisionWeight JustificationHeuristic::getWeight(TNode n) {
Random::getRandom().pick(0, options::decisionRandomWeight()-1));
}
}
- else if (combiningFn == DECISION_WEIGHT_INTERNAL_MAX)
+ else if (combiningFn == options::DecisionWeightInternal::MAX)
{
DecisionWeight dW = 0;
for (TNode::iterator i = n.begin(); i != n.end(); ++i)
dW = max(dW, getWeight(*i));
n.setAttribute(DecisionWeightAttr(), dW);
}
- else if (combiningFn == DECISION_WEIGHT_INTERNAL_SUM
- || combiningFn == DECISION_WEIGHT_INTERNAL_USR1)
+ else if (combiningFn == options::DecisionWeightInternal::SUM
+ || combiningFn == options::DecisionWeightInternal::USR1)
{
DecisionWeight dW = 0;
for (TNode::iterator i = n.begin(); i != n.end(); ++i)
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback