|
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 | decl (self) |
|
def | num_args (self) |
|
def | arg (self, idx) |
|
def | children (self) |
|
def | __init__ (self, ast, ctx=None) |
|
def | __del__ (self) |
|
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 3030 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 3055 of file z3py.py.
3055 def __add__(self, other):
3056 """Create the Z3 expression `self + other`. 3058 >>> x = BitVec('x', 32) 3059 >>> y = BitVec('y', 32) 3065 a, b = _coerce_exprs(self, other)
3066 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 3147 of file z3py.py.
3147 def __and__(self, other):
3148 """Create the Z3 expression bitwise-and `self & other`. 3150 >>> x = BitVec('x', 32) 3151 >>> y = BitVec('y', 32) 3157 a, b = _coerce_exprs(self, other)
3158 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 3224 of file z3py.py.
3224 def __div__(self, other):
3225 """Create the Z3 expression (signed) division `self / other`. 3227 Use the function UDiv() for unsigned division. 3229 >>> x = BitVec('x', 32) 3230 >>> y = BitVec('y', 32) 3237 >>> UDiv(x, y).sexpr() 3240 a, b = _coerce_exprs(self, other)
3241 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 3354 of file z3py.py.
3354 def __ge__(self, other):
3355 """Create the Z3 expression (signed) `other >= self`. 3357 Use the function UGE() for unsigned greater than or equal to. 3359 >>> x, y = BitVecs('x y', 32) 3362 >>> (x >= y).sexpr() 3364 >>> UGE(x, y).sexpr() 3367 a, b = _coerce_exprs(self, other)
3368 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 3338 of file z3py.py.
3338 def __gt__(self, other):
3339 """Create the Z3 expression (signed) `other > self`. 3341 Use the function UGT() for unsigned greater than. 3343 >>> x, y = BitVecs('x y', 32) 3348 >>> UGT(x, y).sexpr() 3351 a, b = _coerce_exprs(self, other)
3352 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 3213 of file z3py.py.
3213 def __invert__(self):
3214 """Create the Z3 expression bitwise-not `~self`. 3216 >>> x = BitVec('x', 32) 3222 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 3306 of file z3py.py.
3306 def __le__(self, other):
3307 """Create the Z3 expression (signed) `other <= self`. 3309 Use the function ULE() for unsigned less than or equal to. 3311 >>> x, y = BitVecs('x y', 32) 3314 >>> (x <= y).sexpr() 3316 >>> ULE(x, y).sexpr() 3319 a, b = _coerce_exprs(self, other)
3320 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 3400 of file z3py.py.
3400 def __lshift__(self, other):
3401 """Create the Z3 expression left shift `self << other` 3403 >>> x, y = BitVecs('x y', 32) 3406 >>> (x << y).sexpr() 3408 >>> simplify(BitVecVal(2, 3) << 1) 3411 a, b = _coerce_exprs(self, other)
3412 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 3322 of file z3py.py.
3322 def __lt__(self, other):
3323 """Create the Z3 expression (signed) `other < self`. 3325 Use the function ULT() for unsigned less than. 3327 >>> x, y = BitVecs('x y', 32) 3332 >>> ULT(x, y).sexpr() 3335 a, b = _coerce_exprs(self, other)
3336 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 3267 of file z3py.py.
3267 def __mod__(self, other):
3268 """Create the Z3 expression (signed) mod `self % other`. 3270 Use the function URem() for unsigned remainder, and SRem() for signed remainder. 3272 >>> x = BitVec('x', 32) 3273 >>> y = BitVec('y', 32) 3280 >>> URem(x, y).sexpr() 3282 >>> SRem(x, y).sexpr() 3285 a, b = _coerce_exprs(self, other)
3286 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 3078 of file z3py.py.
3078 def __mul__(self, other):
3079 """Create the Z3 expression `self * other`. 3081 >>> x = BitVec('x', 32) 3082 >>> y = BitVec('y', 32) 3088 a, b = _coerce_exprs(self, other)
3089 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 3202 of file z3py.py.
3203 """Return an expression representing `-self`. 3205 >>> x = BitVec('x', 32) 3211 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 3124 of file z3py.py.
3124 def __or__(self, other):
3125 """Create the Z3 expression bitwise-or `self | other`. 3127 >>> x = BitVec('x', 32) 3128 >>> y = BitVec('y', 32) 3134 a, b = _coerce_exprs(self, other)
3135 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 3193 of file z3py.py.
3196 >>> 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 3068 of file z3py.py.
3068 def __radd__(self, other):
3069 """Create the Z3 expression `other + self`. 3071 >>> x = BitVec('x', 32) 3075 a, b = _coerce_exprs(self, other)
3076 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 3160 of file z3py.py.
3160 def __rand__(self, other):
3161 """Create the Z3 expression bitwise-or `other & self`. 3163 >>> x = BitVec('x', 32) 3167 a, b = _coerce_exprs(self, other)
3168 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 3247 of file z3py.py.
3247 def __rdiv__(self, other):
3248 """Create the Z3 expression (signed) division `other / self`. 3250 Use the function UDiv() for unsigned division. 3252 >>> x = BitVec('x', 32) 3255 >>> (10 / x).sexpr() 3256 '(bvsdiv #x0000000a x)' 3257 >>> UDiv(10, x).sexpr() 3258 '(bvudiv #x0000000a x)' 3260 a, b = _coerce_exprs(self, other)
3261 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 3428 of file z3py.py.
3428 def __rlshift__(self, other):
3429 """Create the Z3 expression left shift `other << self`. 3431 Use the function LShR() for the right logical shift 3433 >>> x = BitVec('x', 32) 3436 >>> (10 << x).sexpr() 3437 '(bvshl #x0000000a x)' 3439 a, b = _coerce_exprs(self, other)
3440 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 3288 of file z3py.py.
3288 def __rmod__(self, other):
3289 """Create the Z3 expression (signed) mod `other % self`. 3291 Use the function URem() for unsigned remainder, and SRem() for signed remainder. 3293 >>> x = BitVec('x', 32) 3296 >>> (10 % x).sexpr() 3297 '(bvsmod #x0000000a x)' 3298 >>> URem(10, x).sexpr() 3299 '(bvurem #x0000000a x)' 3300 >>> SRem(10, x).sexpr() 3301 '(bvsrem #x0000000a x)' 3303 a, b = _coerce_exprs(self, other)
3304 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 3091 of file z3py.py.
3091 def __rmul__(self, other):
3092 """Create the Z3 expression `other * self`. 3094 >>> x = BitVec('x', 32) 3098 a, b = _coerce_exprs(self, other)
3099 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 3137 of file z3py.py.
3137 def __ror__(self, other):
3138 """Create the Z3 expression bitwise-or `other | self`. 3140 >>> x = BitVec('x', 32) 3144 a, b = _coerce_exprs(self, other)
3145 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 3414 of file z3py.py.
3414 def __rrshift__(self, other):
3415 """Create the Z3 expression (arithmetical) right shift `other` >> `self`. 3417 Use the function LShR() for the right logical shift 3419 >>> x = BitVec('x', 32) 3422 >>> (10 >> x).sexpr() 3423 '(bvashr #x0000000a x)' 3425 a, b = _coerce_exprs(self, other)
3426 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 3370 of file z3py.py.
3370 def __rshift__(self, other):
3371 """Create the Z3 expression (arithmetical) right shift `self >> other` 3373 Use the function LShR() for the right logical shift 3375 >>> x, y = BitVecs('x y', 32) 3378 >>> (x >> y).sexpr() 3380 >>> LShR(x, y).sexpr() 3384 >>> BitVecVal(4, 3).as_signed_long() 3386 >>> simplify(BitVecVal(4, 3) >> 1).as_signed_long() 3388 >>> simplify(BitVecVal(4, 3) >> 1) 3390 >>> simplify(LShR(BitVecVal(4, 3), 1)) 3392 >>> simplify(BitVecVal(2, 3) >> 1) 3394 >>> simplify(LShR(BitVecVal(2, 3), 1)) 3397 a, b = _coerce_exprs(self, other)
3398 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 3114 of file z3py.py.
3114 def __rsub__(self, other):
3115 """Create the Z3 expression `other - self`. 3117 >>> x = BitVec('x', 32) 3121 a, b = _coerce_exprs(self, other)
3122 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 3263 of file z3py.py.
3263 def __rtruediv__(self, other):
3264 """Create the Z3 expression (signed) division `other / self`.""" 3265 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 3183 of file z3py.py.
3183 def __rxor__(self, other):
3184 """Create the Z3 expression bitwise-xor `other ^ self`. 3186 >>> x = BitVec('x', 32) 3190 a, b = _coerce_exprs(self, other)
3191 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 3101 of file z3py.py.
3101 def __sub__(self, other):
3102 """Create the Z3 expression `self - other`. 3104 >>> x = BitVec('x', 32) 3105 >>> y = BitVec('y', 32) 3111 a, b = _coerce_exprs(self, other)
3112 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 3243 of file z3py.py.
3243 def __truediv__(self, other):
3244 """Create the Z3 expression (signed) division `self / other`.""" 3245 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 3170 of file z3py.py.
3170 def __xor__(self, other):
3171 """Create the Z3 expression bitwise-xor `self ^ other`. 3173 >>> x = BitVec('x', 32) 3174 >>> y = BitVec('y', 32) 3180 a, b = _coerce_exprs(self, other)
3181 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 3044 of file z3py.py.
3045 """Return the number of bits of the bit-vector expression `self`. 3047 >>> x = BitVec('x', 32) 3050 >>> Concat(x, x).size() 3053 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 3033 of file z3py.py.
Referenced by BitVecRef.__add__(), BitVecRef.__and__(), BitVecRef.__div__(), BitVecRef.__mod__(), BitVecRef.__mul__(), BitVecRef.__or__(), BitVecRef.__sub__(), and BitVecRef.__xor__().
3034 """Return the sort of the bit-vector expression `self`. 3036 >>> x = BitVec('x', 32) 3039 >>> x.sort() == BitVecSort(32) 3042 return BitVecSortRef(Z3_get_sort(self.ctx_ref(), self.as_ast()), self.ctx)