cloud9_root/src/third_party/stp/src/simplifier/constantBitP/ConstantBitPropagation.cpp
// If the bits are totally fixed, then return a new matching ASTNode.
If the bits are totally fixed, then return a new matching ASTNode.
If the bits are totally fixed then return a new matching ASTNode .
ASTNode
    bitsToNode(const ASTNode& node, const FixedBits& bits)
    {
      ASTNode result;
      STPMgr & beev = *node.GetSTPMgr();
      assert (bits.isTotallyFixed());
      assert (!node.isConstant()); 
      if (node.GetType() == BOOLEAN_TYPE)
        {
          if (bits.getValue(0))
            {
              result = beev.CreateNode(TRUE);
            }
          else
            {
              result = beev.CreateNode(FALSE);
            }
        }
      else if (node.GetType() == BITVECTOR_TYPE)
        {
          result = beev.CreateBVConst(bits.GetBVConst(), node.GetValueWidth());
        }
      else
        FatalError("sadf234s");
      assert(result.isConstant());
      return result;
    }
ASTNode bitsToNode ( const ASTNode & node , const FixedBits & bits ) { ASTNode result ; STPMgr & beev = * node . GetSTPMgr ( ) ; assert ( bits . isTotallyFixed ( ) ) ; assert ( ! node . isConstant ( ) ) ; if ( node . GetType ( ) == BOOLEAN_TYPE ) { if ( bits . getValue ( 0 ) ) { result = beev . CreateNode ( TRUE ) ; } else { result = beev . CreateNode ( FALSE ) ; } } else if ( node . GetType ( ) == BITVECTOR_TYPE ) { result = beev . CreateBVConst ( bits . GetBVConst ( ) , node . GetValueWidth ( ) ) ; } else FatalError ( " " ) ; assert ( result . isConstant ( ) ) ; return result ; }
If the bits are totally fixed, then return a new matching ASTNode.
If the bits are totally fixed then return a new matching ASTNode .
// Peformance. Shouldn't waste time calling it on constants.