当前位置: 首页>>代码示例>>C++>>正文


C++ ASTNode::SetIndexWidth方法代码示例

本文整理汇总了C++中ASTNode::SetIndexWidth方法的典型用法代码示例。如果您正苦于以下问题:C++ ASTNode::SetIndexWidth方法的具体用法?C++ ASTNode::SetIndexWidth怎么用?C++ ASTNode::SetIndexWidth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ASTNode的用法示例。


在下文中一共展示了ASTNode::SetIndexWidth方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: CreateArrayTerm

BEEV::ASTNode NodeFactory::CreateArrayTerm(Kind kind, unsigned int index,
        unsigned int width, const BEEV::ASTVec &children)
{
    ASTNode result = CreateTerm(kind, width, children);
    result.SetIndexWidth(index);
    return result;
}
开发者ID:khooyp,项目名称:stp,代码行数:7,代码来源:NodeFactory.cpp

示例2: 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;
}
开发者ID:khooyp,项目名称:stp,代码行数:7,代码来源:NodeFactory.cpp

示例3: CreateArrayTerm

BEEV::ASTNode TypeChecker::CreateArrayTerm(Kind kind, unsigned int index,
		unsigned int width, const BEEV::ASTVec &children)
{
	ASTNode r = f.CreateTerm(kind, width, children);
	r.SetIndexWidth(index);
	BVTypeCheck(r);
	return r;
}
开发者ID:Daeinar,项目名称:stp,代码行数:8,代码来源:TypeChecker.cpp

示例4: 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;
}
开发者ID:chubbymaggie,项目名称:Tac-Symbolic-Executor,代码行数:12,代码来源:HashingNodeFactory.cpp

示例5: 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()
开发者ID:,项目名称:,代码行数:44,代码来源:

示例6: 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
开发者ID:jamella,项目名称:stp,代码行数:67,代码来源:ArrayTransformer.cpp


注:本文中的ASTNode::SetIndexWidth方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。