|
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 (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 | __eq__ (self, other) |
|
def | __hash__ (self) |
|
def | __nonzero__ (self) |
|
def | __bool__ (self) |
|
def | sexpr (self) |
|
def | as_ast (self) |
|
def | get_id (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 3204 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 3229 of file z3py.py.
3229 def __add__(self, other):
3230 """Create the Z3 expression `self + other`. 3232 >>> x = BitVec('x', 32) 3233 >>> y = BitVec('y', 32) 3239 a, b = _coerce_exprs(self, other)
3240 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 3321 of file z3py.py.
3321 def __and__(self, other):
3322 """Create the Z3 expression bitwise-and `self & other`. 3324 >>> x = BitVec('x', 32) 3325 >>> y = BitVec('y', 32) 3331 a, b = _coerce_exprs(self, other)
3332 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 3398 of file z3py.py.
3398 def __div__(self, other):
3399 """Create the Z3 expression (signed) division `self / other`. 3401 Use the function UDiv() for unsigned division. 3403 >>> x = BitVec('x', 32) 3404 >>> y = BitVec('y', 32) 3411 >>> UDiv(x, y).sexpr() 3414 a, b = _coerce_exprs(self, other)
3415 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.
◆ __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 3528 of file z3py.py.
3528 def __ge__(self, other):
3529 """Create the Z3 expression (signed) `other >= self`. 3531 Use the function UGE() for unsigned greater than or equal to. 3533 >>> x, y = BitVecs('x y', 32) 3536 >>> (x >= y).sexpr() 3538 >>> UGE(x, y).sexpr() 3541 a, b = _coerce_exprs(self, other)
3542 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 3512 of file z3py.py.
3512 def __gt__(self, other):
3513 """Create the Z3 expression (signed) `other > self`. 3515 Use the function UGT() for unsigned greater than. 3517 >>> x, y = BitVecs('x y', 32) 3522 >>> UGT(x, y).sexpr() 3525 a, b = _coerce_exprs(self, other)
3526 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 3387 of file z3py.py.
3387 def __invert__(self):
3388 """Create the Z3 expression bitwise-not `~self`. 3390 >>> x = BitVec('x', 32) 3396 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 3480 of file z3py.py.
3480 def __le__(self, other):
3481 """Create the Z3 expression (signed) `other <= self`. 3483 Use the function ULE() for unsigned less than or equal to. 3485 >>> x, y = BitVecs('x y', 32) 3488 >>> (x <= y).sexpr() 3490 >>> ULE(x, y).sexpr() 3493 a, b = _coerce_exprs(self, other)
3494 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 3574 of file z3py.py.
3574 def __lshift__(self, other):
3575 """Create the Z3 expression left shift `self << other` 3577 >>> x, y = BitVecs('x y', 32) 3580 >>> (x << y).sexpr() 3582 >>> simplify(BitVecVal(2, 3) << 1) 3585 a, b = _coerce_exprs(self, other)
3586 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 3496 of file z3py.py.
3496 def __lt__(self, other):
3497 """Create the Z3 expression (signed) `other < self`. 3499 Use the function ULT() for unsigned less than. 3501 >>> x, y = BitVecs('x y', 32) 3506 >>> ULT(x, y).sexpr() 3509 a, b = _coerce_exprs(self, other)
3510 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 3441 of file z3py.py.
3441 def __mod__(self, other):
3442 """Create the Z3 expression (signed) mod `self % other`. 3444 Use the function URem() for unsigned remainder, and SRem() for signed remainder. 3446 >>> x = BitVec('x', 32) 3447 >>> y = BitVec('y', 32) 3454 >>> URem(x, y).sexpr() 3456 >>> SRem(x, y).sexpr() 3459 a, b = _coerce_exprs(self, other)
3460 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 3252 of file z3py.py.
3252 def __mul__(self, other):
3253 """Create the Z3 expression `self * other`. 3255 >>> x = BitVec('x', 32) 3256 >>> y = BitVec('y', 32) 3262 a, b = _coerce_exprs(self, other)
3263 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 3376 of file z3py.py.
3377 """Return an expression representing `-self`. 3379 >>> x = BitVec('x', 32) 3385 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 3298 of file z3py.py.
3298 def __or__(self, other):
3299 """Create the Z3 expression bitwise-or `self | other`. 3301 >>> x = BitVec('x', 32) 3302 >>> y = BitVec('y', 32) 3308 a, b = _coerce_exprs(self, other)
3309 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 3367 of file z3py.py.
3370 >>> 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 3242 of file z3py.py.
3242 def __radd__(self, other):
3243 """Create the Z3 expression `other + self`. 3245 >>> x = BitVec('x', 32) 3249 a, b = _coerce_exprs(self, other)
3250 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 3334 of file z3py.py.
3334 def __rand__(self, other):
3335 """Create the Z3 expression bitwise-or `other & self`. 3337 >>> x = BitVec('x', 32) 3341 a, b = _coerce_exprs(self, other)
3342 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 3421 of file z3py.py.
3421 def __rdiv__(self, other):
3422 """Create the Z3 expression (signed) division `other / self`. 3424 Use the function UDiv() for unsigned division. 3426 >>> x = BitVec('x', 32) 3429 >>> (10 / x).sexpr() 3430 '(bvsdiv #x0000000a x)' 3431 >>> UDiv(10, x).sexpr() 3432 '(bvudiv #x0000000a x)' 3434 a, b = _coerce_exprs(self, other)
3435 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.
◆ __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 3602 of file z3py.py.
3602 def __rlshift__(self, other):
3603 """Create the Z3 expression left shift `other << self`. 3605 Use the function LShR() for the right logical shift 3607 >>> x = BitVec('x', 32) 3610 >>> (10 << x).sexpr() 3611 '(bvshl #x0000000a x)' 3613 a, b = _coerce_exprs(self, other)
3614 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 3462 of file z3py.py.
3462 def __rmod__(self, other):
3463 """Create the Z3 expression (signed) mod `other % self`. 3465 Use the function URem() for unsigned remainder, and SRem() for signed remainder. 3467 >>> x = BitVec('x', 32) 3470 >>> (10 % x).sexpr() 3471 '(bvsmod #x0000000a x)' 3472 >>> URem(10, x).sexpr() 3473 '(bvurem #x0000000a x)' 3474 >>> SRem(10, x).sexpr() 3475 '(bvsrem #x0000000a x)' 3477 a, b = _coerce_exprs(self, other)
3478 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 3265 of file z3py.py.
3265 def __rmul__(self, other):
3266 """Create the Z3 expression `other * self`. 3268 >>> x = BitVec('x', 32) 3272 a, b = _coerce_exprs(self, other)
3273 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 3311 of file z3py.py.
3311 def __ror__(self, other):
3312 """Create the Z3 expression bitwise-or `other | self`. 3314 >>> x = BitVec('x', 32) 3318 a, b = _coerce_exprs(self, other)
3319 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 3588 of file z3py.py.
3588 def __rrshift__(self, other):
3589 """Create the Z3 expression (arithmetical) right shift `other` >> `self`. 3591 Use the function LShR() for the right logical shift 3593 >>> x = BitVec('x', 32) 3596 >>> (10 >> x).sexpr() 3597 '(bvashr #x0000000a x)' 3599 a, b = _coerce_exprs(self, other)
3600 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 3544 of file z3py.py.
3544 def __rshift__(self, other):
3545 """Create the Z3 expression (arithmetical) right shift `self >> other` 3547 Use the function LShR() for the right logical shift 3549 >>> x, y = BitVecs('x y', 32) 3552 >>> (x >> y).sexpr() 3554 >>> LShR(x, y).sexpr() 3558 >>> BitVecVal(4, 3).as_signed_long() 3560 >>> simplify(BitVecVal(4, 3) >> 1).as_signed_long() 3562 >>> simplify(BitVecVal(4, 3) >> 1) 3564 >>> simplify(LShR(BitVecVal(4, 3), 1)) 3566 >>> simplify(BitVecVal(2, 3) >> 1) 3568 >>> simplify(LShR(BitVecVal(2, 3), 1)) 3571 a, b = _coerce_exprs(self, other)
3572 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 3288 of file z3py.py.
3288 def __rsub__(self, other):
3289 """Create the Z3 expression `other - self`. 3291 >>> x = BitVec('x', 32) 3295 a, b = _coerce_exprs(self, other)
3296 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 3437 of file z3py.py.
3437 def __rtruediv__(self, other):
3438 """Create the Z3 expression (signed) division `other / self`.""" 3439 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 3357 of file z3py.py.
3357 def __rxor__(self, other):
3358 """Create the Z3 expression bitwise-xor `other ^ self`. 3360 >>> x = BitVec('x', 32) 3364 a, b = _coerce_exprs(self, other)
3365 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 3275 of file z3py.py.
3275 def __sub__(self, other):
3276 """Create the Z3 expression `self - other`. 3278 >>> x = BitVec('x', 32) 3279 >>> y = BitVec('y', 32) 3285 a, b = _coerce_exprs(self, other)
3286 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 3417 of file z3py.py.
3417 def __truediv__(self, other):
3418 """Create the Z3 expression (signed) division `self / other`.""" 3419 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 3344 of file z3py.py.
3344 def __xor__(self, other):
3345 """Create the Z3 expression bitwise-xor `self ^ other`. 3347 >>> x = BitVec('x', 32) 3348 >>> y = BitVec('y', 32) 3354 a, b = _coerce_exprs(self, other)
3355 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 3218 of file z3py.py.
3219 """Return the number of bits of the bit-vector expression `self`. 3221 >>> x = BitVec('x', 32) 3224 >>> Concat(x, x).size() 3227 return self.sort().size()
◆ sort()
Return the sort of the bit-vector expression `self`.
>>> x = BitVec('x', 32)
>>> x.sort()
BitVec(32)
>>> x.sort() == BitVecSort(32)
True
Definition at line 3207 of file z3py.py.
Referenced by BitVecRef.__add__(), BitVecRef.__and__(), BitVecRef.__div__(), BitVecRef.__mod__(), BitVecRef.__mul__(), BitVecRef.__or__(), BitVecRef.__sub__(), and BitVecRef.__xor__().
3208 """Return the sort of the bit-vector expression `self`. 3210 >>> x = BitVec('x', 32) 3213 >>> x.sort() == BitVecSort(32) 3216 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.