|
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 3215 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 3240 of file z3py.py.
3240 def __add__(self, other):
3241 """Create the Z3 expression `self + other`. 3243 >>> x = BitVec('x', 32) 3244 >>> y = BitVec('y', 32) 3250 a, b = _coerce_exprs(self, other)
3251 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 3332 of file z3py.py.
3332 def __and__(self, other):
3333 """Create the Z3 expression bitwise-and `self & other`. 3335 >>> x = BitVec('x', 32) 3336 >>> y = BitVec('y', 32) 3342 a, b = _coerce_exprs(self, other)
3343 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 3409 of file z3py.py.
3409 def __div__(self, other):
3410 """Create the Z3 expression (signed) division `self / other`. 3412 Use the function UDiv() for unsigned division. 3414 >>> x = BitVec('x', 32) 3415 >>> y = BitVec('y', 32) 3422 >>> UDiv(x, y).sexpr() 3425 a, b = _coerce_exprs(self, other)
3426 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 3539 of file z3py.py.
3539 def __ge__(self, other):
3540 """Create the Z3 expression (signed) `other >= self`. 3542 Use the function UGE() for unsigned greater than or equal to. 3544 >>> x, y = BitVecs('x y', 32) 3547 >>> (x >= y).sexpr() 3549 >>> UGE(x, y).sexpr() 3552 a, b = _coerce_exprs(self, other)
3553 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 3523 of file z3py.py.
3523 def __gt__(self, other):
3524 """Create the Z3 expression (signed) `other > self`. 3526 Use the function UGT() for unsigned greater than. 3528 >>> x, y = BitVecs('x y', 32) 3533 >>> UGT(x, y).sexpr() 3536 a, b = _coerce_exprs(self, other)
3537 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 3398 of file z3py.py.
3398 def __invert__(self):
3399 """Create the Z3 expression bitwise-not `~self`. 3401 >>> x = BitVec('x', 32) 3407 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 3491 of file z3py.py.
3491 def __le__(self, other):
3492 """Create the Z3 expression (signed) `other <= self`. 3494 Use the function ULE() for unsigned less than or equal to. 3496 >>> x, y = BitVecs('x y', 32) 3499 >>> (x <= y).sexpr() 3501 >>> ULE(x, y).sexpr() 3504 a, b = _coerce_exprs(self, other)
3505 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 3585 of file z3py.py.
3585 def __lshift__(self, other):
3586 """Create the Z3 expression left shift `self << other` 3588 >>> x, y = BitVecs('x y', 32) 3591 >>> (x << y).sexpr() 3593 >>> simplify(BitVecVal(2, 3) << 1) 3596 a, b = _coerce_exprs(self, other)
3597 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 3507 of file z3py.py.
3507 def __lt__(self, other):
3508 """Create the Z3 expression (signed) `other < self`. 3510 Use the function ULT() for unsigned less than. 3512 >>> x, y = BitVecs('x y', 32) 3517 >>> ULT(x, y).sexpr() 3520 a, b = _coerce_exprs(self, other)
3521 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 3452 of file z3py.py.
3452 def __mod__(self, other):
3453 """Create the Z3 expression (signed) mod `self % other`. 3455 Use the function URem() for unsigned remainder, and SRem() for signed remainder. 3457 >>> x = BitVec('x', 32) 3458 >>> y = BitVec('y', 32) 3465 >>> URem(x, y).sexpr() 3467 >>> SRem(x, y).sexpr() 3470 a, b = _coerce_exprs(self, other)
3471 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 3263 of file z3py.py.
3263 def __mul__(self, other):
3264 """Create the Z3 expression `self * other`. 3266 >>> x = BitVec('x', 32) 3267 >>> y = BitVec('y', 32) 3273 a, b = _coerce_exprs(self, other)
3274 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 3387 of file z3py.py.
3388 """Return an expression representing `-self`. 3390 >>> x = BitVec('x', 32) 3396 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 3309 of file z3py.py.
3309 def __or__(self, other):
3310 """Create the Z3 expression bitwise-or `self | other`. 3312 >>> x = BitVec('x', 32) 3313 >>> y = BitVec('y', 32) 3319 a, b = _coerce_exprs(self, other)
3320 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 3378 of file z3py.py.
3381 >>> 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 3253 of file z3py.py.
3253 def __radd__(self, other):
3254 """Create the Z3 expression `other + self`. 3256 >>> x = BitVec('x', 32) 3260 a, b = _coerce_exprs(self, other)
3261 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 3345 of file z3py.py.
3345 def __rand__(self, other):
3346 """Create the Z3 expression bitwise-or `other & self`. 3348 >>> x = BitVec('x', 32) 3352 a, b = _coerce_exprs(self, other)
3353 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 3432 of file z3py.py.
3432 def __rdiv__(self, other):
3433 """Create the Z3 expression (signed) division `other / self`. 3435 Use the function UDiv() for unsigned division. 3437 >>> x = BitVec('x', 32) 3440 >>> (10 / x).sexpr() 3441 '(bvsdiv #x0000000a x)' 3442 >>> UDiv(10, x).sexpr() 3443 '(bvudiv #x0000000a x)' 3445 a, b = _coerce_exprs(self, other)
3446 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 3613 of file z3py.py.
3613 def __rlshift__(self, other):
3614 """Create the Z3 expression left shift `other << self`. 3616 Use the function LShR() for the right logical shift 3618 >>> x = BitVec('x', 32) 3621 >>> (10 << x).sexpr() 3622 '(bvshl #x0000000a x)' 3624 a, b = _coerce_exprs(self, other)
3625 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 3473 of file z3py.py.
3473 def __rmod__(self, other):
3474 """Create the Z3 expression (signed) mod `other % self`. 3476 Use the function URem() for unsigned remainder, and SRem() for signed remainder. 3478 >>> x = BitVec('x', 32) 3481 >>> (10 % x).sexpr() 3482 '(bvsmod #x0000000a x)' 3483 >>> URem(10, x).sexpr() 3484 '(bvurem #x0000000a x)' 3485 >>> SRem(10, x).sexpr() 3486 '(bvsrem #x0000000a x)' 3488 a, b = _coerce_exprs(self, other)
3489 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 3276 of file z3py.py.
3276 def __rmul__(self, other):
3277 """Create the Z3 expression `other * self`. 3279 >>> x = BitVec('x', 32) 3283 a, b = _coerce_exprs(self, other)
3284 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 3322 of file z3py.py.
3322 def __ror__(self, other):
3323 """Create the Z3 expression bitwise-or `other | self`. 3325 >>> x = BitVec('x', 32) 3329 a, b = _coerce_exprs(self, other)
3330 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 3599 of file z3py.py.
3599 def __rrshift__(self, other):
3600 """Create the Z3 expression (arithmetical) right shift `other` >> `self`. 3602 Use the function LShR() for the right logical shift 3604 >>> x = BitVec('x', 32) 3607 >>> (10 >> x).sexpr() 3608 '(bvashr #x0000000a x)' 3610 a, b = _coerce_exprs(self, other)
3611 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 3555 of file z3py.py.
3555 def __rshift__(self, other):
3556 """Create the Z3 expression (arithmetical) right shift `self >> other` 3558 Use the function LShR() for the right logical shift 3560 >>> x, y = BitVecs('x y', 32) 3563 >>> (x >> y).sexpr() 3565 >>> LShR(x, y).sexpr() 3569 >>> BitVecVal(4, 3).as_signed_long() 3571 >>> simplify(BitVecVal(4, 3) >> 1).as_signed_long() 3573 >>> simplify(BitVecVal(4, 3) >> 1) 3575 >>> simplify(LShR(BitVecVal(4, 3), 1)) 3577 >>> simplify(BitVecVal(2, 3) >> 1) 3579 >>> simplify(LShR(BitVecVal(2, 3), 1)) 3582 a, b = _coerce_exprs(self, other)
3583 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 3299 of file z3py.py.
3299 def __rsub__(self, other):
3300 """Create the Z3 expression `other - self`. 3302 >>> x = BitVec('x', 32) 3306 a, b = _coerce_exprs(self, other)
3307 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 3448 of file z3py.py.
3448 def __rtruediv__(self, other):
3449 """Create the Z3 expression (signed) division `other / self`.""" 3450 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 3368 of file z3py.py.
3368 def __rxor__(self, other):
3369 """Create the Z3 expression bitwise-xor `other ^ self`. 3371 >>> x = BitVec('x', 32) 3375 a, b = _coerce_exprs(self, other)
3376 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 3286 of file z3py.py.
3286 def __sub__(self, other):
3287 """Create the Z3 expression `self - other`. 3289 >>> x = BitVec('x', 32) 3290 >>> y = BitVec('y', 32) 3296 a, b = _coerce_exprs(self, other)
3297 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 3428 of file z3py.py.
3428 def __truediv__(self, other):
3429 """Create the Z3 expression (signed) division `self / other`.""" 3430 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 3355 of file z3py.py.
3355 def __xor__(self, other):
3356 """Create the Z3 expression bitwise-xor `self ^ other`. 3358 >>> x = BitVec('x', 32) 3359 >>> y = BitVec('y', 32) 3365 a, b = _coerce_exprs(self, other)
3366 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 3229 of file z3py.py.
3230 """Return the number of bits of the bit-vector expression `self`. 3232 >>> x = BitVec('x', 32) 3235 >>> Concat(x, x).size() 3238 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 3218 of file z3py.py.
Referenced by BitVecRef.__add__(), BitVecRef.__and__(), BitVecRef.__div__(), BitVecRef.__mod__(), BitVecRef.__mul__(), BitVecRef.__or__(), BitVecRef.__sub__(), and BitVecRef.__xor__().
3219 """Return the sort of the bit-vector expression `self`. 3221 >>> x = BitVec('x', 32) 3224 >>> x.sort() == BitVecSort(32) 3227 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.