|
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 | __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 3449 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 3474 of file z3py.py.
3474 def __add__(self, other):
3475 """Create the Z3 expression `self + other`.
3477 >>> x = BitVec('x', 32)
3478 >>> y = BitVec('y', 32)
3484 a, b = _coerce_exprs(self, other)
3485 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 3566 of file z3py.py.
3566 def __and__(self, other):
3567 """Create the Z3 expression bitwise-and `self & other`.
3569 >>> x = BitVec('x', 32)
3570 >>> y = BitVec('y', 32)
3576 a, b = _coerce_exprs(self, other)
3577 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 3643 of file z3py.py.
3643 def __div__(self, other):
3644 """Create the Z3 expression (signed) division `self / other`.
3646 Use the function UDiv() for unsigned division.
3648 >>> x = BitVec('x', 32)
3649 >>> y = BitVec('y', 32)
3656 >>> UDiv(x, y).sexpr()
3659 a, b = _coerce_exprs(self, other)
3660 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 3773 of file z3py.py.
3773 def __ge__(self, other):
3774 """Create the Z3 expression (signed) `other >= self`.
3776 Use the function UGE() for unsigned greater than or equal to.
3778 >>> x, y = BitVecs('x y', 32)
3781 >>> (x >= y).sexpr()
3783 >>> UGE(x, y).sexpr()
3786 a, b = _coerce_exprs(self, other)
3787 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 3757 of file z3py.py.
3757 def __gt__(self, other):
3758 """Create the Z3 expression (signed) `other > self`.
3760 Use the function UGT() for unsigned greater than.
3762 >>> x, y = BitVecs('x y', 32)
3767 >>> UGT(x, y).sexpr()
3770 a, b = _coerce_exprs(self, other)
3771 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 3632 of file z3py.py.
3632 def __invert__(self):
3633 """Create the Z3 expression bitwise-not `~self`.
3635 >>> x = BitVec('x', 32)
3641 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 3725 of file z3py.py.
3725 def __le__(self, other):
3726 """Create the Z3 expression (signed) `other <= self`.
3728 Use the function ULE() for unsigned less than or equal to.
3730 >>> x, y = BitVecs('x y', 32)
3733 >>> (x <= y).sexpr()
3735 >>> ULE(x, y).sexpr()
3738 a, b = _coerce_exprs(self, other)
3739 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 3819 of file z3py.py.
3819 def __lshift__(self, other):
3820 """Create the Z3 expression left shift `self << other`
3822 >>> x, y = BitVecs('x y', 32)
3825 >>> (x << y).sexpr()
3827 >>> simplify(BitVecVal(2, 3) << 1)
3830 a, b = _coerce_exprs(self, other)
3831 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 3741 of file z3py.py.
3741 def __lt__(self, other):
3742 """Create the Z3 expression (signed) `other < self`.
3744 Use the function ULT() for unsigned less than.
3746 >>> x, y = BitVecs('x y', 32)
3751 >>> ULT(x, y).sexpr()
3754 a, b = _coerce_exprs(self, other)
3755 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 3686 of file z3py.py.
3686 def __mod__(self, other):
3687 """Create the Z3 expression (signed) mod `self % other`.
3689 Use the function URem() for unsigned remainder, and SRem() for signed remainder.
3691 >>> x = BitVec('x', 32)
3692 >>> y = BitVec('y', 32)
3699 >>> URem(x, y).sexpr()
3701 >>> SRem(x, y).sexpr()
3704 a, b = _coerce_exprs(self, other)
3705 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 3497 of file z3py.py.
3497 def __mul__(self, other):
3498 """Create the Z3 expression `self * other`.
3500 >>> x = BitVec('x', 32)
3501 >>> y = BitVec('y', 32)
3507 a, b = _coerce_exprs(self, other)
3508 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 3621 of file z3py.py.
3622 """Return an expression representing `-self`.
3624 >>> x = BitVec('x', 32)
3630 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 3543 of file z3py.py.
3543 def __or__(self, other):
3544 """Create the Z3 expression bitwise-or `self | other`.
3546 >>> x = BitVec('x', 32)
3547 >>> y = BitVec('y', 32)
3553 a, b = _coerce_exprs(self, other)
3554 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 3612 of file z3py.py.
3615 >>> 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 3487 of file z3py.py.
3487 def __radd__(self, other):
3488 """Create the Z3 expression `other + self`.
3490 >>> x = BitVec('x', 32)
3494 a, b = _coerce_exprs(self, other)
3495 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 3579 of file z3py.py.
3579 def __rand__(self, other):
3580 """Create the Z3 expression bitwise-or `other & self`.
3582 >>> x = BitVec('x', 32)
3586 a, b = _coerce_exprs(self, other)
3587 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 3666 of file z3py.py.
3666 def __rdiv__(self, other):
3667 """Create the Z3 expression (signed) division `other / self`.
3669 Use the function UDiv() for unsigned division.
3671 >>> x = BitVec('x', 32)
3674 >>> (10 / x).sexpr()
3675 '(bvsdiv #x0000000a x)'
3676 >>> UDiv(10, x).sexpr()
3677 '(bvudiv #x0000000a x)'
3679 a, b = _coerce_exprs(self, other)
3680 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 3847 of file z3py.py.
3847 def __rlshift__(self, other):
3848 """Create the Z3 expression left shift `other << self`.
3850 Use the function LShR() for the right logical shift
3852 >>> x = BitVec('x', 32)
3855 >>> (10 << x).sexpr()
3856 '(bvshl #x0000000a x)'
3858 a, b = _coerce_exprs(self, other)
3859 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 3707 of file z3py.py.
3707 def __rmod__(self, other):
3708 """Create the Z3 expression (signed) mod `other % self`.
3710 Use the function URem() for unsigned remainder, and SRem() for signed remainder.
3712 >>> x = BitVec('x', 32)
3715 >>> (10 % x).sexpr()
3716 '(bvsmod #x0000000a x)'
3717 >>> URem(10, x).sexpr()
3718 '(bvurem #x0000000a x)'
3719 >>> SRem(10, x).sexpr()
3720 '(bvsrem #x0000000a x)'
3722 a, b = _coerce_exprs(self, other)
3723 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 3510 of file z3py.py.
3510 def __rmul__(self, other):
3511 """Create the Z3 expression `other * self`.
3513 >>> x = BitVec('x', 32)
3517 a, b = _coerce_exprs(self, other)
3518 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 3556 of file z3py.py.
3556 def __ror__(self, other):
3557 """Create the Z3 expression bitwise-or `other | self`.
3559 >>> x = BitVec('x', 32)
3563 a, b = _coerce_exprs(self, other)
3564 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 3833 of file z3py.py.
3833 def __rrshift__(self, other):
3834 """Create the Z3 expression (arithmetical) right shift `other` >> `self`.
3836 Use the function LShR() for the right logical shift
3838 >>> x = BitVec('x', 32)
3841 >>> (10 >> x).sexpr()
3842 '(bvashr #x0000000a x)'
3844 a, b = _coerce_exprs(self, other)
3845 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 3789 of file z3py.py.
3789 def __rshift__(self, other):
3790 """Create the Z3 expression (arithmetical) right shift `self >> other`
3792 Use the function LShR() for the right logical shift
3794 >>> x, y = BitVecs('x y', 32)
3797 >>> (x >> y).sexpr()
3799 >>> LShR(x, y).sexpr()
3803 >>> BitVecVal(4, 3).as_signed_long()
3805 >>> simplify(BitVecVal(4, 3) >> 1).as_signed_long()
3807 >>> simplify(BitVecVal(4, 3) >> 1)
3809 >>> simplify(LShR(BitVecVal(4, 3), 1))
3811 >>> simplify(BitVecVal(2, 3) >> 1)
3813 >>> simplify(LShR(BitVecVal(2, 3), 1))
3816 a, b = _coerce_exprs(self, other)
3817 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 3533 of file z3py.py.
3533 def __rsub__(self, other):
3534 """Create the Z3 expression `other - self`.
3536 >>> x = BitVec('x', 32)
3540 a, b = _coerce_exprs(self, other)
3541 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 3682 of file z3py.py.
3682 def __rtruediv__(self, other):
3683 """Create the Z3 expression (signed) division `other / self`."""
3684 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 3602 of file z3py.py.
3602 def __rxor__(self, other):
3603 """Create the Z3 expression bitwise-xor `other ^ self`.
3605 >>> x = BitVec('x', 32)
3609 a, b = _coerce_exprs(self, other)
3610 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 3520 of file z3py.py.
3520 def __sub__(self, other):
3521 """Create the Z3 expression `self - other`.
3523 >>> x = BitVec('x', 32)
3524 >>> y = BitVec('y', 32)
3530 a, b = _coerce_exprs(self, other)
3531 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 3662 of file z3py.py.
3662 def __truediv__(self, other):
3663 """Create the Z3 expression (signed) division `self / other`."""
3664 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 3589 of file z3py.py.
3589 def __xor__(self, other):
3590 """Create the Z3 expression bitwise-xor `self ^ other`.
3592 >>> x = BitVec('x', 32)
3593 >>> y = BitVec('y', 32)
3599 a, b = _coerce_exprs(self, other)
3600 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 3452 of file z3py.py.
3453 """Return the sort of the bit-vector expression `self`.
3455 >>> x = BitVec('x', 32)
3458 >>> x.sort() == BitVecSort(32)
3461 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 QuantifierRef.__getitem__(), FPNumRef.as_string(), ArrayRef.domain(), FPRef.ebits(), ArithRef.is_int(), ArithRef.is_real(), ArrayRef.range(), FPRef.sbits(), BitVecRef.size(), and ExprRef.sort_kind().