cloud9_root/src/third_party/stp/src/simplifier/simplifier.cpp
//returns true if the input is odd
returns true if the input is odd
returns true if the input is odd
bool
  Simplifier::BVConstIsOdd(const ASTNode& c)
  {
    if (BVCONST != c.GetKind())
      {
        FatalError("Input must be a constant", c);
      }
    ASTNode zero = _bm->CreateZeroConst(1);
    ASTNode hi = _bm->CreateZeroConst(32);
    ASTNode low = hi;
    ASTNode lowestbit = nf->CreateTerm(BVEXTRACT, 1, c, hi, low);
    lowestbit = BVConstEvaluator(lowestbit);
    if (lowestbit == zero)
      {
        return false;
      }
    else
      {
        return true;
      }
  }
bool Simplifier :: BVConstIsOdd ( const ASTNode & c ) { if ( BVCONST != c . GetKind ( ) ) { FatalError ( " " , c ) ; } ASTNode zero = _bm -> CreateZeroConst ( 1 ) ; ASTNode hi = _bm -> CreateZeroConst ( 32 ) ; ASTNode low = hi ; ASTNode lowestbit = nf -> CreateTerm ( BVEXTRACT , 1 , c , hi , low ) ; lowestbit = BVConstEvaluator ( lowestbit ) ; if ( lowestbit == zero ) { return false ; } else { return true ; } }
returns true if the input is odd
returns true if the input is odd