|
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) |
|
def | as_ast (self) |
|
def | get_id (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) |
|
def | from_string (self, s) |
|
def | serialize (self) |
|
def | __init__ (self, ast, ctx=None) |
|
def | __del__ (self) |
|
def | __deepcopy__ (self, memo={}) |
|
def | __str__ (self) |
|
def | __repr__ (self) |
|
def | __nonzero__ (self) |
|
def | __bool__ (self) |
|
def | sexpr (self) |
|
def | ctx_ref (self) |
|
def | eq (self, other) |
|
def | translate (self, target) |
|
def | __copy__ (self) |
|
def | hash (self) |
|
def | use_pp (self) |
|
Bit-vector expressions.
Definition at line 3487 of file z3py.py.
◆ __add__()
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 3512 of file z3py.py.
3512 def __add__(self, other):
3513 """Create the Z3 expression `self + other`.
3515 >>> x = BitVec('x', 32)
3516 >>> y = BitVec('y', 32)
3522 a, b = _coerce_exprs(self, other)
3523 return BitVecRef(
Z3_mk_bvadd(self.ctx_ref(), a.as_ast(), b.as_ast()), self.ctx)
Z3_ast Z3_API Z3_mk_bvadd(Z3_context c, Z3_ast t1, Z3_ast t2)
Standard two's complement addition.
◆ __and__()
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 3604 of file z3py.py.
3604 def __and__(self, other):
3605 """Create the Z3 expression bitwise-and `self & other`.
3607 >>> x = BitVec('x', 32)
3608 >>> y = BitVec('y', 32)
3614 a, b = _coerce_exprs(self, other)
3615 return BitVecRef(
Z3_mk_bvand(self.ctx_ref(), a.as_ast(), b.as_ast()), self.ctx)
Z3_ast Z3_API Z3_mk_bvand(Z3_context c, Z3_ast t1, Z3_ast t2)
Bitwise and.
◆ __div__()
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 3681 of file z3py.py.
3681 def __div__(self, other):
3682 """Create the Z3 expression (signed) division `self / other`.
3684 Use the function UDiv() for unsigned division.
3686 >>> x = BitVec('x', 32)
3687 >>> y = BitVec('y', 32)
3694 >>> UDiv(x, y).sexpr()
3697 a, b = _coerce_exprs(self, other)
3698 return BitVecRef(
Z3_mk_bvsdiv(self.ctx_ref(), a.as_ast(), b.as_ast()), self.ctx)
Z3_ast Z3_API Z3_mk_bvsdiv(Z3_context c, Z3_ast t1, Z3_ast t2)
Two's complement signed division.
Referenced by ArithRef.__truediv__(), BitVecRef.__truediv__(), and FPRef.__truediv__().
◆ __ge__()
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 3811 of file z3py.py.
3811 def __ge__(self, other):
3812 """Create the Z3 expression (signed) `other >= self`.
3814 Use the function UGE() for unsigned greater than or equal to.
3816 >>> x, y = BitVecs('x y', 32)
3819 >>> (x >= y).sexpr()
3821 >>> UGE(x, y).sexpr()
3824 a, b = _coerce_exprs(self, other)
3825 return BoolRef(
Z3_mk_bvsge(self.ctx_ref(), a.as_ast(), b.as_ast()), self.ctx)
Z3_ast Z3_API Z3_mk_bvsge(Z3_context c, Z3_ast t1, Z3_ast t2)
Two's complement signed greater than or equal to.
◆ __gt__()
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 3795 of file z3py.py.
3795 def __gt__(self, other):
3796 """Create the Z3 expression (signed) `other > self`.
3798 Use the function UGT() for unsigned greater than.
3800 >>> x, y = BitVecs('x y', 32)
3805 >>> UGT(x, y).sexpr()
3808 a, b = _coerce_exprs(self, other)
3809 return BoolRef(
Z3_mk_bvsgt(self.ctx_ref(), a.as_ast(), b.as_ast()), self.ctx)
Z3_ast Z3_API Z3_mk_bvsgt(Z3_context c, Z3_ast t1, Z3_ast t2)
Two's complement signed greater than.
◆ __invert__()
Create the Z3 expression bitwise-not `~self`.
>>> x = BitVec('x', 32)
>>> ~x
~x
>>> simplify(~(~x))
x
Definition at line 3670 of file z3py.py.
3670 def __invert__(self):
3671 """Create the Z3 expression bitwise-not `~self`.
3673 >>> x = BitVec('x', 32)
3679 return BitVecRef(
Z3_mk_bvnot(self.ctx_ref(), self.as_ast()), self.ctx)
Z3_ast Z3_API Z3_mk_bvnot(Z3_context c, Z3_ast t1)
Bitwise negation.
◆ __le__()
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 3763 of file z3py.py.
3763 def __le__(self, other):
3764 """Create the Z3 expression (signed) `other <= self`.
3766 Use the function ULE() for unsigned less than or equal to.
3768 >>> x, y = BitVecs('x y', 32)
3771 >>> (x <= y).sexpr()
3773 >>> ULE(x, y).sexpr()
3776 a, b = _coerce_exprs(self, other)
3777 return BoolRef(
Z3_mk_bvsle(self.ctx_ref(), a.as_ast(), b.as_ast()), self.ctx)
Z3_ast Z3_API Z3_mk_bvsle(Z3_context c, Z3_ast t1, Z3_ast t2)
Two's complement signed less than or equal to.
◆ __lshift__()
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 3857 of file z3py.py.
3857 def __lshift__(self, other):
3858 """Create the Z3 expression left shift `self << other`
3860 >>> x, y = BitVecs('x y', 32)
3863 >>> (x << y).sexpr()
3865 >>> simplify(BitVecVal(2, 3) << 1)
3868 a, b = _coerce_exprs(self, other)
3869 return BitVecRef(
Z3_mk_bvshl(self.ctx_ref(), a.as_ast(), b.as_ast()), self.ctx)
Z3_ast Z3_API Z3_mk_bvshl(Z3_context c, Z3_ast t1, Z3_ast t2)
Shift left.
◆ __lt__()
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 3779 of file z3py.py.
3779 def __lt__(self, other):
3780 """Create the Z3 expression (signed) `other < self`.
3782 Use the function ULT() for unsigned less than.
3784 >>> x, y = BitVecs('x y', 32)
3789 >>> ULT(x, y).sexpr()
3792 a, b = _coerce_exprs(self, other)
3793 return BoolRef(
Z3_mk_bvslt(self.ctx_ref(), a.as_ast(), b.as_ast()), self.ctx)
Z3_ast Z3_API Z3_mk_bvslt(Z3_context c, Z3_ast t1, Z3_ast t2)
Two's complement signed less than.
◆ __mod__()
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 3724 of file z3py.py.
3724 def __mod__(self, other):
3725 """Create the Z3 expression (signed) mod `self % other`.
3727 Use the function URem() for unsigned remainder, and SRem() for signed remainder.
3729 >>> x = BitVec('x', 32)
3730 >>> y = BitVec('y', 32)
3737 >>> URem(x, y).sexpr()
3739 >>> SRem(x, y).sexpr()
3742 a, b = _coerce_exprs(self, other)
3743 return BitVecRef(
Z3_mk_bvsmod(self.ctx_ref(), a.as_ast(), b.as_ast()), self.ctx)
Z3_ast Z3_API Z3_mk_bvsmod(Z3_context c, Z3_ast t1, Z3_ast t2)
Two's complement signed remainder (sign follows divisor).
◆ __mul__()
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 3535 of file z3py.py.
3535 def __mul__(self, other):
3536 """Create the Z3 expression `self * other`.
3538 >>> x = BitVec('x', 32)
3539 >>> y = BitVec('y', 32)
3545 a, b = _coerce_exprs(self, other)
3546 return BitVecRef(
Z3_mk_bvmul(self.ctx_ref(), a.as_ast(), b.as_ast()), self.ctx)
Z3_ast Z3_API Z3_mk_bvmul(Z3_context c, Z3_ast t1, Z3_ast t2)
Standard two's complement multiplication.
◆ __neg__()
Return an expression representing `-self`.
>>> x = BitVec('x', 32)
>>> -x
-x
>>> simplify(-(-x))
x
Definition at line 3659 of file z3py.py.
3660 """Return an expression representing `-self`.
3662 >>> x = BitVec('x', 32)
3668 return BitVecRef(
Z3_mk_bvneg(self.ctx_ref(), self.as_ast()), self.ctx)
Z3_ast Z3_API Z3_mk_bvneg(Z3_context c, Z3_ast t1)
Standard two's complement unary minus.
◆ __or__()
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 3581 of file z3py.py.
3581 def __or__(self, other):
3582 """Create the Z3 expression bitwise-or `self | other`.
3584 >>> x = BitVec('x', 32)
3585 >>> y = BitVec('y', 32)
3591 a, b = _coerce_exprs(self, other)
3592 return BitVecRef(
Z3_mk_bvor(self.ctx_ref(), a.as_ast(), b.as_ast()), self.ctx)
Z3_ast Z3_API Z3_mk_bvor(Z3_context c, Z3_ast t1, Z3_ast t2)
Bitwise or.
◆ __pos__()
Return `self`.
>>> x = BitVec('x', 32)
>>> +x
x
Definition at line 3650 of file z3py.py.
3653 >>> x = BitVec('x', 32)
◆ __radd__()
def __radd__ |
( |
|
self, |
|
|
|
other |
|
) |
| |
Create the Z3 expression `other + self`.
>>> x = BitVec('x', 32)
>>> 10 + x
10 + x
Definition at line 3525 of file z3py.py.
3525 def __radd__(self, other):
3526 """Create the Z3 expression `other + self`.
3528 >>> x = BitVec('x', 32)
3532 a, b = _coerce_exprs(self, other)
3533 return BitVecRef(
Z3_mk_bvadd(self.ctx_ref(), b.as_ast(), a.as_ast()), self.ctx)
◆ __rand__()
def __rand__ |
( |
|
self, |
|
|
|
other |
|
) |
| |
Create the Z3 expression bitwise-or `other & self`.
>>> x = BitVec('x', 32)
>>> 10 & x
10 & x
Definition at line 3617 of file z3py.py.
3617 def __rand__(self, other):
3618 """Create the Z3 expression bitwise-or `other & self`.
3620 >>> x = BitVec('x', 32)
3624 a, b = _coerce_exprs(self, other)
3625 return BitVecRef(
Z3_mk_bvand(self.ctx_ref(), b.as_ast(), a.as_ast()), self.ctx)
◆ __rdiv__()
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 3704 of file z3py.py.
3704 def __rdiv__(self, other):
3705 """Create the Z3 expression (signed) division `other / self`.
3707 Use the function UDiv() for unsigned division.
3709 >>> x = BitVec('x', 32)
3712 >>> (10 / x).sexpr()
3713 '(bvsdiv #x0000000a x)'
3714 >>> UDiv(10, x).sexpr()
3715 '(bvudiv #x0000000a x)'
3717 a, b = _coerce_exprs(self, other)
3718 return BitVecRef(
Z3_mk_bvsdiv(self.ctx_ref(), b.as_ast(), a.as_ast()), self.ctx)
Referenced by ArithRef.__rtruediv__(), BitVecRef.__rtruediv__(), and FPRef.__rtruediv__().
◆ __rlshift__()
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 3885 of file z3py.py.
3885 def __rlshift__(self, other):
3886 """Create the Z3 expression left shift `other << self`.
3888 Use the function LShR() for the right logical shift
3890 >>> x = BitVec('x', 32)
3893 >>> (10 << x).sexpr()
3894 '(bvshl #x0000000a x)'
3896 a, b = _coerce_exprs(self, other)
3897 return BitVecRef(
Z3_mk_bvshl(self.ctx_ref(), b.as_ast(), a.as_ast()), self.ctx)
◆ __rmod__()
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 3745 of file z3py.py.
3745 def __rmod__(self, other):
3746 """Create the Z3 expression (signed) mod `other % self`.
3748 Use the function URem() for unsigned remainder, and SRem() for signed remainder.
3750 >>> x = BitVec('x', 32)
3753 >>> (10 % x).sexpr()
3754 '(bvsmod #x0000000a x)'
3755 >>> URem(10, x).sexpr()
3756 '(bvurem #x0000000a x)'
3757 >>> SRem(10, x).sexpr()
3758 '(bvsrem #x0000000a x)'
3760 a, b = _coerce_exprs(self, other)
3761 return BitVecRef(
Z3_mk_bvsmod(self.ctx_ref(), b.as_ast(), a.as_ast()), self.ctx)
◆ __rmul__()
def __rmul__ |
( |
|
self, |
|
|
|
other |
|
) |
| |
Create the Z3 expression `other * self`.
>>> x = BitVec('x', 32)
>>> 10 * x
10*x
Definition at line 3548 of file z3py.py.
3548 def __rmul__(self, other):
3549 """Create the Z3 expression `other * self`.
3551 >>> x = BitVec('x', 32)
3555 a, b = _coerce_exprs(self, other)
3556 return BitVecRef(
Z3_mk_bvmul(self.ctx_ref(), b.as_ast(), a.as_ast()), self.ctx)
◆ __ror__()
def __ror__ |
( |
|
self, |
|
|
|
other |
|
) |
| |
Create the Z3 expression bitwise-or `other | self`.
>>> x = BitVec('x', 32)
>>> 10 | x
10 | x
Definition at line 3594 of file z3py.py.
3594 def __ror__(self, other):
3595 """Create the Z3 expression bitwise-or `other | self`.
3597 >>> x = BitVec('x', 32)
3601 a, b = _coerce_exprs(self, other)
3602 return BitVecRef(
Z3_mk_bvor(self.ctx_ref(), b.as_ast(), a.as_ast()), self.ctx)
◆ __rrshift__()
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 3871 of file z3py.py.
3871 def __rrshift__(self, other):
3872 """Create the Z3 expression (arithmetical) right shift `other` >> `self`.
3874 Use the function LShR() for the right logical shift
3876 >>> x = BitVec('x', 32)
3879 >>> (10 >> x).sexpr()
3880 '(bvashr #x0000000a x)'
3882 a, b = _coerce_exprs(self, other)
3883 return BitVecRef(
Z3_mk_bvashr(self.ctx_ref(), b.as_ast(), a.as_ast()), self.ctx)
Z3_ast Z3_API Z3_mk_bvashr(Z3_context c, Z3_ast t1, Z3_ast t2)
Arithmetic shift right.
◆ __rshift__()
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 3827 of file z3py.py.
3827 def __rshift__(self, other):
3828 """Create the Z3 expression (arithmetical) right shift `self >> other`
3830 Use the function LShR() for the right logical shift
3832 >>> x, y = BitVecs('x y', 32)
3835 >>> (x >> y).sexpr()
3837 >>> LShR(x, y).sexpr()
3841 >>> BitVecVal(4, 3).as_signed_long()
3843 >>> simplify(BitVecVal(4, 3) >> 1).as_signed_long()
3845 >>> simplify(BitVecVal(4, 3) >> 1)
3847 >>> simplify(LShR(BitVecVal(4, 3), 1))
3849 >>> simplify(BitVecVal(2, 3) >> 1)
3851 >>> simplify(LShR(BitVecVal(2, 3), 1))
3854 a, b = _coerce_exprs(self, other)
3855 return BitVecRef(
Z3_mk_bvashr(self.ctx_ref(), a.as_ast(), b.as_ast()), self.ctx)
◆ __rsub__()
def __rsub__ |
( |
|
self, |
|
|
|
other |
|
) |
| |
Create the Z3 expression `other - self`.
>>> x = BitVec('x', 32)
>>> 10 - x
10 - x
Definition at line 3571 of file z3py.py.
3571 def __rsub__(self, other):
3572 """Create the Z3 expression `other - self`.
3574 >>> x = BitVec('x', 32)
3578 a, b = _coerce_exprs(self, other)
3579 return BitVecRef(
Z3_mk_bvsub(self.ctx_ref(), b.as_ast(), a.as_ast()), self.ctx)
Z3_ast Z3_API Z3_mk_bvsub(Z3_context c, Z3_ast t1, Z3_ast t2)
Standard two's complement subtraction.
◆ __rtruediv__()
def __rtruediv__ |
( |
|
self, |
|
|
|
other |
|
) |
| |
Create the Z3 expression (signed) division `other / self`.
Definition at line 3720 of file z3py.py.
3720 def __rtruediv__(self, other):
3721 """Create the Z3 expression (signed) division `other / self`."""
3722 return self.__rdiv__(other)
◆ __rxor__()
def __rxor__ |
( |
|
self, |
|
|
|
other |
|
) |
| |
Create the Z3 expression bitwise-xor `other ^ self`.
>>> x = BitVec('x', 32)
>>> 10 ^ x
10 ^ x
Definition at line 3640 of file z3py.py.
3640 def __rxor__(self, other):
3641 """Create the Z3 expression bitwise-xor `other ^ self`.
3643 >>> x = BitVec('x', 32)
3647 a, b = _coerce_exprs(self, other)
3648 return BitVecRef(
Z3_mk_bvxor(self.ctx_ref(), b.as_ast(), a.as_ast()), self.ctx)
Z3_ast Z3_API Z3_mk_bvxor(Z3_context c, Z3_ast t1, Z3_ast t2)
Bitwise exclusive-or.
◆ __sub__()
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 3558 of file z3py.py.
3558 def __sub__(self, other):
3559 """Create the Z3 expression `self - other`.
3561 >>> x = BitVec('x', 32)
3562 >>> y = BitVec('y', 32)
3568 a, b = _coerce_exprs(self, other)
3569 return BitVecRef(
Z3_mk_bvsub(self.ctx_ref(), a.as_ast(), b.as_ast()), self.ctx)
◆ __truediv__()
def __truediv__ |
( |
|
self, |
|
|
|
other |
|
) |
| |
Create the Z3 expression (signed) division `self / other`.
Definition at line 3700 of file z3py.py.
3700 def __truediv__(self, other):
3701 """Create the Z3 expression (signed) division `self / other`."""
3702 return self.__div__(other)
◆ __xor__()
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 3627 of file z3py.py.
3627 def __xor__(self, other):
3628 """Create the Z3 expression bitwise-xor `self ^ other`.
3630 >>> x = BitVec('x', 32)
3631 >>> y = BitVec('y', 32)
3637 a, b = _coerce_exprs(self, other)
3638 return BitVecRef(
Z3_mk_bvxor(self.ctx_ref(), a.as_ast(), b.as_ast()), self.ctx)
◆ size()
◆ sort()
Return the sort of the bit-vector expression `self`.
>>> x = BitVec('x', 32)
>>> x.sort()
BitVec(32)
>>> x.sort() == BitVecSort(32)
True
Reimplemented from ExprRef.
Definition at line 3490 of file z3py.py.
3491 """Return the sort of the bit-vector expression `self`.
3493 >>> x = BitVec('x', 32)
3496 >>> x.sort() == BitVecSort(32)
3499 return BitVecSortRef(
Z3_get_sort(self.ctx_ref(), self.as_ast()), self.ctx)
Z3_sort Z3_API Z3_get_sort(Z3_context c, Z3_ast a)
Return the sort of an AST node.
Referenced by FPNumRef.as_string(), ArrayRef.domain(), ArrayRef.domain_n(), FPRef.ebits(), ArithRef.is_int(), ArithRef.is_real(), ArrayRef.range(), FPRef.sbits(), BitVecRef.size(), and ExprRef.sort_kind().