|
| def | sort (self) |
| |
| def | ebits (self) |
| |
| def | sbits (self) |
| |
| def | as_string (self) |
| |
| def | __le__ (self, other) |
| |
| def | __lt__ (self, other) |
| |
| def | __ge__ (self, other) |
| |
| def | __gt__ (self, other) |
| |
| def | __add__ (self, other) |
| |
| def | __radd__ (self, other) |
| |
| def | __sub__ (self, other) |
| |
| def | __rsub__ (self, other) |
| |
| def | __mul__ (self, other) |
| |
| def | __rmul__ (self, other) |
| |
| def | __pos__ (self) |
| |
| def | __neg__ (self) |
| |
| def | __div__ (self, other) |
| |
| def | __rdiv__ (self, other) |
| |
| def | __truediv__ (self, other) |
| |
| def | __rtruediv__ (self, other) |
| |
| def | __mod__ (self, other) |
| |
| def | __rmod__ (self, other) |
| |
| def | as_ast (self) |
| |
| def | get_id (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 | __nonzero__ (self) |
| |
| def | __bool__ (self) |
| |
| def | sexpr (self) |
| |
| def | ctx_ref (self) |
| |
| def | eq (self, other) |
| |
| def | translate (self, target) |
| |
| def | __copy__ (self) |
| |
| def | hash (self) |
| |
| def | use_pp (self) |
| |
Floating-point expressions.
Definition at line 9306 of file z3py.py.
◆ __add__()
| def __add__ |
( |
|
self, |
|
|
|
other |
|
) |
| |
Create the Z3 expression `self + other`.
>>> x = FP('x', FPSort(8, 24))
>>> y = FP('y', FPSort(8, 24))
>>> x + y
x + y
>>> (x + y).sort()
FPSort(8, 24)
Definition at line 9352 of file z3py.py.
9352 def __add__(self, other):
9353 """Create the Z3 expression `self + other`.
9355 >>> x = FP('x', FPSort(8, 24))
9356 >>> y = FP('y', FPSort(8, 24))
9362 [a, b] = _coerce_fp_expr_list([self, other], self.ctx)
9363 return fpAdd(_dflt_rm(), a, b, self.ctx)
◆ __div__()
| def __div__ |
( |
|
self, |
|
|
|
other |
|
) |
| |
Create the Z3 expression `self / other`.
>>> x = FP('x', FPSort(8, 24))
>>> y = FP('y', FPSort(8, 24))
>>> x / y
x / y
>>> (x / y).sort()
FPSort(8, 24)
>>> 10 / y
1.25*(2**3) / y
Definition at line 9439 of file z3py.py.
9439 def __div__(self, other):
9440 """Create the Z3 expression `self / other`.
9442 >>> x = FP('x', FPSort(8, 24))
9443 >>> y = FP('y', FPSort(8, 24))
9451 [a, b] = _coerce_fp_expr_list([self, other], self.ctx)
9452 return fpDiv(_dflt_rm(), a, b, self.ctx)
Referenced by FPRef.__truediv__().
◆ __ge__()
| def __ge__ |
( |
|
self, |
|
|
|
other |
|
) |
| |
Definition at line 9346 of file z3py.py.
9346 def __ge__(self, other):
9347 return fpGEQ(self, other, self.ctx)
◆ __gt__()
| def __gt__ |
( |
|
self, |
|
|
|
other |
|
) |
| |
Definition at line 9349 of file z3py.py.
9349 def __gt__(self, other):
9350 return fpGT(self, other, self.ctx)
◆ __le__()
| def __le__ |
( |
|
self, |
|
|
|
other |
|
) |
| |
Definition at line 9340 of file z3py.py.
9340 def __le__(self, other):
9341 return fpLEQ(self, other, self.ctx)
◆ __lt__()
| def __lt__ |
( |
|
self, |
|
|
|
other |
|
) |
| |
Definition at line 9343 of file z3py.py.
9343 def __lt__(self, other):
9344 return fpLT(self, other, self.ctx)
◆ __mod__()
| def __mod__ |
( |
|
self, |
|
|
|
other |
|
) |
| |
Create the Z3 expression mod `self % other`.
Definition at line 9475 of file z3py.py.
9475 def __mod__(self, other):
9476 """Create the Z3 expression mod `self % other`."""
9477 return fpRem(self, other)
◆ __mul__()
| def __mul__ |
( |
|
self, |
|
|
|
other |
|
) |
| |
Create the Z3 expression `self * other`.
>>> x = FP('x', FPSort(8, 24))
>>> y = FP('y', FPSort(8, 24))
>>> x * y
x * y
>>> (x * y).sort()
FPSort(8, 24)
>>> 10 * y
1.25*(2**3) * y
Definition at line 9398 of file z3py.py.
9398 def __mul__(self, other):
9399 """Create the Z3 expression `self * other`.
9401 >>> x = FP('x', FPSort(8, 24))
9402 >>> y = FP('y', FPSort(8, 24))
9410 [a, b] = _coerce_fp_expr_list([self, other], self.ctx)
9411 return fpMul(_dflt_rm(), a, b, self.ctx)
◆ __neg__()
Create the Z3 expression `-self`.
>>> x = FP('x', Float32())
>>> -x
-x
Definition at line 9430 of file z3py.py.
9431 """Create the Z3 expression `-self`.
9433 >>> x = FP('x', Float32())
◆ __pos__()
Create the Z3 expression `+self`.
Definition at line 9426 of file z3py.py.
9427 """Create the Z3 expression `+self`."""
◆ __radd__()
| def __radd__ |
( |
|
self, |
|
|
|
other |
|
) |
| |
Create the Z3 expression `other + self`.
>>> x = FP('x', FPSort(8, 24))
>>> 10 + x
1.25*(2**3) + x
Definition at line 9365 of file z3py.py.
9365 def __radd__(self, other):
9366 """Create the Z3 expression `other + self`.
9368 >>> x = FP('x', FPSort(8, 24))
9372 [a, b] = _coerce_fp_expr_list([other, self], self.ctx)
9373 return fpAdd(_dflt_rm(), a, b, self.ctx)
◆ __rdiv__()
| def __rdiv__ |
( |
|
self, |
|
|
|
other |
|
) |
| |
Create the Z3 expression `other / self`.
>>> x = FP('x', FPSort(8, 24))
>>> y = FP('y', FPSort(8, 24))
>>> x / y
x / y
>>> x / 10
x / 1.25*(2**3)
Definition at line 9454 of file z3py.py.
9454 def __rdiv__(self, other):
9455 """Create the Z3 expression `other / self`.
9457 >>> x = FP('x', FPSort(8, 24))
9458 >>> y = FP('y', FPSort(8, 24))
9464 [a, b] = _coerce_fp_expr_list([other, self], self.ctx)
9465 return fpDiv(_dflt_rm(), a, b, self.ctx)
Referenced by FPRef.__rtruediv__().
◆ __rmod__()
| def __rmod__ |
( |
|
self, |
|
|
|
other |
|
) |
| |
Create the Z3 expression mod `other % self`.
Definition at line 9479 of file z3py.py.
9479 def __rmod__(self, other):
9480 """Create the Z3 expression mod `other % self`."""
9481 return fpRem(other, self)
◆ __rmul__()
| def __rmul__ |
( |
|
self, |
|
|
|
other |
|
) |
| |
Create the Z3 expression `other * self`.
>>> x = FP('x', FPSort(8, 24))
>>> y = FP('y', FPSort(8, 24))
>>> x * y
x * y
>>> x * 10
x * 1.25*(2**3)
Definition at line 9413 of file z3py.py.
9413 def __rmul__(self, other):
9414 """Create the Z3 expression `other * self`.
9416 >>> x = FP('x', FPSort(8, 24))
9417 >>> y = FP('y', FPSort(8, 24))
9423 [a, b] = _coerce_fp_expr_list([other, self], self.ctx)
9424 return fpMul(_dflt_rm(), a, b, self.ctx)
◆ __rsub__()
| def __rsub__ |
( |
|
self, |
|
|
|
other |
|
) |
| |
Create the Z3 expression `other - self`.
>>> x = FP('x', FPSort(8, 24))
>>> 10 - x
1.25*(2**3) - x
Definition at line 9388 of file z3py.py.
9388 def __rsub__(self, other):
9389 """Create the Z3 expression `other - self`.
9391 >>> x = FP('x', FPSort(8, 24))
9395 [a, b] = _coerce_fp_expr_list([other, self], self.ctx)
9396 return fpSub(_dflt_rm(), a, b, self.ctx)
◆ __rtruediv__()
| def __rtruediv__ |
( |
|
self, |
|
|
|
other |
|
) |
| |
Create the Z3 expression division `other / self`.
Definition at line 9471 of file z3py.py.
9471 def __rtruediv__(self, other):
9472 """Create the Z3 expression division `other / self`."""
9473 return self.__rdiv__(other)
◆ __sub__()
| def __sub__ |
( |
|
self, |
|
|
|
other |
|
) |
| |
Create the Z3 expression `self - other`.
>>> x = FP('x', FPSort(8, 24))
>>> y = FP('y', FPSort(8, 24))
>>> x - y
x - y
>>> (x - y).sort()
FPSort(8, 24)
Definition at line 9375 of file z3py.py.
9375 def __sub__(self, other):
9376 """Create the Z3 expression `self - other`.
9378 >>> x = FP('x', FPSort(8, 24))
9379 >>> y = FP('y', FPSort(8, 24))
9385 [a, b] = _coerce_fp_expr_list([self, other], self.ctx)
9386 return fpSub(_dflt_rm(), a, b, self.ctx)
◆ __truediv__()
| def __truediv__ |
( |
|
self, |
|
|
|
other |
|
) |
| |
Create the Z3 expression division `self / other`.
Definition at line 9467 of file z3py.py.
9467 def __truediv__(self, other):
9468 """Create the Z3 expression division `self / other`."""
9469 return self.__div__(other)
◆ as_string()
Return a Z3 floating point expression as a Python string.
Reimplemented in FPNumRef.
Definition at line 9336 of file z3py.py.
9336 def as_string(self):
9337 """Return a Z3 floating point expression as a Python string."""
◆ ebits()
Retrieves the number of bits reserved for the exponent in the FloatingPoint expression `self`.
>>> b = FPSort(8, 24)
>>> b.ebits()
8
Definition at line 9320 of file z3py.py.
9321 """Retrieves the number of bits reserved for the exponent in the FloatingPoint expression `self`.
9322 >>> b = FPSort(8, 24)
9326 return self.sort().ebits()
◆ sbits()
Retrieves the number of bits reserved for the exponent in the FloatingPoint expression `self`.
>>> b = FPSort(8, 24)
>>> b.sbits()
24
Definition at line 9328 of file z3py.py.
9329 """Retrieves the number of bits reserved for the exponent in the FloatingPoint expression `self`.
9330 >>> b = FPSort(8, 24)
9334 return self.sort().sbits()
◆ sort()
Return the sort of the floating-point expression `self`.
>>> x = FP('1.0', FPSort(8, 24))
>>> x.sort()
FPSort(8, 24)
>>> x.sort() == FPSort(8, 24)
True
Reimplemented from ExprRef.
Definition at line 9309 of file z3py.py.
9310 """Return the sort of the floating-point expression `self`.
9312 >>> x = FP('1.0', FPSort(8, 24))
9315 >>> x.sort() == FPSort(8, 24)
9318 return FPSortRef(
Z3_get_sort(self.ctx_ref(), self.as_ast()), self.ctx)