d_result(context(), SAT_VALUE_UNKNOWN),
d_engineState(0),
d_enabledITEStrategy(nullptr),
- d_decisionStopOnly(options::decisionMode()
+ d_decisionStopOnly(options().decision.decisionMode
== options::DecisionMode::STOPONLY_OLD)
{
Trace("decision") << "Creating decision engine" << std::endl;
Trace("decision-init") << "DecisionEngineOld::init()" << std::endl;
Trace("decision-init") << " * options->decisionMode: "
- << options::decisionMode() << std::endl;
+ << options().decision.decisionMode << std::endl;
Trace("decision-init") << " * decisionStopOnly: " << d_decisionStopOnly
<< std::endl;
- if (options::decisionMode() == options::DecisionMode::JUSTIFICATION)
+ if (options().decision.decisionMode == options::DecisionMode::JUSTIFICATION)
{
d_enabledITEStrategy.reset(new decision::JustificationHeuristic(env, this));
}
cvc5::prop::SatLiteral JustificationHeuristic::getNext(bool& stopSearch)
{
- if(options::decisionThreshold() > 0) {
+ if (options().decision.decisionThreshold > 0)
+ {
bool stopSearchTmp = false;
prop::SatLiteral lit =
- getNextThresh(stopSearchTmp, options::decisionThreshold());
+ getNextThresh(stopSearchTmp, options().decision.decisionThreshold);
if (lit != prop::undefSatLiteral)
{
Assert(stopSearchTmp == false);
DecisionWeight JustificationHeuristic::getWeightPolarized(TNode n, bool polarity)
{
- if (options::decisionWeightInternal()
+ if (options().decision.decisionWeightInternal
!= options::DecisionWeightInternal::USR1)
{
return getWeight(n);
DecisionWeight JustificationHeuristic::getWeight(TNode n) {
if(!n.hasAttribute(DecisionWeightAttr()) ) {
options::DecisionWeightInternal combiningFn =
- options::decisionWeightInternal();
+ options().decision.decisionWeightInternal;
if (combiningFn == options::DecisionWeightInternal::OFF
|| n.getNumChildren() == 0)
{
- if (options::decisionRandomWeight() != 0)
+ if (options().decision.decisionRandomWeight != 0)
{
n.setAttribute(DecisionWeightAttr(),
- Random::getRandom().pick(0, options::decisionRandomWeight()-1));
+ Random::getRandom().pick(
+ 0, options().decision.decisionRandomWeight - 1));
}
}
else if (combiningFn == options::DecisionWeightInternal::MAX)
typedef std::vector<TNode> ChildList;
TNode JustificationHeuristic::getChildByWeight(TNode n, int i, bool polarity) {
- if(options::decisionUseWeight()) {
+ if (options().decision.decisionUseWeight)
+ {
// TODO: Optimize storing & access
if(d_childCache.find(n) == d_childCache.end()) {
ChildList list0(n.begin(), n.end()), list1(n.begin(), n.end());
d_childCache[n] = make_pair(list0, list1);
}
return polarity ? d_childCache[n].get().second[i] : d_childCache[n].get().first[i];
- } else {
+ }
+ else
+ {
return n[i];
}
}
TNode node2,
SatValue desiredVal2)
{
- if(options::decisionUseWeight() &&
- getWeightPolarized(node1, desiredVal1) > getWeightPolarized(node2, desiredVal2)) {
+ if (options().decision.decisionUseWeight
+ && getWeightPolarized(node1, desiredVal1)
+ > getWeightPolarized(node2, desiredVal2))
+ {
std::swap(node1, node2);
std::swap(desiredVal1, desiredVal2);
}
TNode node2,
SatValue desiredVal2)
{
- if(options::decisionUseWeight() &&
- getWeightPolarized(node1, desiredVal1) > getWeightPolarized(node2, desiredVal2)) {
+ if (options().decision.decisionUseWeight
+ && getWeightPolarized(node1, desiredVal1)
+ > getWeightPolarized(node2, desiredVal2))
+ {
std::swap(node1, node2);
std::swap(desiredVal1, desiredVal2);
}
if(trueChildVal == desiredVal || falseChildVal == invertValue(desiredVal)) {
ifDesiredVal = SAT_VALUE_TRUE;
- } else if(trueChildVal == invertValue(desiredVal) ||
- falseChildVal == desiredVal ||
- (options::decisionUseWeight() &&
- getWeightPolarized(node[1], true) > getWeightPolarized(node[2], false))
- ) {
+ }
+ else if (trueChildVal == invertValue(desiredVal)
+ || falseChildVal == desiredVal
+ || (options().decision.decisionUseWeight
+ && getWeightPolarized(node[1], true)
+ > getWeightPolarized(node[2], false)))
+ {
ifDesiredVal = SAT_VALUE_FALSE;
- } else {
+ }
+ else
+ {
ifDesiredVal = SAT_VALUE_TRUE;
}
d_assertions(
userContext(),
context(),
- options::jhRlvOrder()), // assertions are user-context dependent
+ options()
+ .decision.jhRlvOrder), // assertions are user-context dependent
d_skolemAssertions(
context(), context()), // skolem assertions are SAT-context dependent
d_justified(context()),
d_stack(context()),
d_lastDecisionLit(context()),
d_currStatusDec(false),
- d_useRlvOrder(options::jhRlvOrder()),
- d_decisionStopOnly(options::decisionMode()
+ d_useRlvOrder(options().decision.jhRlvOrder),
+ d_decisionStopOnly(options().decision.decisionMode
== options::DecisionMode::STOPONLY),
- d_jhSkMode(options::jhSkolemMode()),
- d_jhSkRlvMode(options::jhSkolemRlvMode())
+ d_jhSkMode(options().decision.jhSkolemMode),
+ d_jhSkRlvMode(options().decision.jhSkolemRlvMode)
{
}