|
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 3236 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 3261 of file z3py.py.
3261 def __add__(self, other):
3262 """Create the Z3 expression `self + other`. 3264 >>> x = BitVec('x', 32) 3265 >>> y = BitVec('y', 32) 3271 a, b = _coerce_exprs(self, other)
3272 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 3353 of file z3py.py.
3353 def __and__(self, other):
3354 """Create the Z3 expression bitwise-and `self & other`. 3356 >>> x = BitVec('x', 32) 3357 >>> y = BitVec('y', 32) 3363 a, b = _coerce_exprs(self, other)
3364 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 3430 of file z3py.py.
3430 def __div__(self, other):
3431 """Create the Z3 expression (signed) division `self / other`. 3433 Use the function UDiv() for unsigned division. 3435 >>> x = BitVec('x', 32) 3436 >>> y = BitVec('y', 32) 3443 >>> UDiv(x, y).sexpr() 3446 a, b = _coerce_exprs(self, other)
3447 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 3560 of file z3py.py.
3560 def __ge__(self, other):
3561 """Create the Z3 expression (signed) `other >= self`. 3563 Use the function UGE() for unsigned greater than or equal to. 3565 >>> x, y = BitVecs('x y', 32) 3568 >>> (x >= y).sexpr() 3570 >>> UGE(x, y).sexpr() 3573 a, b = _coerce_exprs(self, other)
3574 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 3544 of file z3py.py.
3544 def __gt__(self, other):
3545 """Create the Z3 expression (signed) `other > self`. 3547 Use the function UGT() for unsigned greater than. 3549 >>> x, y = BitVecs('x y', 32) 3554 >>> UGT(x, y).sexpr() 3557 a, b = _coerce_exprs(self, other)
3558 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 3419 of file z3py.py.
3419 def __invert__(self):
3420 """Create the Z3 expression bitwise-not `~self`. 3422 >>> x = BitVec('x', 32) 3428 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 3512 of file z3py.py.
3512 def __le__(self, other):
3513 """Create the Z3 expression (signed) `other <= self`. 3515 Use the function ULE() for unsigned less than or equal to. 3517 >>> x, y = BitVecs('x y', 32) 3520 >>> (x <= y).sexpr() 3522 >>> ULE(x, y).sexpr() 3525 a, b = _coerce_exprs(self, other)
3526 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 3606 of file z3py.py.
3606 def __lshift__(self, other):
3607 """Create the Z3 expression left shift `self << other` 3609 >>> x, y = BitVecs('x y', 32) 3612 >>> (x << y).sexpr() 3614 >>> simplify(BitVecVal(2, 3) << 1) 3617 a, b = _coerce_exprs(self, other)
3618 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 3528 of file z3py.py.
3528 def __lt__(self, other):
3529 """Create the Z3 expression (signed) `other < self`. 3531 Use the function ULT() for unsigned less than. 3533 >>> x, y = BitVecs('x y', 32) 3538 >>> ULT(x, y).sexpr() 3541 a, b = _coerce_exprs(self, other)
3542 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 3473 of file z3py.py.
3473 def __mod__(self, other):
3474 """Create the Z3 expression (signed) mod `self % other`. 3476 Use the function URem() for unsigned remainder, and SRem() for signed remainder. 3478 >>> x = BitVec('x', 32) 3479 >>> y = BitVec('y', 32) 3486 >>> URem(x, y).sexpr() 3488 >>> SRem(x, y).sexpr() 3491 a, b = _coerce_exprs(self, other)
3492 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 3284 of file z3py.py.
3284 def __mul__(self, other):
3285 """Create the Z3 expression `self * other`. 3287 >>> x = BitVec('x', 32) 3288 >>> y = BitVec('y', 32) 3294 a, b = _coerce_exprs(self, other)
3295 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 3408 of file z3py.py.
3409 """Return an expression representing `-self`. 3411 >>> x = BitVec('x', 32) 3417 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 3330 of file z3py.py.
3330 def __or__(self, other):
3331 """Create the Z3 expression bitwise-or `self | other`. 3333 >>> x = BitVec('x', 32) 3334 >>> y = BitVec('y', 32) 3340 a, b = _coerce_exprs(self, other)
3341 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 3399 of file z3py.py.
3402 >>> 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 3274 of file z3py.py.
3274 def __radd__(self, other):
3275 """Create the Z3 expression `other + self`. 3277 >>> x = BitVec('x', 32) 3281 a, b = _coerce_exprs(self, other)
3282 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 3366 of file z3py.py.
3366 def __rand__(self, other):
3367 """Create the Z3 expression bitwise-or `other & self`. 3369 >>> x = BitVec('x', 32) 3373 a, b = _coerce_exprs(self, other)
3374 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 3453 of file z3py.py.
3453 def __rdiv__(self, other):
3454 """Create the Z3 expression (signed) division `other / self`. 3456 Use the function UDiv() for unsigned division. 3458 >>> x = BitVec('x', 32) 3461 >>> (10 / x).sexpr() 3462 '(bvsdiv #x0000000a x)' 3463 >>> UDiv(10, x).sexpr() 3464 '(bvudiv #x0000000a x)' 3466 a, b = _coerce_exprs(self, other)
3467 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 3634 of file z3py.py.
3634 def __rlshift__(self, other):
3635 """Create the Z3 expression left shift `other << self`. 3637 Use the function LShR() for the right logical shift 3639 >>> x = BitVec('x', 32) 3642 >>> (10 << x).sexpr() 3643 '(bvshl #x0000000a x)' 3645 a, b = _coerce_exprs(self, other)
3646 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 3494 of file z3py.py.
3494 def __rmod__(self, other):
3495 """Create the Z3 expression (signed) mod `other % self`. 3497 Use the function URem() for unsigned remainder, and SRem() for signed remainder. 3499 >>> x = BitVec('x', 32) 3502 >>> (10 % x).sexpr() 3503 '(bvsmod #x0000000a x)' 3504 >>> URem(10, x).sexpr() 3505 '(bvurem #x0000000a x)' 3506 >>> SRem(10, x).sexpr() 3507 '(bvsrem #x0000000a x)' 3509 a, b = _coerce_exprs(self, other)
3510 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 3297 of file z3py.py.
3297 def __rmul__(self, other):
3298 """Create the Z3 expression `other * self`. 3300 >>> x = BitVec('x', 32) 3304 a, b = _coerce_exprs(self, other)
3305 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 3343 of file z3py.py.
3343 def __ror__(self, other):
3344 """Create the Z3 expression bitwise-or `other | self`. 3346 >>> x = BitVec('x', 32) 3350 a, b = _coerce_exprs(self, other)
3351 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 3620 of file z3py.py.
3620 def __rrshift__(self, other):
3621 """Create the Z3 expression (arithmetical) right shift `other` >> `self`. 3623 Use the function LShR() for the right logical shift 3625 >>> x = BitVec('x', 32) 3628 >>> (10 >> x).sexpr() 3629 '(bvashr #x0000000a x)' 3631 a, b = _coerce_exprs(self, other)
3632 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 3576 of file z3py.py.
3576 def __rshift__(self, other):
3577 """Create the Z3 expression (arithmetical) right shift `self >> other` 3579 Use the function LShR() for the right logical shift 3581 >>> x, y = BitVecs('x y', 32) 3584 >>> (x >> y).sexpr() 3586 >>> LShR(x, y).sexpr() 3590 >>> BitVecVal(4, 3).as_signed_long() 3592 >>> simplify(BitVecVal(4, 3) >> 1).as_signed_long() 3594 >>> simplify(BitVecVal(4, 3) >> 1) 3596 >>> simplify(LShR(BitVecVal(4, 3), 1)) 3598 >>> simplify(BitVecVal(2, 3) >> 1) 3600 >>> simplify(LShR(BitVecVal(2, 3), 1)) 3603 a, b = _coerce_exprs(self, other)
3604 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 3320 of file z3py.py.
3320 def __rsub__(self, other):
3321 """Create the Z3 expression `other - self`. 3323 >>> x = BitVec('x', 32) 3327 a, b = _coerce_exprs(self, other)
3328 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 3469 of file z3py.py.
3469 def __rtruediv__(self, other):
3470 """Create the Z3 expression (signed) division `other / self`.""" 3471 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 3389 of file z3py.py.
3389 def __rxor__(self, other):
3390 """Create the Z3 expression bitwise-xor `other ^ self`. 3392 >>> x = BitVec('x', 32) 3396 a, b = _coerce_exprs(self, other)
3397 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 3307 of file z3py.py.
3307 def __sub__(self, other):
3308 """Create the Z3 expression `self - other`. 3310 >>> x = BitVec('x', 32) 3311 >>> y = BitVec('y', 32) 3317 a, b = _coerce_exprs(self, other)
3318 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 3449 of file z3py.py.
3449 def __truediv__(self, other):
3450 """Create the Z3 expression (signed) division `self / other`.""" 3451 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 3376 of file z3py.py.
3376 def __xor__(self, other):
3377 """Create the Z3 expression bitwise-xor `self ^ other`. 3379 >>> x = BitVec('x', 32) 3380 >>> y = BitVec('y', 32) 3386 a, b = _coerce_exprs(self, other)
3387 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 3250 of file z3py.py.
3251 """Return the number of bits of the bit-vector expression `self`. 3253 >>> x = BitVec('x', 32) 3256 >>> Concat(x, x).size() 3259 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 3239 of file z3py.py.
3240 """Return the sort of the bit-vector expression `self`. 3242 >>> x = BitVec('x', 32) 3245 >>> x.sort() == BitVecSort(32) 3248 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.