|
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 3232 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 3257 of file z3py.py.
3257 def __add__(self, other):
3258 """Create the Z3 expression `self + other`. 3260 >>> x = BitVec('x', 32) 3261 >>> y = BitVec('y', 32) 3267 a, b = _coerce_exprs(self, other)
3268 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 3349 of file z3py.py.
3349 def __and__(self, other):
3350 """Create the Z3 expression bitwise-and `self & other`. 3352 >>> x = BitVec('x', 32) 3353 >>> y = BitVec('y', 32) 3359 a, b = _coerce_exprs(self, other)
3360 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 3426 of file z3py.py.
3426 def __div__(self, other):
3427 """Create the Z3 expression (signed) division `self / other`. 3429 Use the function UDiv() for unsigned division. 3431 >>> x = BitVec('x', 32) 3432 >>> y = BitVec('y', 32) 3439 >>> UDiv(x, y).sexpr() 3442 a, b = _coerce_exprs(self, other)
3443 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 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 3556 of file z3py.py.
3556 def __ge__(self, other):
3557 """Create the Z3 expression (signed) `other >= self`. 3559 Use the function UGE() for unsigned greater than or equal to. 3561 >>> x, y = BitVecs('x y', 32) 3564 >>> (x >= y).sexpr() 3566 >>> UGE(x, y).sexpr() 3569 a, b = _coerce_exprs(self, other)
3570 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 3540 of file z3py.py.
3540 def __gt__(self, other):
3541 """Create the Z3 expression (signed) `other > self`. 3543 Use the function UGT() for unsigned greater than. 3545 >>> x, y = BitVecs('x y', 32) 3550 >>> UGT(x, y).sexpr() 3553 a, b = _coerce_exprs(self, other)
3554 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 3415 of file z3py.py.
3415 def __invert__(self):
3416 """Create the Z3 expression bitwise-not `~self`. 3418 >>> x = BitVec('x', 32) 3424 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 3508 of file z3py.py.
3508 def __le__(self, other):
3509 """Create the Z3 expression (signed) `other <= self`. 3511 Use the function ULE() for unsigned less than or equal to. 3513 >>> x, y = BitVecs('x y', 32) 3516 >>> (x <= y).sexpr() 3518 >>> ULE(x, y).sexpr() 3521 a, b = _coerce_exprs(self, other)
3522 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 3602 of file z3py.py.
3602 def __lshift__(self, other):
3603 """Create the Z3 expression left shift `self << other` 3605 >>> x, y = BitVecs('x y', 32) 3608 >>> (x << y).sexpr() 3610 >>> simplify(BitVecVal(2, 3) << 1) 3613 a, b = _coerce_exprs(self, other)
3614 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 3524 of file z3py.py.
3524 def __lt__(self, other):
3525 """Create the Z3 expression (signed) `other < self`. 3527 Use the function ULT() for unsigned less than. 3529 >>> x, y = BitVecs('x y', 32) 3534 >>> ULT(x, y).sexpr() 3537 a, b = _coerce_exprs(self, other)
3538 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 3469 of file z3py.py.
3469 def __mod__(self, other):
3470 """Create the Z3 expression (signed) mod `self % other`. 3472 Use the function URem() for unsigned remainder, and SRem() for signed remainder. 3474 >>> x = BitVec('x', 32) 3475 >>> y = BitVec('y', 32) 3482 >>> URem(x, y).sexpr() 3484 >>> SRem(x, y).sexpr() 3487 a, b = _coerce_exprs(self, other)
3488 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 3280 of file z3py.py.
3280 def __mul__(self, other):
3281 """Create the Z3 expression `self * other`. 3283 >>> x = BitVec('x', 32) 3284 >>> y = BitVec('y', 32) 3290 a, b = _coerce_exprs(self, other)
3291 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 3404 of file z3py.py.
3405 """Return an expression representing `-self`. 3407 >>> x = BitVec('x', 32) 3413 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 3326 of file z3py.py.
3326 def __or__(self, other):
3327 """Create the Z3 expression bitwise-or `self | other`. 3329 >>> x = BitVec('x', 32) 3330 >>> y = BitVec('y', 32) 3336 a, b = _coerce_exprs(self, other)
3337 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 3395 of file z3py.py.
3398 >>> 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 3270 of file z3py.py.
3270 def __radd__(self, other):
3271 """Create the Z3 expression `other + self`. 3273 >>> x = BitVec('x', 32) 3277 a, b = _coerce_exprs(self, other)
3278 return BitVecRef(
Z3_mk_bvadd(self.ctx_ref(), b.as_ast(), a.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.
◆ __rand__()
def __rand__ |
( |
|
self, |
|
|
|
other |
|
) |
| |
Create the Z3 expression bitwise-or `other & self`.
>>> x = BitVec('x', 32)
>>> 10 & x
10 & x
Definition at line 3362 of file z3py.py.
3362 def __rand__(self, other):
3363 """Create the Z3 expression bitwise-or `other & self`. 3365 >>> x = BitVec('x', 32) 3369 a, b = _coerce_exprs(self, other)
3370 return BitVecRef(
Z3_mk_bvand(self.ctx_ref(), b.as_ast(), a.as_ast()), self.ctx)
Z3_ast Z3_API Z3_mk_bvand(Z3_context c, Z3_ast t1, Z3_ast t2)
Bitwise and.
◆ __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 3449 of file z3py.py.
3449 def __rdiv__(self, other):
3450 """Create the Z3 expression (signed) division `other / self`. 3452 Use the function UDiv() for unsigned division. 3454 >>> x = BitVec('x', 32) 3457 >>> (10 / x).sexpr() 3458 '(bvsdiv #x0000000a x)' 3459 >>> UDiv(10, x).sexpr() 3460 '(bvudiv #x0000000a x)' 3462 a, b = _coerce_exprs(self, other)
3463 return BitVecRef(
Z3_mk_bvsdiv(self.ctx_ref(), b.as_ast(), a.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 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 3630 of file z3py.py.
3630 def __rlshift__(self, other):
3631 """Create the Z3 expression left shift `other << self`. 3633 Use the function LShR() for the right logical shift 3635 >>> x = BitVec('x', 32) 3638 >>> (10 << x).sexpr() 3639 '(bvshl #x0000000a x)' 3641 a, b = _coerce_exprs(self, other)
3642 return BitVecRef(
Z3_mk_bvshl(self.ctx_ref(), b.as_ast(), a.as_ast()), self.ctx)
Z3_ast Z3_API Z3_mk_bvshl(Z3_context c, Z3_ast t1, Z3_ast t2)
Shift left.
◆ __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 3490 of file z3py.py.
3490 def __rmod__(self, other):
3491 """Create the Z3 expression (signed) mod `other % self`. 3493 Use the function URem() for unsigned remainder, and SRem() for signed remainder. 3495 >>> x = BitVec('x', 32) 3498 >>> (10 % x).sexpr() 3499 '(bvsmod #x0000000a x)' 3500 >>> URem(10, x).sexpr() 3501 '(bvurem #x0000000a x)' 3502 >>> SRem(10, x).sexpr() 3503 '(bvsrem #x0000000a x)' 3505 a, b = _coerce_exprs(self, other)
3506 return BitVecRef(
Z3_mk_bvsmod(self.ctx_ref(), b.as_ast(), a.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).
◆ __rmul__()
def __rmul__ |
( |
|
self, |
|
|
|
other |
|
) |
| |
Create the Z3 expression `other * self`.
>>> x = BitVec('x', 32)
>>> 10 * x
10*x
Definition at line 3293 of file z3py.py.
3293 def __rmul__(self, other):
3294 """Create the Z3 expression `other * self`. 3296 >>> x = BitVec('x', 32) 3300 a, b = _coerce_exprs(self, other)
3301 return BitVecRef(
Z3_mk_bvmul(self.ctx_ref(), b.as_ast(), a.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.
◆ __ror__()
def __ror__ |
( |
|
self, |
|
|
|
other |
|
) |
| |
Create the Z3 expression bitwise-or `other | self`.
>>> x = BitVec('x', 32)
>>> 10 | x
10 | x
Definition at line 3339 of file z3py.py.
3339 def __ror__(self, other):
3340 """Create the Z3 expression bitwise-or `other | self`. 3342 >>> x = BitVec('x', 32) 3346 a, b = _coerce_exprs(self, other)
3347 return BitVecRef(
Z3_mk_bvor(self.ctx_ref(), b.as_ast(), a.as_ast()), self.ctx)
Z3_ast Z3_API Z3_mk_bvor(Z3_context c, Z3_ast t1, Z3_ast t2)
Bitwise or.
◆ __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 3616 of file z3py.py.
3616 def __rrshift__(self, other):
3617 """Create the Z3 expression (arithmetical) right shift `other` >> `self`. 3619 Use the function LShR() for the right logical shift 3621 >>> x = BitVec('x', 32) 3624 >>> (10 >> x).sexpr() 3625 '(bvashr #x0000000a x)' 3627 a, b = _coerce_exprs(self, other)
3628 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 3572 of file z3py.py.
3572 def __rshift__(self, other):
3573 """Create the Z3 expression (arithmetical) right shift `self >> other` 3575 Use the function LShR() for the right logical shift 3577 >>> x, y = BitVecs('x y', 32) 3580 >>> (x >> y).sexpr() 3582 >>> LShR(x, y).sexpr() 3586 >>> BitVecVal(4, 3).as_signed_long() 3588 >>> simplify(BitVecVal(4, 3) >> 1).as_signed_long() 3590 >>> simplify(BitVecVal(4, 3) >> 1) 3592 >>> simplify(LShR(BitVecVal(4, 3), 1)) 3594 >>> simplify(BitVecVal(2, 3) >> 1) 3596 >>> simplify(LShR(BitVecVal(2, 3), 1)) 3599 a, b = _coerce_exprs(self, other)
3600 return BitVecRef(
Z3_mk_bvashr(self.ctx_ref(), a.as_ast(), b.as_ast()), self.ctx)
Z3_ast Z3_API Z3_mk_bvashr(Z3_context c, Z3_ast t1, Z3_ast t2)
Arithmetic shift right.
◆ __rsub__()
def __rsub__ |
( |
|
self, |
|
|
|
other |
|
) |
| |
Create the Z3 expression `other - self`.
>>> x = BitVec('x', 32)
>>> 10 - x
10 - x
Definition at line 3316 of file z3py.py.
3316 def __rsub__(self, other):
3317 """Create the Z3 expression `other - self`. 3319 >>> x = BitVec('x', 32) 3323 a, b = _coerce_exprs(self, other)
3324 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 3465 of file z3py.py.
3465 def __rtruediv__(self, other):
3466 """Create the Z3 expression (signed) division `other / self`.""" 3467 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 3385 of file z3py.py.
3385 def __rxor__(self, other):
3386 """Create the Z3 expression bitwise-xor `other ^ self`. 3388 >>> x = BitVec('x', 32) 3392 a, b = _coerce_exprs(self, other)
3393 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 3303 of file z3py.py.
3303 def __sub__(self, other):
3304 """Create the Z3 expression `self - other`. 3306 >>> x = BitVec('x', 32) 3307 >>> y = BitVec('y', 32) 3313 a, b = _coerce_exprs(self, other)
3314 return BitVecRef(
Z3_mk_bvsub(self.ctx_ref(), a.as_ast(), b.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.
◆ __truediv__()
def __truediv__ |
( |
|
self, |
|
|
|
other |
|
) |
| |
Create the Z3 expression (signed) division `self / other`.
Definition at line 3445 of file z3py.py.
3445 def __truediv__(self, other):
3446 """Create the Z3 expression (signed) division `self / other`.""" 3447 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 3372 of file z3py.py.
3372 def __xor__(self, other):
3373 """Create the Z3 expression bitwise-xor `self ^ other`. 3375 >>> x = BitVec('x', 32) 3376 >>> y = BitVec('y', 32) 3382 a, b = _coerce_exprs(self, other)
3383 return BitVecRef(
Z3_mk_bvxor(self.ctx_ref(), a.as_ast(), b.as_ast()), self.ctx)
Z3_ast Z3_API Z3_mk_bvxor(Z3_context c, Z3_ast t1, Z3_ast t2)
Bitwise exclusive-or.
◆ 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 3246 of file z3py.py.
3247 """Return the number of bits of the bit-vector expression `self`. 3249 >>> x = BitVec('x', 32) 3252 >>> Concat(x, x).size() 3255 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 3235 of file z3py.py.
3236 """Return the sort of the bit-vector expression `self`. 3238 >>> x = BitVec('x', 32) 3241 >>> x.sort() == BitVecSort(32) 3244 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.