|
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 3451 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 3476 of file z3py.py.
3476 def __add__(self, other):
3477 """Create the Z3 expression `self + other`.
3479 >>> x = BitVec('x', 32)
3480 >>> y = BitVec('y', 32)
3486 a, b = _coerce_exprs(self, other)
3487 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 3568 of file z3py.py.
3568 def __and__(self, other):
3569 """Create the Z3 expression bitwise-and `self & other`.
3571 >>> x = BitVec('x', 32)
3572 >>> y = BitVec('y', 32)
3578 a, b = _coerce_exprs(self, other)
3579 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 3645 of file z3py.py.
3645 def __div__(self, other):
3646 """Create the Z3 expression (signed) division `self / other`.
3648 Use the function UDiv() for unsigned division.
3650 >>> x = BitVec('x', 32)
3651 >>> y = BitVec('y', 32)
3658 >>> UDiv(x, y).sexpr()
3661 a, b = _coerce_exprs(self, other)
3662 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 3775 of file z3py.py.
3775 def __ge__(self, other):
3776 """Create the Z3 expression (signed) `other >= self`.
3778 Use the function UGE() for unsigned greater than or equal to.
3780 >>> x, y = BitVecs('x y', 32)
3783 >>> (x >= y).sexpr()
3785 >>> UGE(x, y).sexpr()
3788 a, b = _coerce_exprs(self, other)
3789 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 3759 of file z3py.py.
3759 def __gt__(self, other):
3760 """Create the Z3 expression (signed) `other > self`.
3762 Use the function UGT() for unsigned greater than.
3764 >>> x, y = BitVecs('x y', 32)
3769 >>> UGT(x, y).sexpr()
3772 a, b = _coerce_exprs(self, other)
3773 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 3634 of file z3py.py.
3634 def __invert__(self):
3635 """Create the Z3 expression bitwise-not `~self`.
3637 >>> x = BitVec('x', 32)
3643 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 3727 of file z3py.py.
3727 def __le__(self, other):
3728 """Create the Z3 expression (signed) `other <= self`.
3730 Use the function ULE() for unsigned less than or equal to.
3732 >>> x, y = BitVecs('x y', 32)
3735 >>> (x <= y).sexpr()
3737 >>> ULE(x, y).sexpr()
3740 a, b = _coerce_exprs(self, other)
3741 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 3821 of file z3py.py.
3821 def __lshift__(self, other):
3822 """Create the Z3 expression left shift `self << other`
3824 >>> x, y = BitVecs('x y', 32)
3827 >>> (x << y).sexpr()
3829 >>> simplify(BitVecVal(2, 3) << 1)
3832 a, b = _coerce_exprs(self, other)
3833 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 3743 of file z3py.py.
3743 def __lt__(self, other):
3744 """Create the Z3 expression (signed) `other < self`.
3746 Use the function ULT() for unsigned less than.
3748 >>> x, y = BitVecs('x y', 32)
3753 >>> ULT(x, y).sexpr()
3756 a, b = _coerce_exprs(self, other)
3757 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 3688 of file z3py.py.
3688 def __mod__(self, other):
3689 """Create the Z3 expression (signed) mod `self % other`.
3691 Use the function URem() for unsigned remainder, and SRem() for signed remainder.
3693 >>> x = BitVec('x', 32)
3694 >>> y = BitVec('y', 32)
3701 >>> URem(x, y).sexpr()
3703 >>> SRem(x, y).sexpr()
3706 a, b = _coerce_exprs(self, other)
3707 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 3499 of file z3py.py.
3499 def __mul__(self, other):
3500 """Create the Z3 expression `self * other`.
3502 >>> x = BitVec('x', 32)
3503 >>> y = BitVec('y', 32)
3509 a, b = _coerce_exprs(self, other)
3510 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 3623 of file z3py.py.
3624 """Return an expression representing `-self`.
3626 >>> x = BitVec('x', 32)
3632 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 3545 of file z3py.py.
3545 def __or__(self, other):
3546 """Create the Z3 expression bitwise-or `self | other`.
3548 >>> x = BitVec('x', 32)
3549 >>> y = BitVec('y', 32)
3555 a, b = _coerce_exprs(self, other)
3556 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 3614 of file z3py.py.
3617 >>> 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 3489 of file z3py.py.
3489 def __radd__(self, other):
3490 """Create the Z3 expression `other + self`.
3492 >>> x = BitVec('x', 32)
3496 a, b = _coerce_exprs(self, other)
3497 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 3581 of file z3py.py.
3581 def __rand__(self, other):
3582 """Create the Z3 expression bitwise-or `other & self`.
3584 >>> x = BitVec('x', 32)
3588 a, b = _coerce_exprs(self, other)
3589 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 3668 of file z3py.py.
3668 def __rdiv__(self, other):
3669 """Create the Z3 expression (signed) division `other / self`.
3671 Use the function UDiv() for unsigned division.
3673 >>> x = BitVec('x', 32)
3676 >>> (10 / x).sexpr()
3677 '(bvsdiv #x0000000a x)'
3678 >>> UDiv(10, x).sexpr()
3679 '(bvudiv #x0000000a x)'
3681 a, b = _coerce_exprs(self, other)
3682 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 3849 of file z3py.py.
3849 def __rlshift__(self, other):
3850 """Create the Z3 expression left shift `other << self`.
3852 Use the function LShR() for the right logical shift
3854 >>> x = BitVec('x', 32)
3857 >>> (10 << x).sexpr()
3858 '(bvshl #x0000000a x)'
3860 a, b = _coerce_exprs(self, other)
3861 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 3709 of file z3py.py.
3709 def __rmod__(self, other):
3710 """Create the Z3 expression (signed) mod `other % self`.
3712 Use the function URem() for unsigned remainder, and SRem() for signed remainder.
3714 >>> x = BitVec('x', 32)
3717 >>> (10 % x).sexpr()
3718 '(bvsmod #x0000000a x)'
3719 >>> URem(10, x).sexpr()
3720 '(bvurem #x0000000a x)'
3721 >>> SRem(10, x).sexpr()
3722 '(bvsrem #x0000000a x)'
3724 a, b = _coerce_exprs(self, other)
3725 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 3512 of file z3py.py.
3512 def __rmul__(self, other):
3513 """Create the Z3 expression `other * self`.
3515 >>> x = BitVec('x', 32)
3519 a, b = _coerce_exprs(self, other)
3520 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 3558 of file z3py.py.
3558 def __ror__(self, other):
3559 """Create the Z3 expression bitwise-or `other | self`.
3561 >>> x = BitVec('x', 32)
3565 a, b = _coerce_exprs(self, other)
3566 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 3835 of file z3py.py.
3835 def __rrshift__(self, other):
3836 """Create the Z3 expression (arithmetical) right shift `other` >> `self`.
3838 Use the function LShR() for the right logical shift
3840 >>> x = BitVec('x', 32)
3843 >>> (10 >> x).sexpr()
3844 '(bvashr #x0000000a x)'
3846 a, b = _coerce_exprs(self, other)
3847 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 3791 of file z3py.py.
3791 def __rshift__(self, other):
3792 """Create the Z3 expression (arithmetical) right shift `self >> other`
3794 Use the function LShR() for the right logical shift
3796 >>> x, y = BitVecs('x y', 32)
3799 >>> (x >> y).sexpr()
3801 >>> LShR(x, y).sexpr()
3805 >>> BitVecVal(4, 3).as_signed_long()
3807 >>> simplify(BitVecVal(4, 3) >> 1).as_signed_long()
3809 >>> simplify(BitVecVal(4, 3) >> 1)
3811 >>> simplify(LShR(BitVecVal(4, 3), 1))
3813 >>> simplify(BitVecVal(2, 3) >> 1)
3815 >>> simplify(LShR(BitVecVal(2, 3), 1))
3818 a, b = _coerce_exprs(self, other)
3819 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 3535 of file z3py.py.
3535 def __rsub__(self, other):
3536 """Create the Z3 expression `other - self`.
3538 >>> x = BitVec('x', 32)
3542 a, b = _coerce_exprs(self, other)
3543 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 3684 of file z3py.py.
3684 def __rtruediv__(self, other):
3685 """Create the Z3 expression (signed) division `other / self`."""
3686 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 3604 of file z3py.py.
3604 def __rxor__(self, other):
3605 """Create the Z3 expression bitwise-xor `other ^ self`.
3607 >>> x = BitVec('x', 32)
3611 a, b = _coerce_exprs(self, other)
3612 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 3522 of file z3py.py.
3522 def __sub__(self, other):
3523 """Create the Z3 expression `self - other`.
3525 >>> x = BitVec('x', 32)
3526 >>> y = BitVec('y', 32)
3532 a, b = _coerce_exprs(self, other)
3533 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 3664 of file z3py.py.
3664 def __truediv__(self, other):
3665 """Create the Z3 expression (signed) division `self / other`."""
3666 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 3591 of file z3py.py.
3591 def __xor__(self, other):
3592 """Create the Z3 expression bitwise-xor `self ^ other`.
3594 >>> x = BitVec('x', 32)
3595 >>> y = BitVec('y', 32)
3601 a, b = _coerce_exprs(self, other)
3602 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 3454 of file z3py.py.
3455 """Return the sort of the bit-vector expression `self`.
3457 >>> x = BitVec('x', 32)
3460 >>> x.sort() == BitVecSort(32)
3463 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().