本文整理汇总了C++中ASTNode::SetValueWidth方法的典型用法代码示例。如果您正苦于以下问题:C++ ASTNode::SetValueWidth方法的具体用法?C++ ASTNode::SetValueWidth怎么用?C++ ASTNode::SetValueWidth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ASTNode
的用法示例。
在下文中一共展示了ASTNode::SetValueWidth方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateSymbol
ASTNode NodeFactory::CreateSymbol(const char * const name, unsigned indexWidth, unsigned valueWidth)
{
ASTNode n = bm.LookupOrCreateSymbol(name);
n.SetIndexWidth(indexWidth);
n.SetValueWidth(valueWidth);
return n;
}
示例2: CreateTerm
// Create and return an ASTNode for a term
ASTNode HashingNodeFactory::CreateTerm(Kind kind, unsigned int width,const ASTVec &children)
{
ASTNode n = CreateNode(kind, children);
n.SetValueWidth(width);
//by default we assume that the term is a Bitvector. If
//necessary the indexwidth can be changed later
n.SetIndexWidth(0);
return n;
}
示例3: convertTermForCNF
void CNFMgr::convertTermForCNF(const ASTNode& varphi, ClauseList* defs)
{
CNFInfo* x = info[varphi];
//########################################
// step 1, done if we've already visited
//########################################
if (x->termforcnf != NULL)
{
return;
}
//########################################
// step 2, ITE's always get renamed
//########################################
if (varphi.isITE())
{
x->termforcnf = doRenameITE(varphi, defs);
reduceMemoryFootprintPos(varphi[0]);
reduceMemoryFootprintNeg(varphi[0]);
}
else if (varphi.isAtom())
{
x->termforcnf = ASTNodeToASTNodePtr(varphi);
}
else
{
ASTVec psis;
ASTVec::const_iterator it = varphi.GetChildren().begin();
for (; it != varphi.GetChildren().end(); it++)
{
convertTermForCNF(*it, defs);
psis.push_back(*(info[*it]->termforcnf));
}
ASTNode psi = bm->CreateNode(varphi.GetKind(), psis);
psi.SetValueWidth(varphi.GetValueWidth());
psi.SetIndexWidth(varphi.GetIndexWidth());
x->termforcnf = ASTNodeToASTNodePtr(psi);
}
} //End of convertTermForCNF()
示例4: TransformArrayRead
//.........这里部分代码省略.........
// If the condition is true, it saves iteratively transforming through
// all the (possibly nested) arrays.
if (ASTTrue == cond)
{
result = writeVal;
}
else
{
ASTNode readTerm = nf->CreateTerm(READ, width, arrName[0], readIndex);
assert(BVTypeCheck(readTerm));
// The simplifying node factory may have produced
// something that's not a READ.
ASTNode readPushedIn = TransformTerm(readTerm);
assert(BVTypeCheck(readPushedIn));
result = simp->CreateSimplifiedTermITE(cond, writeVal, readPushedIn);
}
}
// Trevor: I've removed this code because I don't see the advantage in working
// inside out. i.e. transforming read(write(ite(p,A,B),i,j),k), into
// read(ite(p,write(A,i,j),write(B,i,j),k). That is bringing up the ite.
// Without this code it will become: ite(i=k, j, read(ite(p,A,B),k))
#if 0
else if (ITE == arrName[0].GetKind())
{
// pull out the ite from the write // pushes the write
// through.
ASTNode writeTrue =
nf->CreateNode(WRITE, (arrName[0][1]), writeIndex, writeVal);
writeTrue.SetIndexWidth(writeIndex.GetValueWidth());
writeTrue.SetValueWidth(writeVal.GetValueWidth());
assert(ARRAY_TYPE == writeTrue.GetType());
ASTNode writeFalse =
nf->CreateNode(WRITE, (arrName[0][2]), writeIndex, writeVal);
writeFalse.SetIndexWidth(writeIndex.GetValueWidth());
writeFalse.SetValueWidth(writeVal.GetValueWidth());
assert(ARRAY_TYPE == writeFalse.GetType());
result = (writeTrue == writeFalse) ?
writeTrue : simp->CreateSimplifiedTermITE(TransformFormula(arrName[0][0]),
writeTrue, writeFalse);
result.SetIndexWidth(writeIndex.GetValueWidth());
result.SetValueWidth(writeVal.GetValueWidth());
assert(ARRAY_TYPE == result.GetType());
result =
nf->CreateTerm(READ, writeVal.GetValueWidth(),
result, readIndex);
BVTypeCheck(result);
result = TransformArrayRead(result);
}
else
FatalError("TransformArray: Write over bad type.");
#endif
break;
}
case ITE:
{
/* READ((ITE cond thn els) j)
*
* is transformed into
*