|
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 3447 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 3472 of file z3py.py.
3472 def __add__(self, other):
3473 """Create the Z3 expression `self + other`.
3475 >>> x = BitVec('x', 32)
3476 >>> y = BitVec('y', 32)
3482 a, b = _coerce_exprs(self, other)
3483 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 3564 of file z3py.py.
3564 def __and__(self, other):
3565 """Create the Z3 expression bitwise-and `self & other`.
3567 >>> x = BitVec('x', 32)
3568 >>> y = BitVec('y', 32)
3574 a, b = _coerce_exprs(self, other)
3575 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 3641 of file z3py.py.
3641 def __div__(self, other):
3642 """Create the Z3 expression (signed) division `self / other`.
3644 Use the function UDiv() for unsigned division.
3646 >>> x = BitVec('x', 32)
3647 >>> y = BitVec('y', 32)
3654 >>> UDiv(x, y).sexpr()
3657 a, b = _coerce_exprs(self, other)
3658 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 3771 of file z3py.py.
3771 def __ge__(self, other):
3772 """Create the Z3 expression (signed) `other >= self`.
3774 Use the function UGE() for unsigned greater than or equal to.
3776 >>> x, y = BitVecs('x y', 32)
3779 >>> (x >= y).sexpr()
3781 >>> UGE(x, y).sexpr()
3784 a, b = _coerce_exprs(self, other)
3785 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 3755 of file z3py.py.
3755 def __gt__(self, other):
3756 """Create the Z3 expression (signed) `other > self`.
3758 Use the function UGT() for unsigned greater than.
3760 >>> x, y = BitVecs('x y', 32)
3765 >>> UGT(x, y).sexpr()
3768 a, b = _coerce_exprs(self, other)
3769 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 3630 of file z3py.py.
3630 def __invert__(self):
3631 """Create the Z3 expression bitwise-not `~self`.
3633 >>> x = BitVec('x', 32)
3639 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 3723 of file z3py.py.
3723 def __le__(self, other):
3724 """Create the Z3 expression (signed) `other <= self`.
3726 Use the function ULE() for unsigned less than or equal to.
3728 >>> x, y = BitVecs('x y', 32)
3731 >>> (x <= y).sexpr()
3733 >>> ULE(x, y).sexpr()
3736 a, b = _coerce_exprs(self, other)
3737 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 3817 of file z3py.py.
3817 def __lshift__(self, other):
3818 """Create the Z3 expression left shift `self << other`
3820 >>> x, y = BitVecs('x y', 32)
3823 >>> (x << y).sexpr()
3825 >>> simplify(BitVecVal(2, 3) << 1)
3828 a, b = _coerce_exprs(self, other)
3829 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 3739 of file z3py.py.
3739 def __lt__(self, other):
3740 """Create the Z3 expression (signed) `other < self`.
3742 Use the function ULT() for unsigned less than.
3744 >>> x, y = BitVecs('x y', 32)
3749 >>> ULT(x, y).sexpr()
3752 a, b = _coerce_exprs(self, other)
3753 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 3684 of file z3py.py.
3684 def __mod__(self, other):
3685 """Create the Z3 expression (signed) mod `self % other`.
3687 Use the function URem() for unsigned remainder, and SRem() for signed remainder.
3689 >>> x = BitVec('x', 32)
3690 >>> y = BitVec('y', 32)
3697 >>> URem(x, y).sexpr()
3699 >>> SRem(x, y).sexpr()
3702 a, b = _coerce_exprs(self, other)
3703 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 3495 of file z3py.py.
3495 def __mul__(self, other):
3496 """Create the Z3 expression `self * other`.
3498 >>> x = BitVec('x', 32)
3499 >>> y = BitVec('y', 32)
3505 a, b = _coerce_exprs(self, other)
3506 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 3619 of file z3py.py.
3620 """Return an expression representing `-self`.
3622 >>> x = BitVec('x', 32)
3628 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 3541 of file z3py.py.
3541 def __or__(self, other):
3542 """Create the Z3 expression bitwise-or `self | other`.
3544 >>> x = BitVec('x', 32)
3545 >>> y = BitVec('y', 32)
3551 a, b = _coerce_exprs(self, other)
3552 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 3610 of file z3py.py.
3613 >>> 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 3485 of file z3py.py.
3485 def __radd__(self, other):
3486 """Create the Z3 expression `other + self`.
3488 >>> x = BitVec('x', 32)
3492 a, b = _coerce_exprs(self, other)
3493 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 3577 of file z3py.py.
3577 def __rand__(self, other):
3578 """Create the Z3 expression bitwise-or `other & self`.
3580 >>> x = BitVec('x', 32)
3584 a, b = _coerce_exprs(self, other)
3585 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 3664 of file z3py.py.
3664 def __rdiv__(self, other):
3665 """Create the Z3 expression (signed) division `other / self`.
3667 Use the function UDiv() for unsigned division.
3669 >>> x = BitVec('x', 32)
3672 >>> (10 / x).sexpr()
3673 '(bvsdiv #x0000000a x)'
3674 >>> UDiv(10, x).sexpr()
3675 '(bvudiv #x0000000a x)'
3677 a, b = _coerce_exprs(self, other)
3678 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 3845 of file z3py.py.
3845 def __rlshift__(self, other):
3846 """Create the Z3 expression left shift `other << self`.
3848 Use the function LShR() for the right logical shift
3850 >>> x = BitVec('x', 32)
3853 >>> (10 << x).sexpr()
3854 '(bvshl #x0000000a x)'
3856 a, b = _coerce_exprs(self, other)
3857 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 3705 of file z3py.py.
3705 def __rmod__(self, other):
3706 """Create the Z3 expression (signed) mod `other % self`.
3708 Use the function URem() for unsigned remainder, and SRem() for signed remainder.
3710 >>> x = BitVec('x', 32)
3713 >>> (10 % x).sexpr()
3714 '(bvsmod #x0000000a x)'
3715 >>> URem(10, x).sexpr()
3716 '(bvurem #x0000000a x)'
3717 >>> SRem(10, x).sexpr()
3718 '(bvsrem #x0000000a x)'
3720 a, b = _coerce_exprs(self, other)
3721 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 3508 of file z3py.py.
3508 def __rmul__(self, other):
3509 """Create the Z3 expression `other * self`.
3511 >>> x = BitVec('x', 32)
3515 a, b = _coerce_exprs(self, other)
3516 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 3554 of file z3py.py.
3554 def __ror__(self, other):
3555 """Create the Z3 expression bitwise-or `other | self`.
3557 >>> x = BitVec('x', 32)
3561 a, b = _coerce_exprs(self, other)
3562 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 3831 of file z3py.py.
3831 def __rrshift__(self, other):
3832 """Create the Z3 expression (arithmetical) right shift `other` >> `self`.
3834 Use the function LShR() for the right logical shift
3836 >>> x = BitVec('x', 32)
3839 >>> (10 >> x).sexpr()
3840 '(bvashr #x0000000a x)'
3842 a, b = _coerce_exprs(self, other)
3843 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 3787 of file z3py.py.
3787 def __rshift__(self, other):
3788 """Create the Z3 expression (arithmetical) right shift `self >> other`
3790 Use the function LShR() for the right logical shift
3792 >>> x, y = BitVecs('x y', 32)
3795 >>> (x >> y).sexpr()
3797 >>> LShR(x, y).sexpr()
3801 >>> BitVecVal(4, 3).as_signed_long()
3803 >>> simplify(BitVecVal(4, 3) >> 1).as_signed_long()
3805 >>> simplify(BitVecVal(4, 3) >> 1)
3807 >>> simplify(LShR(BitVecVal(4, 3), 1))
3809 >>> simplify(BitVecVal(2, 3) >> 1)
3811 >>> simplify(LShR(BitVecVal(2, 3), 1))
3814 a, b = _coerce_exprs(self, other)
3815 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 3531 of file z3py.py.
3531 def __rsub__(self, other):
3532 """Create the Z3 expression `other - self`.
3534 >>> x = BitVec('x', 32)
3538 a, b = _coerce_exprs(self, other)
3539 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 3680 of file z3py.py.
3680 def __rtruediv__(self, other):
3681 """Create the Z3 expression (signed) division `other / self`."""
3682 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 3600 of file z3py.py.
3600 def __rxor__(self, other):
3601 """Create the Z3 expression bitwise-xor `other ^ self`.
3603 >>> x = BitVec('x', 32)
3607 a, b = _coerce_exprs(self, other)
3608 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 3518 of file z3py.py.
3518 def __sub__(self, other):
3519 """Create the Z3 expression `self - other`.
3521 >>> x = BitVec('x', 32)
3522 >>> y = BitVec('y', 32)
3528 a, b = _coerce_exprs(self, other)
3529 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 3660 of file z3py.py.
3660 def __truediv__(self, other):
3661 """Create the Z3 expression (signed) division `self / other`."""
3662 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 3587 of file z3py.py.
3587 def __xor__(self, other):
3588 """Create the Z3 expression bitwise-xor `self ^ other`.
3590 >>> x = BitVec('x', 32)
3591 >>> y = BitVec('y', 32)
3597 a, b = _coerce_exprs(self, other)
3598 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 3450 of file z3py.py.
3451 """Return the sort of the bit-vector expression `self`.
3453 >>> x = BitVec('x', 32)
3456 >>> x.sort() == BitVecSort(32)
3459 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().