d_engineState = 1;
Trace("decision-init") << "DecisionEngine::init()" << std::endl;
- Trace("decision-init") << " * options->decisionMode: "
+ Trace("decision-init") << " * options->decisionMode: "
<< options::decisionMode() << std:: endl;
Trace("decision-init") << " * options->decisionStopOnly: "
<< options::decisionStopOnly() << std::endl;
if(options::decisionMode() == decision::DECISION_STRATEGY_INTERNAL) { }
if(options::decisionMode() == decision::DECISION_STRATEGY_JUSTIFICATION) {
- ITEDecisionStrategy* ds =
+ ITEDecisionStrategy* ds =
new decision::JustificationHeuristic(this, d_userContext, d_satContext);
enableStrategy(ds);
d_needIteSkolemMap.push_back(ds);
// d_result = SAT_VALUE_UNKNOWN;
// d_assertions.reserve(assertions.size());
// for(unsigned i = 0; i < assertions.size(); ++i)
- // d_assertions.push_back(assertions[i]);
+ // d_assertions.push_back(assertions[i]);
}
void DecisionEngine::addAssertions(const vector<Node> &assertions,
{
// new assertions, reset whatever result we knew
d_result = SAT_VALUE_UNKNOWN;
-
+
// d_assertions.reserve(assertions.size());
for(unsigned i = 0; i < assertions.size(); ++i)
d_assertions.push_back(assertions[i]);
-
+
for(unsigned i = 0; i < d_needIteSkolemMap.size(); ++i)
d_needIteSkolemMap[i]->
addAssertions(assertions, assertionsEnd, iteSkolemMap);
~DecisionEngine() {
Trace("decision") << "Destroying decision engine" << std::endl;
}
-
+
// void setPropEngine(PropEngine* pe) {
// // setPropEngine should not be called more than once
// Assert(d_propEngine == NULL);
"Forgot to set satSolver for decision engine?");
SatLiteral ret = undefSatLiteral;
- for(unsigned i = 0;
- i < d_enabledStrategies.size()
+ for(unsigned i = 0;
+ i < d_enabledStrategies.size()
and ret == undefSatLiteral
and stopSearch == false; ++i) {
ret = d_enabledStrategies[i]->getNext(stopSearch);
/**
* Try to get tell SAT solver what polarity to try for a
- * decision. Return SAT_VALUE_UNKNOWN if it can't help
+ * decision. Return SAT_VALUE_UNKNOWN if it can't help
*/
SatValue getPolarity(SatVariable var);
// (which was possibly requested by them on initialization)
/**
- * Get the assertions. Strategies are notified when these are available.
+ * Get the assertions. Strategies are notified when these are available.
*/
AssertionsList& getAssertions() {
return d_assertions;
virtual ~DecisionStrategy() { }
virtual prop::SatLiteral getNext(bool&) = 0;
-
+
virtual bool needIteSkolemMap() { return false; }
-
+
virtual void notifyAssertionsAvailable() { return; }
};/* class DecisionStrategy */
if(Debug.isOn("decision")) {
if(!checkJustified(curass))
- Debug("decision") << "****** Not justified [i="<<i<<"]: "
+ Debug("decision") << "****** Not justified [i="<<i<<"]: "
<< d_assertions[i] << std::endl;
}
}
IteSkolemMap iteSkolemMap) {
Trace("decision")
- << "JustificationHeuristic::addAssertions()"
+ << "JustificationHeuristic::addAssertions()"
<< " size = " << assertions.size()
<< " assertionsEnd = " << assertionsEnd
<< std::endl;
for(IteSkolemMap::iterator i = iteSkolemMap.begin();
i != iteSkolemMap.end(); ++i) {
- Trace("decision::jh::ite")
+ Trace("decision::jh::ite")
<< " jh-ite: " << (i->first) << " maps to "
<< assertions[(i->second)] << std::endl;
Assert(i->second >= assertionsEnd && i->second < assertions.size());
d_curDecision = undefSatLiteral;
if(findSplitterRec(node, desiredVal)) {
++d_helfulness;
- }
+ }
return d_curDecision;
}
* children to be true. this is done recursively.
*/
- Trace("decision::jh")
- << "findSplitterRec(" << node << ", "
- << desiredVal << ", .. )" << std::endl;
+ Trace("decision::jh")
+ << "findSplitterRec(" << node << ", "
+ << desiredVal << ", .. )" << std::endl;
/* Handle NOT as a special case */
while (node.getKind() == kind::NOT) {
/* Base case */
if (checkJustified(node)) {
- Debug("decision::jh") << " justified, returning" << std::endl;
+ Debug("decision::jh") << " justified, returning" << std::endl;
return NO_SPLITTER;
}
if (getExploredThreshold(node) < d_curThreshold) {
// "invariant violated");
/* What type of node is this */
- Kind k = node.getKind();
+ Kind k = node.getKind();
theory::TheoryId tId = theory::kindToTheoryId(k);
/* Some debugging stuff */
Assert(litVal == desiredVal);
setJustified(node);
return NO_SPLITTER;
- }
+ }
else {
Assert(d_decisionEngine->hasSatLiteral(node));
if(d_curThreshold != 0 && getWeightPolarized(node, desiredVal) >= d_curThreshold)
JustificationHeuristic::SearchResult
JustificationHeuristic::handleAndOrEasy(TNode node, SatValue desiredVal)
{
- Assert( (node.getKind() == kind::AND and desiredVal == SAT_VALUE_FALSE) or
+ Assert( (node.getKind() == kind::AND and desiredVal == SAT_VALUE_FALSE) or
(node.getKind() == kind::OR and desiredVal == SAT_VALUE_TRUE) );
int numChildren = node.getNumChildren();
JustificationHeuristic::SearchResult JustificationHeuristic::handleAndOrHard(TNode node,
SatValue desiredVal) {
- Assert( (node.getKind() == kind::AND and desiredVal == SAT_VALUE_TRUE) or
+ Assert( (node.getKind() == kind::AND and desiredVal == SAT_VALUE_TRUE) or
(node.getKind() == kind::OR and desiredVal == SAT_VALUE_FALSE) );
int numChildren = node.getNumChildren();
if(findSplitterRec(node[0], ifDesiredVal) == FOUND_SPLITTER)
return FOUND_SPLITTER;
-
+
Assert(d_curThreshold != 0, "No controlling input found (6)");
return DONT_KNOW;
} else {
prop::SatLiteral getNextThresh(bool &stopSearch, DecisionWeight threshold);
SatLiteral findSplitter(TNode node, SatValue desiredVal);
-
- /**
- * Do all the hard work.
- */
+
+ /**
+ * Do all the hard work.
+ */
SearchResult findSplitterRec(TNode node, SatValue value);
/* Helper functions */
}
void postCheckInvariants() const {
Debug("sets-scrutinize") << "[sets-scrutinize] postCheckInvariants()" << std::endl;
-
+
// assume not in conflict, and complete:
// - try building model
// - check it
-
+
TheorySetsPrivate::SettermElementsMap settermElementsMap;
TNode true_atom = NodeManager::currentNM()->mkConst<bool>(true);
std::set<Node> terms;
}
if(Debug.isOn("sets-care")) {
Debug("sets-care") << "[sets-care] Requesting split between" << a << " and "
- << b << "." << std::endl << "[sets-care] "
+ << b << "." << std::endl << "[sets-care] "
<< " Both current have value "
<< d_external.d_valuation.getModelValue(a) << std::endl;
}
context::UserContext* u);
~TheorySetsPrivate();
-
+
void setMasterEqualityEngine(eq::EqualityEngine* eq);
void addSharedTerm(TNode);