本文整理汇总了C++中TNode::getId方法的典型用法代码示例。如果您正苦于以下问题:C++ TNode::getId方法的具体用法?C++ TNode::getId怎么用?C++ TNode::getId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TNode
的用法示例。
在下文中一共展示了TNode::getId方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setJustified
void Relevancy::setJustified(TNode n)
{
Debug("decision") << " marking [" << n.getId() << "]"<< n << "as justified" << std::endl;
d_justified.insert(n);
if(options::decisionComputeRelevancy()) {
d_relevancy[n] = d_maxRelevancy[n];
updateRelevancy(n);
}
}
示例2: findSplitterRec
bool Relevancy::findSplitterRec(TNode node,
SatValue desiredVal)
{
Trace("decision")
<< "findSplitterRec([" << node.getId() << "]" << node << ", "
<< desiredVal << ", .. )" << std::endl;
++d_expense;
/* Handle NOT as a special case */
while (node.getKind() == kind::NOT) {
desiredVal = invertValue(desiredVal);
node = node[0];
}
/* Avoid infinite loops */
if(d_visited.find(node) != d_visited.end()) {
Debug("decision") << " node repeated. kind was " << node.getKind() << std::endl;
Assert(false);
Assert(node.getKind() == kind::ITE);
return false;
}
/* Base case */
if(checkJustified(node)) {
return false;
}
/**
* If we have already explored the subtree for some desiredVal, we
* skip this and continue exploring the rest
*/
if(d_polarityCache.find(node) == d_polarityCache.end()) {
d_polarityCache[node] = desiredVal;
} else {
Assert(d_multipleBacktrace || options::decisionComputeRelevancy());
return true;
}
d_visited.insert(node);
#if defined CVC4_ASSERTIONS || defined CVC4_TRACING
// We don't always have a sat literal, so remember that. Will need
// it for some assertions we make.
bool litPresent = d_decisionEngine->hasSatLiteral(node);
if(Trace.isOn("decision")) {
if(!litPresent) {
Trace("decision") << "no sat literal for this node" << std::endl;
}
}
//Assert(litPresent); -- fails
#endif
// Get value of sat literal for the node, if there is one
SatValue litVal = tryGetSatValue(node);
/* You'd better know what you want */
Assert(desiredVal != SAT_VALUE_UNKNOWN, "expected known value");
/* Good luck, hope you can get what you want */
Assert(litVal == desiredVal || litVal == SAT_VALUE_UNKNOWN,
"invariant violated");
/* What type of node is this */
Kind k = node.getKind();
theory::TheoryId tId = theory::kindToTheoryId(k);
/* Some debugging stuff */
Trace("jh-findSplitterRec") << "kind = " << k << std::endl;
Trace("jh-findSplitterRec") << "theoryId = " << tId << std::endl;
Trace("jh-findSplitterRec") << "node = " << node << std::endl;
Trace("jh-findSplitterRec") << "litVal = " << litVal << std::endl;
/**
* If not in theory of booleans, and not a "boolean" EQUAL (IFF),
* then check if this is something to split-on.
*/
if(tId != theory::THEORY_BOOL
// && !(k == kind::EQUAL && node[0].getType().isBoolean())
) {
// if node has embedded ites -- which currently happens iff it got
// replaced during ite removal -- then try to resolve that first
const IteList& l = getITEs(node);
Debug("jh-ite") << " ite size = " << l.size() << std::endl;
for(unsigned i = 0; i < l.size(); ++i) {
Assert(l[i].getKind() == kind::ITE, "Expected ITE");
Debug("jh-ite") << " i = " << i
<< " l[i] = " << l[i] << std::endl;
if(d_visited.find(node) != d_visited.end() ) continue;
if(findSplitterRec(l[i], SAT_VALUE_TRUE)) {
d_visited.erase(node);
return true;
}
}
Debug("jh-ite") << " ite done " << l.size() << std::endl;
if(litVal != SAT_VALUE_UNKNOWN) {
d_visited.erase(node);
setJustified(node);
//.........这里部分代码省略.........