|
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 3198 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 3223 of file z3py.py.
3223 def __add__(self, other):
3224 """Create the Z3 expression `self + other`. 3226 >>> x = BitVec('x', 32) 3227 >>> y = BitVec('y', 32) 3233 a, b = _coerce_exprs(self, other)
3234 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 3315 of file z3py.py.
3315 def __and__(self, other):
3316 """Create the Z3 expression bitwise-and `self & other`. 3318 >>> x = BitVec('x', 32) 3319 >>> y = BitVec('y', 32) 3325 a, b = _coerce_exprs(self, other)
3326 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 3392 of file z3py.py.
3392 def __div__(self, other):
3393 """Create the Z3 expression (signed) division `self / other`. 3395 Use the function UDiv() for unsigned division. 3397 >>> x = BitVec('x', 32) 3398 >>> y = BitVec('y', 32) 3405 >>> UDiv(x, y).sexpr() 3408 a, b = _coerce_exprs(self, other)
3409 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 3522 of file z3py.py.
3522 def __ge__(self, other):
3523 """Create the Z3 expression (signed) `other >= self`. 3525 Use the function UGE() for unsigned greater than or equal to. 3527 >>> x, y = BitVecs('x y', 32) 3530 >>> (x >= y).sexpr() 3532 >>> UGE(x, y).sexpr() 3535 a, b = _coerce_exprs(self, other)
3536 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 3506 of file z3py.py.
3506 def __gt__(self, other):
3507 """Create the Z3 expression (signed) `other > self`. 3509 Use the function UGT() for unsigned greater than. 3511 >>> x, y = BitVecs('x y', 32) 3516 >>> UGT(x, y).sexpr() 3519 a, b = _coerce_exprs(self, other)
3520 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 3381 of file z3py.py.
3381 def __invert__(self):
3382 """Create the Z3 expression bitwise-not `~self`. 3384 >>> x = BitVec('x', 32) 3390 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 3474 of file z3py.py.
3474 def __le__(self, other):
3475 """Create the Z3 expression (signed) `other <= self`. 3477 Use the function ULE() for unsigned less than or equal to. 3479 >>> x, y = BitVecs('x y', 32) 3482 >>> (x <= y).sexpr() 3484 >>> ULE(x, y).sexpr() 3487 a, b = _coerce_exprs(self, other)
3488 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 3568 of file z3py.py.
3568 def __lshift__(self, other):
3569 """Create the Z3 expression left shift `self << other` 3571 >>> x, y = BitVecs('x y', 32) 3574 >>> (x << y).sexpr() 3576 >>> simplify(BitVecVal(2, 3) << 1) 3579 a, b = _coerce_exprs(self, other)
3580 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 3490 of file z3py.py.
3490 def __lt__(self, other):
3491 """Create the Z3 expression (signed) `other < self`. 3493 Use the function ULT() for unsigned less than. 3495 >>> x, y = BitVecs('x y', 32) 3500 >>> ULT(x, y).sexpr() 3503 a, b = _coerce_exprs(self, other)
3504 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 3435 of file z3py.py.
3435 def __mod__(self, other):
3436 """Create the Z3 expression (signed) mod `self % other`. 3438 Use the function URem() for unsigned remainder, and SRem() for signed remainder. 3440 >>> x = BitVec('x', 32) 3441 >>> y = BitVec('y', 32) 3448 >>> URem(x, y).sexpr() 3450 >>> SRem(x, y).sexpr() 3453 a, b = _coerce_exprs(self, other)
3454 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 3246 of file z3py.py.
3246 def __mul__(self, other):
3247 """Create the Z3 expression `self * other`. 3249 >>> x = BitVec('x', 32) 3250 >>> y = BitVec('y', 32) 3256 a, b = _coerce_exprs(self, other)
3257 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 3370 of file z3py.py.
3371 """Return an expression representing `-self`. 3373 >>> x = BitVec('x', 32) 3379 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 3292 of file z3py.py.
3292 def __or__(self, other):
3293 """Create the Z3 expression bitwise-or `self | other`. 3295 >>> x = BitVec('x', 32) 3296 >>> y = BitVec('y', 32) 3302 a, b = _coerce_exprs(self, other)
3303 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 3361 of file z3py.py.
3364 >>> 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 3236 of file z3py.py.
3236 def __radd__(self, other):
3237 """Create the Z3 expression `other + self`. 3239 >>> x = BitVec('x', 32) 3243 a, b = _coerce_exprs(self, other)
3244 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 3328 of file z3py.py.
3328 def __rand__(self, other):
3329 """Create the Z3 expression bitwise-or `other & self`. 3331 >>> x = BitVec('x', 32) 3335 a, b = _coerce_exprs(self, other)
3336 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 3415 of file z3py.py.
3415 def __rdiv__(self, other):
3416 """Create the Z3 expression (signed) division `other / self`. 3418 Use the function UDiv() for unsigned division. 3420 >>> x = BitVec('x', 32) 3423 >>> (10 / x).sexpr() 3424 '(bvsdiv #x0000000a x)' 3425 >>> UDiv(10, x).sexpr() 3426 '(bvudiv #x0000000a x)' 3428 a, b = _coerce_exprs(self, other)
3429 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 3596 of file z3py.py.
3596 def __rlshift__(self, other):
3597 """Create the Z3 expression left shift `other << self`. 3599 Use the function LShR() for the right logical shift 3601 >>> x = BitVec('x', 32) 3604 >>> (10 << x).sexpr() 3605 '(bvshl #x0000000a x)' 3607 a, b = _coerce_exprs(self, other)
3608 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 3456 of file z3py.py.
3456 def __rmod__(self, other):
3457 """Create the Z3 expression (signed) mod `other % self`. 3459 Use the function URem() for unsigned remainder, and SRem() for signed remainder. 3461 >>> x = BitVec('x', 32) 3464 >>> (10 % x).sexpr() 3465 '(bvsmod #x0000000a x)' 3466 >>> URem(10, x).sexpr() 3467 '(bvurem #x0000000a x)' 3468 >>> SRem(10, x).sexpr() 3469 '(bvsrem #x0000000a x)' 3471 a, b = _coerce_exprs(self, other)
3472 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 3259 of file z3py.py.
3259 def __rmul__(self, other):
3260 """Create the Z3 expression `other * self`. 3262 >>> x = BitVec('x', 32) 3266 a, b = _coerce_exprs(self, other)
3267 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 3305 of file z3py.py.
3305 def __ror__(self, other):
3306 """Create the Z3 expression bitwise-or `other | self`. 3308 >>> x = BitVec('x', 32) 3312 a, b = _coerce_exprs(self, other)
3313 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 3582 of file z3py.py.
3582 def __rrshift__(self, other):
3583 """Create the Z3 expression (arithmetical) right shift `other` >> `self`. 3585 Use the function LShR() for the right logical shift 3587 >>> x = BitVec('x', 32) 3590 >>> (10 >> x).sexpr() 3591 '(bvashr #x0000000a x)' 3593 a, b = _coerce_exprs(self, other)
3594 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 3538 of file z3py.py.
3538 def __rshift__(self, other):
3539 """Create the Z3 expression (arithmetical) right shift `self >> other` 3541 Use the function LShR() for the right logical shift 3543 >>> x, y = BitVecs('x y', 32) 3546 >>> (x >> y).sexpr() 3548 >>> LShR(x, y).sexpr() 3552 >>> BitVecVal(4, 3).as_signed_long() 3554 >>> simplify(BitVecVal(4, 3) >> 1).as_signed_long() 3556 >>> simplify(BitVecVal(4, 3) >> 1) 3558 >>> simplify(LShR(BitVecVal(4, 3), 1)) 3560 >>> simplify(BitVecVal(2, 3) >> 1) 3562 >>> simplify(LShR(BitVecVal(2, 3), 1)) 3565 a, b = _coerce_exprs(self, other)
3566 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 3282 of file z3py.py.
3282 def __rsub__(self, other):
3283 """Create the Z3 expression `other - self`. 3285 >>> x = BitVec('x', 32) 3289 a, b = _coerce_exprs(self, other)
3290 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 3431 of file z3py.py.
3431 def __rtruediv__(self, other):
3432 """Create the Z3 expression (signed) division `other / self`.""" 3433 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 3351 of file z3py.py.
3351 def __rxor__(self, other):
3352 """Create the Z3 expression bitwise-xor `other ^ self`. 3354 >>> x = BitVec('x', 32) 3358 a, b = _coerce_exprs(self, other)
3359 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 3269 of file z3py.py.
3269 def __sub__(self, other):
3270 """Create the Z3 expression `self - other`. 3272 >>> x = BitVec('x', 32) 3273 >>> y = BitVec('y', 32) 3279 a, b = _coerce_exprs(self, other)
3280 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 3411 of file z3py.py.
3411 def __truediv__(self, other):
3412 """Create the Z3 expression (signed) division `self / other`.""" 3413 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 3338 of file z3py.py.
3338 def __xor__(self, other):
3339 """Create the Z3 expression bitwise-xor `self ^ other`. 3341 >>> x = BitVec('x', 32) 3342 >>> y = BitVec('y', 32) 3348 a, b = _coerce_exprs(self, other)
3349 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 3212 of file z3py.py.
3213 """Return the number of bits of the bit-vector expression `self`. 3215 >>> x = BitVec('x', 32) 3218 >>> Concat(x, x).size() 3221 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 3201 of file z3py.py.
Referenced by BitVecRef.__add__(), BitVecRef.__and__(), BitVecRef.__div__(), BitVecRef.__mod__(), BitVecRef.__mul__(), BitVecRef.__or__(), BitVecRef.__sub__(), and BitVecRef.__xor__().
3202 """Return the sort of the bit-vector expression `self`. 3204 >>> x = BitVec('x', 32) 3207 >>> x.sort() == BitVecSort(32) 3210 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.