|
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 3085 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 3110 of file z3py.py.
3110 def __add__(self, other):
3111 """Create the Z3 expression `self + other`. 3113 >>> x = BitVec('x', 32) 3114 >>> y = BitVec('y', 32) 3120 a, b = _coerce_exprs(self, other)
3121 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 3202 of file z3py.py.
3202 def __and__(self, other):
3203 """Create the Z3 expression bitwise-and `self & other`. 3205 >>> x = BitVec('x', 32) 3206 >>> y = BitVec('y', 32) 3212 a, b = _coerce_exprs(self, other)
3213 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 3279 of file z3py.py.
3279 def __div__(self, other):
3280 """Create the Z3 expression (signed) division `self / other`. 3282 Use the function UDiv() for unsigned division. 3284 >>> x = BitVec('x', 32) 3285 >>> y = BitVec('y', 32) 3292 >>> UDiv(x, y).sexpr() 3295 a, b = _coerce_exprs(self, other)
3296 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 3409 of file z3py.py.
3409 def __ge__(self, other):
3410 """Create the Z3 expression (signed) `other >= self`. 3412 Use the function UGE() for unsigned greater than or equal to. 3414 >>> x, y = BitVecs('x y', 32) 3417 >>> (x >= y).sexpr() 3419 >>> UGE(x, y).sexpr() 3422 a, b = _coerce_exprs(self, other)
3423 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 3393 of file z3py.py.
3393 def __gt__(self, other):
3394 """Create the Z3 expression (signed) `other > self`. 3396 Use the function UGT() for unsigned greater than. 3398 >>> x, y = BitVecs('x y', 32) 3403 >>> UGT(x, y).sexpr() 3406 a, b = _coerce_exprs(self, other)
3407 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 3268 of file z3py.py.
3268 def __invert__(self):
3269 """Create the Z3 expression bitwise-not `~self`. 3271 >>> x = BitVec('x', 32) 3277 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 3361 of file z3py.py.
3361 def __le__(self, other):
3362 """Create the Z3 expression (signed) `other <= self`. 3364 Use the function ULE() for unsigned less than or equal to. 3366 >>> x, y = BitVecs('x y', 32) 3369 >>> (x <= y).sexpr() 3371 >>> ULE(x, y).sexpr() 3374 a, b = _coerce_exprs(self, other)
3375 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 3455 of file z3py.py.
3455 def __lshift__(self, other):
3456 """Create the Z3 expression left shift `self << other` 3458 >>> x, y = BitVecs('x y', 32) 3461 >>> (x << y).sexpr() 3463 >>> simplify(BitVecVal(2, 3) << 1) 3466 a, b = _coerce_exprs(self, other)
3467 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 3377 of file z3py.py.
3377 def __lt__(self, other):
3378 """Create the Z3 expression (signed) `other < self`. 3380 Use the function ULT() for unsigned less than. 3382 >>> x, y = BitVecs('x y', 32) 3387 >>> ULT(x, y).sexpr() 3390 a, b = _coerce_exprs(self, other)
3391 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 3322 of file z3py.py.
3322 def __mod__(self, other):
3323 """Create the Z3 expression (signed) mod `self % other`. 3325 Use the function URem() for unsigned remainder, and SRem() for signed remainder. 3327 >>> x = BitVec('x', 32) 3328 >>> y = BitVec('y', 32) 3335 >>> URem(x, y).sexpr() 3337 >>> SRem(x, y).sexpr() 3340 a, b = _coerce_exprs(self, other)
3341 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 3133 of file z3py.py.
3133 def __mul__(self, other):
3134 """Create the Z3 expression `self * other`. 3136 >>> x = BitVec('x', 32) 3137 >>> y = BitVec('y', 32) 3143 a, b = _coerce_exprs(self, other)
3144 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 3257 of file z3py.py.
3258 """Return an expression representing `-self`. 3260 >>> x = BitVec('x', 32) 3266 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 3179 of file z3py.py.
3179 def __or__(self, other):
3180 """Create the Z3 expression bitwise-or `self | other`. 3182 >>> x = BitVec('x', 32) 3183 >>> y = BitVec('y', 32) 3189 a, b = _coerce_exprs(self, other)
3190 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 3248 of file z3py.py.
3251 >>> 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 3123 of file z3py.py.
3123 def __radd__(self, other):
3124 """Create the Z3 expression `other + self`. 3126 >>> x = BitVec('x', 32) 3130 a, b = _coerce_exprs(self, other)
3131 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 3215 of file z3py.py.
3215 def __rand__(self, other):
3216 """Create the Z3 expression bitwise-or `other & self`. 3218 >>> x = BitVec('x', 32) 3222 a, b = _coerce_exprs(self, other)
3223 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 3302 of file z3py.py.
3302 def __rdiv__(self, other):
3303 """Create the Z3 expression (signed) division `other / self`. 3305 Use the function UDiv() for unsigned division. 3307 >>> x = BitVec('x', 32) 3310 >>> (10 / x).sexpr() 3311 '(bvsdiv #x0000000a x)' 3312 >>> UDiv(10, x).sexpr() 3313 '(bvudiv #x0000000a x)' 3315 a, b = _coerce_exprs(self, other)
3316 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 3483 of file z3py.py.
3483 def __rlshift__(self, other):
3484 """Create the Z3 expression left shift `other << self`. 3486 Use the function LShR() for the right logical shift 3488 >>> x = BitVec('x', 32) 3491 >>> (10 << x).sexpr() 3492 '(bvshl #x0000000a x)' 3494 a, b = _coerce_exprs(self, other)
3495 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 3343 of file z3py.py.
3343 def __rmod__(self, other):
3344 """Create the Z3 expression (signed) mod `other % self`. 3346 Use the function URem() for unsigned remainder, and SRem() for signed remainder. 3348 >>> x = BitVec('x', 32) 3351 >>> (10 % x).sexpr() 3352 '(bvsmod #x0000000a x)' 3353 >>> URem(10, x).sexpr() 3354 '(bvurem #x0000000a x)' 3355 >>> SRem(10, x).sexpr() 3356 '(bvsrem #x0000000a x)' 3358 a, b = _coerce_exprs(self, other)
3359 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 3146 of file z3py.py.
3146 def __rmul__(self, other):
3147 """Create the Z3 expression `other * self`. 3149 >>> x = BitVec('x', 32) 3153 a, b = _coerce_exprs(self, other)
3154 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 3192 of file z3py.py.
3192 def __ror__(self, other):
3193 """Create the Z3 expression bitwise-or `other | self`. 3195 >>> x = BitVec('x', 32) 3199 a, b = _coerce_exprs(self, other)
3200 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 3469 of file z3py.py.
3469 def __rrshift__(self, other):
3470 """Create the Z3 expression (arithmetical) right shift `other` >> `self`. 3472 Use the function LShR() for the right logical shift 3474 >>> x = BitVec('x', 32) 3477 >>> (10 >> x).sexpr() 3478 '(bvashr #x0000000a x)' 3480 a, b = _coerce_exprs(self, other)
3481 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 3425 of file z3py.py.
3425 def __rshift__(self, other):
3426 """Create the Z3 expression (arithmetical) right shift `self >> other` 3428 Use the function LShR() for the right logical shift 3430 >>> x, y = BitVecs('x y', 32) 3433 >>> (x >> y).sexpr() 3435 >>> LShR(x, y).sexpr() 3439 >>> BitVecVal(4, 3).as_signed_long() 3441 >>> simplify(BitVecVal(4, 3) >> 1).as_signed_long() 3443 >>> simplify(BitVecVal(4, 3) >> 1) 3445 >>> simplify(LShR(BitVecVal(4, 3), 1)) 3447 >>> simplify(BitVecVal(2, 3) >> 1) 3449 >>> simplify(LShR(BitVecVal(2, 3), 1)) 3452 a, b = _coerce_exprs(self, other)
3453 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 3169 of file z3py.py.
3169 def __rsub__(self, other):
3170 """Create the Z3 expression `other - self`. 3172 >>> x = BitVec('x', 32) 3176 a, b = _coerce_exprs(self, other)
3177 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 3318 of file z3py.py.
3318 def __rtruediv__(self, other):
3319 """Create the Z3 expression (signed) division `other / self`.""" 3320 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 3238 of file z3py.py.
3238 def __rxor__(self, other):
3239 """Create the Z3 expression bitwise-xor `other ^ self`. 3241 >>> x = BitVec('x', 32) 3245 a, b = _coerce_exprs(self, other)
3246 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 3156 of file z3py.py.
3156 def __sub__(self, other):
3157 """Create the Z3 expression `self - other`. 3159 >>> x = BitVec('x', 32) 3160 >>> y = BitVec('y', 32) 3166 a, b = _coerce_exprs(self, other)
3167 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 3298 of file z3py.py.
3298 def __truediv__(self, other):
3299 """Create the Z3 expression (signed) division `self / other`.""" 3300 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 3225 of file z3py.py.
3225 def __xor__(self, other):
3226 """Create the Z3 expression bitwise-xor `self ^ other`. 3228 >>> x = BitVec('x', 32) 3229 >>> y = BitVec('y', 32) 3235 a, b = _coerce_exprs(self, other)
3236 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 3099 of file z3py.py.
3100 """Return the number of bits of the bit-vector expression `self`. 3102 >>> x = BitVec('x', 32) 3105 >>> Concat(x, x).size() 3108 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 3088 of file z3py.py.
Referenced by BitVecRef.__add__(), BitVecRef.__and__(), BitVecRef.__div__(), BitVecRef.__mod__(), BitVecRef.__mul__(), BitVecRef.__or__(), BitVecRef.__sub__(), and BitVecRef.__xor__().
3089 """Return the sort of the bit-vector expression `self`. 3091 >>> x = BitVec('x', 32) 3094 >>> x.sort() == BitVecSort(32) 3097 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.