Inheritance diagram for BitVecRef:Public Member Functions | |
| def | sort (self) |
| def | size (self) |
| def | __add__ (self, other) |
| def | __radd__ (self, other) |
| def | __mul__ (self, other) |
| def | __rmul__ (self, other) |
| def | __sub__ (self, other) |
| def | __rsub__ (self, other) |
| def | __or__ (self, other) |
| def | __ror__ (self, other) |
| def | __and__ (self, other) |
| def | __rand__ (self, other) |
| def | __xor__ (self, other) |
| def | __rxor__ (self, other) |
| def | __pos__ (self) |
| def | __neg__ (self) |
| def | __invert__ (self) |
| def | __div__ (self, other) |
| def | __truediv__ (self, other) |
| def | __rdiv__ (self, other) |
| def | __rtruediv__ (self, other) |
| def | __mod__ (self, other) |
| def | __rmod__ (self, other) |
| def | __le__ (self, other) |
| def | __lt__ (self, other) |
| def | __gt__ (self, other) |
| def | __ge__ (self, other) |
| def | __rshift__ (self, other) |
| def | __lshift__ (self, other) |
| def | __rrshift__ (self, other) |
| def | __rlshift__ (self, other) |
Public Member Functions inherited from ExprRef | |
| def | as_ast (self) |
| def | get_id (self) |
| def | sort (self) |
| def | sort_kind (self) |
| def | __eq__ (self, other) |
| def | __hash__ (self) |
| def | __ne__ (self, other) |
| def | params (self) |
| def | decl (self) |
| def | num_args (self) |
| def | arg (self, idx) |
| def | children (self) |
Public Member Functions inherited from AstRef | |
| def | __init__ |
| def | __del__ (self) |
| def | __deepcopy__ |
| def | __str__ (self) |
| def | __repr__ (self) |
| def | __eq__ (self, other) |
| def | __hash__ (self) |
| def | __nonzero__ (self) |
| def | __bool__ (self) |
| def | sexpr (self) |
| def | as_ast (self) |
| def | get_id (self) |
| def | ctx_ref (self) |
| def | eq (self, other) |
| def | translate (self, target) |
| def | __copy__ (self) |
| def | hash (self) |
Public Member Functions inherited from Z3PPObject | |
| def | use_pp (self) |
Additional Inherited Members | |
Data Fields inherited from AstRef | |
| ast | |
| ctx | |
| def __add__ | ( | self, | |
| other | |||
| ) |
Create the Z3 expression `self + other`.
>>> x = BitVec('x', 32)
>>> y = BitVec('y', 32)
>>> x + y
x + y
>>> (x + y).sort()
BitVec(32)
Definition at line 3476 of file z3py.py.
| def __and__ | ( | self, | |
| other | |||
| ) |
Create the Z3 expression bitwise-and `self & other`.
>>> x = BitVec('x', 32)
>>> y = BitVec('y', 32)
>>> x & y
x & y
>>> (x & y).sort()
BitVec(32)
Definition at line 3568 of file z3py.py.
| def __div__ | ( | self, | |
| other | |||
| ) |
Create the Z3 expression (signed) division `self / other`.
Use the function UDiv() for unsigned division.
>>> x = BitVec('x', 32)
>>> y = BitVec('y', 32)
>>> x / y
x/y
>>> (x / y).sort()
BitVec(32)
>>> (x / y).sexpr()
'(bvsdiv x y)'
>>> UDiv(x, y).sexpr()
'(bvudiv x y)'
Definition at line 3645 of file z3py.py.
| def __ge__ | ( | self, | |
| other | |||
| ) |
Create the Z3 expression (signed) `other >= self`.
Use the function UGE() for unsigned greater than or equal to.
>>> x, y = BitVecs('x y', 32)
>>> x >= y
x >= y
>>> (x >= y).sexpr()
'(bvsge x y)'
>>> UGE(x, y).sexpr()
'(bvuge x y)'
Definition at line 3775 of file z3py.py.
| def __gt__ | ( | self, | |
| other | |||
| ) |
Create the Z3 expression (signed) `other > self`.
Use the function UGT() for unsigned greater than.
>>> x, y = BitVecs('x y', 32)
>>> x > y
x > y
>>> (x > y).sexpr()
'(bvsgt x y)'
>>> UGT(x, y).sexpr()
'(bvugt x y)'
Definition at line 3759 of file z3py.py.
| def __invert__ | ( | self | ) |
Create the Z3 expression bitwise-not `~self`.
>>> x = BitVec('x', 32)
>>> ~x
~x
>>> simplify(~(~x))
x
Definition at line 3634 of file z3py.py.
| def __le__ | ( | self, | |
| other | |||
| ) |
Create the Z3 expression (signed) `other <= self`.
Use the function ULE() for unsigned less than or equal to.
>>> x, y = BitVecs('x y', 32)
>>> x <= y
x <= y
>>> (x <= y).sexpr()
'(bvsle x y)'
>>> ULE(x, y).sexpr()
'(bvule x y)'
Definition at line 3727 of file z3py.py.
| def __lshift__ | ( | self, | |
| other | |||
| ) |
Create the Z3 expression left shift `self << other`
>>> x, y = BitVecs('x y', 32)
>>> x << y
x << y
>>> (x << y).sexpr()
'(bvshl x y)'
>>> simplify(BitVecVal(2, 3) << 1)
4
Definition at line 3821 of file z3py.py.
| def __lt__ | ( | self, | |
| other | |||
| ) |
Create the Z3 expression (signed) `other < self`.
Use the function ULT() for unsigned less than.
>>> x, y = BitVecs('x y', 32)
>>> x < y
x < y
>>> (x < y).sexpr()
'(bvslt x y)'
>>> ULT(x, y).sexpr()
'(bvult x y)'
Definition at line 3743 of file z3py.py.
| def __mod__ | ( | self, | |
| other | |||
| ) |
Create the Z3 expression (signed) mod `self % other`.
Use the function URem() for unsigned remainder, and SRem() for signed remainder.
>>> x = BitVec('x', 32)
>>> y = BitVec('y', 32)
>>> x % y
x%y
>>> (x % y).sort()
BitVec(32)
>>> (x % y).sexpr()
'(bvsmod x y)'
>>> URem(x, y).sexpr()
'(bvurem x y)'
>>> SRem(x, y).sexpr()
'(bvsrem x y)'
Definition at line 3688 of file z3py.py.
| def __mul__ | ( | self, | |
| other | |||
| ) |
Create the Z3 expression `self * other`.
>>> x = BitVec('x', 32)
>>> y = BitVec('y', 32)
>>> x * y
x*y
>>> (x * y).sort()
BitVec(32)
Definition at line 3499 of file z3py.py.
| def __neg__ | ( | self | ) |
Return an expression representing `-self`.
>>> x = BitVec('x', 32)
>>> -x
-x
>>> simplify(-(-x))
x
Definition at line 3623 of file z3py.py.
| def __or__ | ( | self, | |
| other | |||
| ) |
Create the Z3 expression bitwise-or `self | other`.
>>> x = BitVec('x', 32)
>>> y = BitVec('y', 32)
>>> x | y
x | y
>>> (x | y).sort()
BitVec(32)
Definition at line 3545 of file z3py.py.
| def __pos__ | ( | self | ) |
| def __radd__ | ( | self, | |
| other | |||
| ) |
Create the Z3 expression `other + self`.
>>> x = BitVec('x', 32)
>>> 10 + x
10 + x
Definition at line 3489 of file z3py.py.
| def __rand__ | ( | self, | |
| other | |||
| ) |
Create the Z3 expression bitwise-or `other & self`.
>>> x = BitVec('x', 32)
>>> 10 & x
10 & x
Definition at line 3581 of file z3py.py.
| def __rdiv__ | ( | self, | |
| other | |||
| ) |
Create the Z3 expression (signed) division `other / self`.
Use the function UDiv() for unsigned division.
>>> x = BitVec('x', 32)
>>> 10 / x
10/x
>>> (10 / x).sexpr()
'(bvsdiv #x0000000a x)'
>>> UDiv(10, x).sexpr()
'(bvudiv #x0000000a x)'
Definition at line 3668 of file z3py.py.
| def __rlshift__ | ( | self, | |
| other | |||
| ) |
Create the Z3 expression left shift `other << self`.
Use the function LShR() for the right logical shift
>>> x = BitVec('x', 32)
>>> 10 << x
10 << x
>>> (10 << x).sexpr()
'(bvshl #x0000000a x)'
Definition at line 3849 of file z3py.py.
| def __rmod__ | ( | self, | |
| other | |||
| ) |
Create the Z3 expression (signed) mod `other % self`.
Use the function URem() for unsigned remainder, and SRem() for signed remainder.
>>> x = BitVec('x', 32)
>>> 10 % x
10%x
>>> (10 % x).sexpr()
'(bvsmod #x0000000a x)'
>>> URem(10, x).sexpr()
'(bvurem #x0000000a x)'
>>> SRem(10, x).sexpr()
'(bvsrem #x0000000a x)'
Definition at line 3709 of file z3py.py.
| def __rmul__ | ( | self, | |
| other | |||
| ) |
Create the Z3 expression `other * self`.
>>> x = BitVec('x', 32)
>>> 10 * x
10*x
Definition at line 3512 of file z3py.py.
| def __ror__ | ( | self, | |
| other | |||
| ) |
Create the Z3 expression bitwise-or `other | self`.
>>> x = BitVec('x', 32)
>>> 10 | x
10 | x
Definition at line 3558 of file z3py.py.
| def __rrshift__ | ( | self, | |
| other | |||
| ) |
Create the Z3 expression (arithmetical) right shift `other` >> `self`.
Use the function LShR() for the right logical shift
>>> x = BitVec('x', 32)
>>> 10 >> x
10 >> x
>>> (10 >> x).sexpr()
'(bvashr #x0000000a x)'
Definition at line 3835 of file z3py.py.
| def __rshift__ | ( | self, | |
| other | |||
| ) |
Create the Z3 expression (arithmetical) right shift `self >> other`
Use the function LShR() for the right logical shift
>>> x, y = BitVecs('x y', 32)
>>> x >> y
x >> y
>>> (x >> y).sexpr()
'(bvashr x y)'
>>> LShR(x, y).sexpr()
'(bvlshr x y)'
>>> BitVecVal(4, 3)
4
>>> BitVecVal(4, 3).as_signed_long()
-4
>>> simplify(BitVecVal(4, 3) >> 1).as_signed_long()
-2
>>> simplify(BitVecVal(4, 3) >> 1)
6
>>> simplify(LShR(BitVecVal(4, 3), 1))
2
>>> simplify(BitVecVal(2, 3) >> 1)
1
>>> simplify(LShR(BitVecVal(2, 3), 1))
1
Definition at line 3791 of file z3py.py.
| def __rsub__ | ( | self, | |
| other | |||
| ) |
Create the Z3 expression `other - self`.
>>> x = BitVec('x', 32)
>>> 10 - x
10 - x
Definition at line 3535 of file z3py.py.
| def __rtruediv__ | ( | self, | |
| other | |||
| ) |
| def __rxor__ | ( | self, | |
| other | |||
| ) |
Create the Z3 expression bitwise-xor `other ^ self`.
>>> x = BitVec('x', 32)
>>> 10 ^ x
10 ^ x
Definition at line 3604 of file z3py.py.
| def __sub__ | ( | self, | |
| other | |||
| ) |
Create the Z3 expression `self - other`.
>>> x = BitVec('x', 32)
>>> y = BitVec('y', 32)
>>> x - y
x - y
>>> (x - y).sort()
BitVec(32)
Definition at line 3522 of file z3py.py.
| def __truediv__ | ( | self, | |
| other | |||
| ) |
| def __xor__ | ( | self, | |
| other | |||
| ) |
Create the Z3 expression bitwise-xor `self ^ other`.
>>> x = BitVec('x', 32)
>>> y = BitVec('y', 32)
>>> x ^ y
x ^ y
>>> (x ^ y).sort()
BitVec(32)
Definition at line 3591 of file z3py.py.
| def size | ( | self | ) |
Return the number of bits of the bit-vector expression `self`.
>>> x = BitVec('x', 32)
>>> (x + 1).size()
32
>>> Concat(x, x).size()
64
Definition at line 3465 of file z3py.py.
Referenced by BitVecNumRef.as_signed_long().
| def sort | ( | self | ) |
Return the sort of the bit-vector expression `self`.
>>> x = BitVec('x', 32)
>>> x.sort()
BitVec(32)
>>> x.sort() == BitVecSort(32)
True
Definition at line 3454 of file z3py.py.
Referenced by BitVecRef.__add__(), BitVecRef.__and__(), BitVecRef.__div__(), BitVecRef.__mod__(), BitVecRef.__mul__(), BitVecRef.__or__(), BitVecRef.__sub__(), and BitVecRef.__xor__().
1.8.10