|
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 3472 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 3497 of file z3py.py.
3497 def __add__(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_bvadd(self.ctx_ref(), a.as_ast(), b.as_ast()), self.ctx)
◆ __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 3589 of file z3py.py.
3589 def __and__(self, other):
3590 """Create the Z3 expression bitwise-and `self & other`.
3592 >>> x = BitVec('x', 32)
3593 >>> y = BitVec('y', 32)
3599 a, b = _coerce_exprs(self, other)
3600 return BitVecRef(
Z3_mk_bvand(self.ctx_ref(), a.as_ast(), b.as_ast()), self.ctx)
◆ __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 3666 of file z3py.py.
3666 def __div__(self, other):
3667 """Create the Z3 expression (signed) division `self / other`.
3669 Use the function UDiv() for unsigned division.
3671 >>> x = BitVec('x', 32)
3672 >>> y = BitVec('y', 32)
3679 >>> UDiv(x, y).sexpr()
3682 a, b = _coerce_exprs(self, other)
3683 return BitVecRef(
Z3_mk_bvsdiv(self.ctx_ref(), a.as_ast(), b.as_ast()), self.ctx)
Referenced by 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 3796 of file z3py.py.
3796 def __ge__(self, other):
3797 """Create the Z3 expression (signed) `other >= self`.
3799 Use the function UGE() for unsigned greater than or equal to.
3801 >>> x, y = BitVecs('x y', 32)
3804 >>> (x >= y).sexpr()
3806 >>> UGE(x, y).sexpr()
3809 a, b = _coerce_exprs(self, other)
3810 return BoolRef(
Z3_mk_bvsge(self.ctx_ref(), a.as_ast(), b.as_ast()), self.ctx)
◆ __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 3780 of file z3py.py.
3780 def __gt__(self, other):
3781 """Create the Z3 expression (signed) `other > self`.
3783 Use the function UGT() for unsigned greater than.
3785 >>> x, y = BitVecs('x y', 32)
3790 >>> UGT(x, y).sexpr()
3793 a, b = _coerce_exprs(self, other)
3794 return BoolRef(
Z3_mk_bvsgt(self.ctx_ref(), a.as_ast(), b.as_ast()), self.ctx)
◆ __invert__()
Create the Z3 expression bitwise-not `~self`.
>>> x = BitVec('x', 32)
>>> ~x
~x
>>> simplify(~(~x))
x
Definition at line 3655 of file z3py.py.
3655 def __invert__(self):
3656 """Create the Z3 expression bitwise-not `~self`.
3658 >>> x = BitVec('x', 32)
3664 return BitVecRef(
Z3_mk_bvnot(self.ctx_ref(), self.as_ast()), self.ctx)
◆ __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 3748 of file z3py.py.
3748 def __le__(self, other):
3749 """Create the Z3 expression (signed) `other <= self`.
3751 Use the function ULE() for unsigned less than or equal to.
3753 >>> x, y = BitVecs('x y', 32)
3756 >>> (x <= y).sexpr()
3758 >>> ULE(x, y).sexpr()
3761 a, b = _coerce_exprs(self, other)
3762 return BoolRef(
Z3_mk_bvsle(self.ctx_ref(), a.as_ast(), b.as_ast()), self.ctx)
◆ __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 3842 of file z3py.py.
3842 def __lshift__(self, other):
3843 """Create the Z3 expression left shift `self << other`
3845 >>> x, y = BitVecs('x y', 32)
3848 >>> (x << y).sexpr()
3850 >>> simplify(BitVecVal(2, 3) << 1)
3853 a, b = _coerce_exprs(self, other)
3854 return BitVecRef(
Z3_mk_bvshl(self.ctx_ref(), a.as_ast(), b.as_ast()), self.ctx)
◆ __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 3764 of file z3py.py.
3764 def __lt__(self, other):
3765 """Create the Z3 expression (signed) `other < self`.
3767 Use the function ULT() for unsigned less than.
3769 >>> x, y = BitVecs('x y', 32)
3774 >>> ULT(x, y).sexpr()
3777 a, b = _coerce_exprs(self, other)
3778 return BoolRef(
Z3_mk_bvslt(self.ctx_ref(), a.as_ast(), b.as_ast()), self.ctx)
◆ __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 3709 of file z3py.py.
3709 def __mod__(self, other):
3710 """Create the Z3 expression (signed) mod `self % other`.
3712 Use the function URem() for unsigned remainder, and SRem() for signed remainder.
3714 >>> x = BitVec('x', 32)
3715 >>> y = BitVec('y', 32)
3722 >>> URem(x, y).sexpr()
3724 >>> SRem(x, y).sexpr()
3727 a, b = _coerce_exprs(self, other)
3728 return BitVecRef(
Z3_mk_bvsmod(self.ctx_ref(), a.as_ast(), b.as_ast()), self.ctx)
◆ __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 3520 of file z3py.py.
3520 def __mul__(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_bvmul(self.ctx_ref(), a.as_ast(), b.as_ast()), self.ctx)
◆ __neg__()
Return an expression representing `-self`.
>>> x = BitVec('x', 32)
>>> -x
-x
>>> simplify(-(-x))
x
Definition at line 3644 of file z3py.py.
3645 """Return an expression representing `-self`.
3647 >>> x = BitVec('x', 32)
3653 return BitVecRef(
Z3_mk_bvneg(self.ctx_ref(), self.as_ast()), self.ctx)
◆ __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 3566 of file z3py.py.
3566 def __or__(self, other):
3567 """Create the Z3 expression bitwise-or `self | other`.
3569 >>> x = BitVec('x', 32)
3570 >>> y = BitVec('y', 32)
3576 a, b = _coerce_exprs(self, other)
3577 return BitVecRef(
Z3_mk_bvor(self.ctx_ref(), a.as_ast(), b.as_ast()), self.ctx)
◆ __pos__()
Return `self`.
>>> x = BitVec('x', 32)
>>> +x
x
Definition at line 3635 of file z3py.py.
3638 >>> 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 3510 of file z3py.py.
3510 def __radd__(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_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 3602 of file z3py.py.
3602 def __rand__(self, other):
3603 """Create the Z3 expression bitwise-or `other & self`.
3605 >>> x = BitVec('x', 32)
3609 a, b = _coerce_exprs(self, other)
3610 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 3689 of file z3py.py.
3689 def __rdiv__(self, other):
3690 """Create the Z3 expression (signed) division `other / self`.
3692 Use the function UDiv() for unsigned division.
3694 >>> x = BitVec('x', 32)
3697 >>> (10 / x).sexpr()
3698 '(bvsdiv #x0000000a x)'
3699 >>> UDiv(10, x).sexpr()
3700 '(bvudiv #x0000000a x)'
3702 a, b = _coerce_exprs(self, other)
3703 return BitVecRef(
Z3_mk_bvsdiv(self.ctx_ref(), b.as_ast(), a.as_ast()), self.ctx)
Referenced by 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 3870 of file z3py.py.
3870 def __rlshift__(self, other):
3871 """Create the Z3 expression left shift `other << self`.
3873 Use the function LShR() for the right logical shift
3875 >>> x = BitVec('x', 32)
3878 >>> (10 << x).sexpr()
3879 '(bvshl #x0000000a x)'
3881 a, b = _coerce_exprs(self, other)
3882 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 3730 of file z3py.py.
3730 def __rmod__(self, other):
3731 """Create the Z3 expression (signed) mod `other % self`.
3733 Use the function URem() for unsigned remainder, and SRem() for signed remainder.
3735 >>> x = BitVec('x', 32)
3738 >>> (10 % x).sexpr()
3739 '(bvsmod #x0000000a x)'
3740 >>> URem(10, x).sexpr()
3741 '(bvurem #x0000000a x)'
3742 >>> SRem(10, x).sexpr()
3743 '(bvsrem #x0000000a x)'
3745 a, b = _coerce_exprs(self, other)
3746 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 3533 of file z3py.py.
3533 def __rmul__(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_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 3579 of file z3py.py.
3579 def __ror__(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_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 3856 of file z3py.py.
3856 def __rrshift__(self, other):
3857 """Create the Z3 expression (arithmetical) right shift `other` >> `self`.
3859 Use the function LShR() for the right logical shift
3861 >>> x = BitVec('x', 32)
3864 >>> (10 >> x).sexpr()
3865 '(bvashr #x0000000a x)'
3867 a, b = _coerce_exprs(self, other)
3868 return BitVecRef(
Z3_mk_bvashr(self.ctx_ref(), b.as_ast(), a.as_ast()), self.ctx)
◆ __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 3812 of file z3py.py.
3812 def __rshift__(self, other):
3813 """Create the Z3 expression (arithmetical) right shift `self >> other`
3815 Use the function LShR() for the right logical shift
3817 >>> x, y = BitVecs('x y', 32)
3820 >>> (x >> y).sexpr()
3822 >>> LShR(x, y).sexpr()
3826 >>> BitVecVal(4, 3).as_signed_long()
3828 >>> simplify(BitVecVal(4, 3) >> 1).as_signed_long()
3830 >>> simplify(BitVecVal(4, 3) >> 1)
3832 >>> simplify(LShR(BitVecVal(4, 3), 1))
3834 >>> simplify(BitVecVal(2, 3) >> 1)
3836 >>> simplify(LShR(BitVecVal(2, 3), 1))
3839 a, b = _coerce_exprs(self, other)
3840 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 3556 of file z3py.py.
3556 def __rsub__(self, other):
3557 """Create the Z3 expression `other - self`.
3559 >>> x = BitVec('x', 32)
3563 a, b = _coerce_exprs(self, other)
3564 return BitVecRef(
Z3_mk_bvsub(self.ctx_ref(), b.as_ast(), a.as_ast()), self.ctx)
◆ __rtruediv__()
def __rtruediv__ |
( |
|
self, |
|
|
|
other |
|
) |
| |
Create the Z3 expression (signed) division `other / self`.
Definition at line 3705 of file z3py.py.
3705 def __rtruediv__(self, other):
3706 """Create the Z3 expression (signed) division `other / self`."""
3707 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 3625 of file z3py.py.
3625 def __rxor__(self, other):
3626 """Create the Z3 expression bitwise-xor `other ^ self`.
3628 >>> x = BitVec('x', 32)
3632 a, b = _coerce_exprs(self, other)
3633 return BitVecRef(
Z3_mk_bvxor(self.ctx_ref(), b.as_ast(), a.as_ast()), self.ctx)
◆ __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 3543 of file z3py.py.
3543 def __sub__(self, other):
3544 """Create the Z3 expression `self - other`.
3546 >>> x = BitVec('x', 32)
3547 >>> y = BitVec('y', 32)
3553 a, b = _coerce_exprs(self, other)
3554 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 3685 of file z3py.py.
3685 def __truediv__(self, other):
3686 """Create the Z3 expression (signed) division `self / other`."""
3687 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 3612 of file z3py.py.
3612 def __xor__(self, other):
3613 """Create the Z3 expression bitwise-xor `self ^ other`.
3615 >>> x = BitVec('x', 32)
3616 >>> y = BitVec('y', 32)
3622 a, b = _coerce_exprs(self, other)
3623 return BitVecRef(
Z3_mk_bvxor(self.ctx_ref(), a.as_ast(), b.as_ast()), self.ctx)
◆ size()
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 3486 of file z3py.py.
3487 """Return the number of bits of the bit-vector expression `self`.
3489 >>> x = BitVec('x', 32)
3492 >>> Concat(x, x).size()
3495 return self.sort().size()
Referenced by ParamDescrsRef.__len__(), Goal.__len__(), and BitVecNumRef.as_signed_long().
◆ 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 3475 of file z3py.py.
3476 """Return the sort of the bit-vector expression `self`.
3478 >>> x = BitVec('x', 32)
3481 >>> x.sort() == BitVecSort(32)
3484 return BitVecSortRef(
Z3_get_sort(self.ctx_ref(), self.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.
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.
Z3_ast Z3_API Z3_mk_bvashr(Z3_context c, Z3_ast t1, Z3_ast t2)
Arithmetic shift right.
Z3_ast Z3_API Z3_mk_bvsdiv(Z3_context c, Z3_ast t1, Z3_ast t2)
Two's complement signed division.
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.
Z3_ast Z3_API Z3_mk_bvor(Z3_context c, Z3_ast t1, Z3_ast t2)
Bitwise or.
Z3_ast Z3_API Z3_mk_bvsgt(Z3_context c, Z3_ast t1, Z3_ast t2)
Two's complement signed greater than.
Z3_ast Z3_API Z3_mk_bvadd(Z3_context c, Z3_ast t1, Z3_ast t2)
Standard two's complement addition.
Z3_ast Z3_API Z3_mk_bvnot(Z3_context c, Z3_ast t1)
Bitwise negation.
Z3_ast Z3_API Z3_mk_bvneg(Z3_context c, Z3_ast t1)
Standard two's complement unary minus.
Z3_ast Z3_API Z3_mk_bvshl(Z3_context c, Z3_ast t1, Z3_ast t2)
Shift left.
Z3_ast Z3_API Z3_mk_bvslt(Z3_context c, Z3_ast t1, Z3_ast t2)
Two's complement signed less than.
Z3_sort Z3_API Z3_get_sort(Z3_context c, Z3_ast a)
Return the sort of an AST node.
Z3_ast Z3_API Z3_mk_bvsmod(Z3_context c, Z3_ast t1, Z3_ast t2)
Two's complement signed remainder (sign follows divisor).
Z3_ast Z3_API Z3_mk_bvsub(Z3_context c, Z3_ast t1, Z3_ast t2)
Standard two's complement subtraction.
Z3_ast Z3_API Z3_mk_bvand(Z3_context c, Z3_ast t1, Z3_ast t2)
Bitwise and.
Z3_ast Z3_API Z3_mk_bvxor(Z3_context c, Z3_ast t1, Z3_ast t2)
Bitwise exclusive-or.