本文整理汇总了C++中ASTNode::isPred方法的典型用法代码示例。如果您正苦于以下问题:C++ ASTNode::isPred方法的具体用法?C++ ASTNode::isPred怎么用?C++ ASTNode::isPred使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ASTNode
的用法示例。
在下文中一共展示了ASTNode::isPred方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: convertFormulaToCNFNegCases
void CNFMgr::convertFormulaToCNFNegCases(const ASTNode& varphi,
ClauseList* defs)
{
if (varphi.isPred())
{
convertFormulaToCNFNegPred(varphi, defs);
return;
}
Kind k = varphi.GetKind();
switch (k)
{
case FALSE:
{
convertFormulaToCNFNegFALSE(varphi, defs);
break;
}
case TRUE:
{
convertFormulaToCNFNegTRUE(varphi, defs);
break;
}
case BVGETBIT:
{
convertFormulaToCNFNegBVGETBIT(varphi, defs);
break;
}
case SYMBOL:
{
convertFormulaToCNFNegSYMBOL(varphi, defs);
break;
}
case NOT:
{
convertFormulaToCNFNegNOT(varphi, defs);
break;
}
case AND:
{
convertFormulaToCNFNegAND(varphi, defs);
break;
}
case NAND:
{
convertFormulaToCNFNegNAND(varphi, defs);
break;
}
case OR:
{
convertFormulaToCNFNegOR(varphi, defs);
break;
}
case NOR:
{
convertFormulaToCNFNegNOR(varphi, defs);
break;
}
case XOR:
{
convertFormulaToCNFNegXOR(varphi, defs);
break;
}
case IMPLIES:
{
convertFormulaToCNFNegIMPLIES(varphi, defs);
break;
}
case ITE:
{
convertFormulaToCNFNegITE(varphi, defs);
break;
}
default:
{
fprintf(stderr, "convertFormulaToCNFNegCases: "\
"doesn't handle kind %d\n", k);
FatalError("");
}
}
} //convertFormulaToCNFNegCases()
示例2: scanFormula
void CNFMgr::scanFormula(const ASTNode& varphi, bool isPos, bool isXorChild)
{
CNFInfo* x;
Kind k = varphi.GetKind();
//########################################
// step 1, get the info associated with this node
//########################################
if (info.find(varphi) == info.end())
{
x = new CNFInfo();
info[varphi] = x;
}
else
{
x = info[varphi];
}
#if defined CRYPTOMINISAT__2
if(isXorChild)
{
setDoRenamePos(*x);
}
#endif
//########################################
// step 2, we only need to know if shares >= 2
//########################################
if (isPos && sharesPos(*x) == 2)
{
return;
}
if (!isPos && sharesNeg(*x) == 2)
{
return;
}
//########################################
// step 3, set appropriate information fields
//########################################
if (isPos)
{
incrementSharesPos(*x);
}
if (!isPos)
{
incrementSharesNeg(*x);
}
//########################################
// step 4, recurse over children
//########################################
if (varphi.isAtom())
{
return;
}
else if (varphi.isPred())
{
for (unsigned int i = 0; i < varphi.GetChildren().size(); i++)
{
scanTerm(varphi[i]);
}
}
else
{
for (unsigned int i = 0; i < varphi.GetChildren().size(); i++)
{
if (onChildDoPos(varphi, i))
{
scanFormula(varphi[i], isPos, k == XOR);
}
if (onChildDoNeg(varphi, i))
{
scanFormula(varphi[i], !isPos, false);
}
}
}
} //End of ScanFormula()