|
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 | hash (self) |
|
def | use_pp (self) |
|
Bit-vector expressions.
Definition at line 3071 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 3096 of file z3py.py.
3096 def __add__(self, other):
3097 """Create the Z3 expression `self + other`. 3099 >>> x = BitVec('x', 32) 3100 >>> y = BitVec('y', 32) 3106 a, b = _coerce_exprs(self, other)
3107 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 3188 of file z3py.py.
3188 def __and__(self, other):
3189 """Create the Z3 expression bitwise-and `self & other`. 3191 >>> x = BitVec('x', 32) 3192 >>> y = BitVec('y', 32) 3198 a, b = _coerce_exprs(self, other)
3199 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 3265 of file z3py.py.
3265 def __div__(self, other):
3266 """Create the Z3 expression (signed) division `self / other`. 3268 Use the function UDiv() for unsigned division. 3270 >>> x = BitVec('x', 32) 3271 >>> y = BitVec('y', 32) 3278 >>> UDiv(x, y).sexpr() 3281 a, b = _coerce_exprs(self, other)
3282 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 3395 of file z3py.py.
3395 def __ge__(self, other):
3396 """Create the Z3 expression (signed) `other >= self`. 3398 Use the function UGE() for unsigned greater than or equal to. 3400 >>> x, y = BitVecs('x y', 32) 3403 >>> (x >= y).sexpr() 3405 >>> UGE(x, y).sexpr() 3408 a, b = _coerce_exprs(self, other)
3409 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 3379 of file z3py.py.
3379 def __gt__(self, other):
3380 """Create the Z3 expression (signed) `other > self`. 3382 Use the function UGT() for unsigned greater than. 3384 >>> x, y = BitVecs('x y', 32) 3389 >>> UGT(x, y).sexpr() 3392 a, b = _coerce_exprs(self, other)
3393 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 3254 of file z3py.py.
3254 def __invert__(self):
3255 """Create the Z3 expression bitwise-not `~self`. 3257 >>> x = BitVec('x', 32) 3263 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 3347 of file z3py.py.
3347 def __le__(self, other):
3348 """Create the Z3 expression (signed) `other <= self`. 3350 Use the function ULE() for unsigned less than or equal to. 3352 >>> x, y = BitVecs('x y', 32) 3355 >>> (x <= y).sexpr() 3357 >>> ULE(x, y).sexpr() 3360 a, b = _coerce_exprs(self, other)
3361 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 3441 of file z3py.py.
3441 def __lshift__(self, other):
3442 """Create the Z3 expression left shift `self << other` 3444 >>> x, y = BitVecs('x y', 32) 3447 >>> (x << y).sexpr() 3449 >>> simplify(BitVecVal(2, 3) << 1) 3452 a, b = _coerce_exprs(self, other)
3453 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 3363 of file z3py.py.
3363 def __lt__(self, other):
3364 """Create the Z3 expression (signed) `other < self`. 3366 Use the function ULT() for unsigned less than. 3368 >>> x, y = BitVecs('x y', 32) 3373 >>> ULT(x, y).sexpr() 3376 a, b = _coerce_exprs(self, other)
3377 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 3308 of file z3py.py.
3308 def __mod__(self, other):
3309 """Create the Z3 expression (signed) mod `self % other`. 3311 Use the function URem() for unsigned remainder, and SRem() for signed remainder. 3313 >>> x = BitVec('x', 32) 3314 >>> y = BitVec('y', 32) 3321 >>> URem(x, y).sexpr() 3323 >>> SRem(x, y).sexpr() 3326 a, b = _coerce_exprs(self, other)
3327 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 3119 of file z3py.py.
3119 def __mul__(self, other):
3120 """Create the Z3 expression `self * other`. 3122 >>> x = BitVec('x', 32) 3123 >>> y = BitVec('y', 32) 3129 a, b = _coerce_exprs(self, other)
3130 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 3243 of file z3py.py.
3244 """Return an expression representing `-self`. 3246 >>> x = BitVec('x', 32) 3252 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 3165 of file z3py.py.
3165 def __or__(self, other):
3166 """Create the Z3 expression bitwise-or `self | other`. 3168 >>> x = BitVec('x', 32) 3169 >>> y = BitVec('y', 32) 3175 a, b = _coerce_exprs(self, other)
3176 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 3234 of file z3py.py.
3237 >>> 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 3109 of file z3py.py.
3109 def __radd__(self, other):
3110 """Create the Z3 expression `other + self`. 3112 >>> x = BitVec('x', 32) 3116 a, b = _coerce_exprs(self, other)
3117 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 3201 of file z3py.py.
3201 def __rand__(self, other):
3202 """Create the Z3 expression bitwise-or `other & self`. 3204 >>> x = BitVec('x', 32) 3208 a, b = _coerce_exprs(self, other)
3209 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 3288 of file z3py.py.
3288 def __rdiv__(self, other):
3289 """Create the Z3 expression (signed) division `other / self`. 3291 Use the function UDiv() for unsigned division. 3293 >>> x = BitVec('x', 32) 3296 >>> (10 / x).sexpr() 3297 '(bvsdiv #x0000000a x)' 3298 >>> UDiv(10, x).sexpr() 3299 '(bvudiv #x0000000a x)' 3301 a, b = _coerce_exprs(self, other)
3302 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 3469 of file z3py.py.
3469 def __rlshift__(self, other):
3470 """Create the Z3 expression left shift `other << self`. 3472 Use the function LShR() for the right logical shift 3474 >>> x = BitVec('x', 32) 3477 >>> (10 << x).sexpr() 3478 '(bvshl #x0000000a x)' 3480 a, b = _coerce_exprs(self, other)
3481 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 3329 of file z3py.py.
3329 def __rmod__(self, other):
3330 """Create the Z3 expression (signed) mod `other % self`. 3332 Use the function URem() for unsigned remainder, and SRem() for signed remainder. 3334 >>> x = BitVec('x', 32) 3337 >>> (10 % x).sexpr() 3338 '(bvsmod #x0000000a x)' 3339 >>> URem(10, x).sexpr() 3340 '(bvurem #x0000000a x)' 3341 >>> SRem(10, x).sexpr() 3342 '(bvsrem #x0000000a x)' 3344 a, b = _coerce_exprs(self, other)
3345 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 3132 of file z3py.py.
3132 def __rmul__(self, other):
3133 """Create the Z3 expression `other * self`. 3135 >>> x = BitVec('x', 32) 3139 a, b = _coerce_exprs(self, other)
3140 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 3178 of file z3py.py.
3178 def __ror__(self, other):
3179 """Create the Z3 expression bitwise-or `other | self`. 3181 >>> x = BitVec('x', 32) 3185 a, b = _coerce_exprs(self, other)
3186 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 3455 of file z3py.py.
3455 def __rrshift__(self, other):
3456 """Create the Z3 expression (arithmetical) right shift `other` >> `self`. 3458 Use the function LShR() for the right logical shift 3460 >>> x = BitVec('x', 32) 3463 >>> (10 >> x).sexpr() 3464 '(bvashr #x0000000a x)' 3466 a, b = _coerce_exprs(self, other)
3467 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 3411 of file z3py.py.
3411 def __rshift__(self, other):
3412 """Create the Z3 expression (arithmetical) right shift `self >> other` 3414 Use the function LShR() for the right logical shift 3416 >>> x, y = BitVecs('x y', 32) 3419 >>> (x >> y).sexpr() 3421 >>> LShR(x, y).sexpr() 3425 >>> BitVecVal(4, 3).as_signed_long() 3427 >>> simplify(BitVecVal(4, 3) >> 1).as_signed_long() 3429 >>> simplify(BitVecVal(4, 3) >> 1) 3431 >>> simplify(LShR(BitVecVal(4, 3), 1)) 3433 >>> simplify(BitVecVal(2, 3) >> 1) 3435 >>> simplify(LShR(BitVecVal(2, 3), 1)) 3438 a, b = _coerce_exprs(self, other)
3439 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 3155 of file z3py.py.
3155 def __rsub__(self, other):
3156 """Create the Z3 expression `other - self`. 3158 >>> x = BitVec('x', 32) 3162 a, b = _coerce_exprs(self, other)
3163 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 3304 of file z3py.py.
3304 def __rtruediv__(self, other):
3305 """Create the Z3 expression (signed) division `other / self`.""" 3306 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 3224 of file z3py.py.
3224 def __rxor__(self, other):
3225 """Create the Z3 expression bitwise-xor `other ^ self`. 3227 >>> x = BitVec('x', 32) 3231 a, b = _coerce_exprs(self, other)
3232 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 3142 of file z3py.py.
3142 def __sub__(self, other):
3143 """Create the Z3 expression `self - other`. 3145 >>> x = BitVec('x', 32) 3146 >>> y = BitVec('y', 32) 3152 a, b = _coerce_exprs(self, other)
3153 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 3284 of file z3py.py.
3284 def __truediv__(self, other):
3285 """Create the Z3 expression (signed) division `self / other`.""" 3286 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 3211 of file z3py.py.
3211 def __xor__(self, other):
3212 """Create the Z3 expression bitwise-xor `self ^ other`. 3214 >>> x = BitVec('x', 32) 3215 >>> y = BitVec('y', 32) 3221 a, b = _coerce_exprs(self, other)
3222 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 3085 of file z3py.py.
3086 """Return the number of bits of the bit-vector expression `self`. 3088 >>> x = BitVec('x', 32) 3091 >>> Concat(x, x).size() 3094 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 3074 of file z3py.py.
Referenced by BitVecRef.__add__(), BitVecRef.__and__(), BitVecRef.__div__(), BitVecRef.__mod__(), BitVecRef.__mul__(), BitVecRef.__or__(), BitVecRef.__sub__(), and BitVecRef.__xor__().
3075 """Return the sort of the bit-vector expression `self`. 3077 >>> x = BitVec('x', 32) 3080 >>> x.sort() == BitVecSort(32) 3083 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.