Z3
Public Member Functions
FPRef Class Reference
+ Inheritance diagram for FPRef:

Public Member Functions

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)
 
- Public Member Functions inherited from ExprRef
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)
 
- Public Member Functions inherited from AstRef
def __init__
 
def __del__ (self)
 
def __deepcopy__
 
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)
 
- Public Member Functions inherited from Z3PPObject
def use_pp (self)
 

Additional Inherited Members

- Data Fields inherited from AstRef
 ast
 
 ctx
 

Detailed Description

Floating-point expressions.

Definition at line 9317 of file z3py.py.

Member Function Documentation

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 9363 of file z3py.py.

9363  def __add__(self, other):
9364  """Create the Z3 expression `self + other`.
9365 
9366  >>> x = FP('x', FPSort(8, 24))
9367  >>> y = FP('y', FPSort(8, 24))
9368  >>> x + y
9369  x + y
9370  >>> (x + y).sort()
9371  FPSort(8, 24)
9372  """
9373  [a, b] = _coerce_fp_expr_list([self, other], self.ctx)
9374  return fpAdd(_dflt_rm(), a, b, self.ctx)
9375 
def __add__(self, other)
Definition: z3py.py:9363
def fpAdd
Definition: z3py.py:10043
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 9450 of file z3py.py.

9450  def __div__(self, other):
9451  """Create the Z3 expression `self / other`.
9452 
9453  >>> x = FP('x', FPSort(8, 24))
9454  >>> y = FP('y', FPSort(8, 24))
9455  >>> x / y
9456  x / y
9457  >>> (x / y).sort()
9458  FPSort(8, 24)
9459  >>> 10 / y
9460  1.25*(2**3) / y
9461  """
9462  [a, b] = _coerce_fp_expr_list([self, other], self.ctx)
9463  return fpDiv(_dflt_rm(), a, b, self.ctx)
9464 
def __div__(self, other)
Definition: z3py.py:9450
def fpDiv
Definition: z3py.py:10090
def __ge__ (   self,
  other 
)

Definition at line 9357 of file z3py.py.

9357  def __ge__(self, other):
9358  return fpGEQ(self, other, self.ctx)
9359 
def fpGEQ
Definition: z3py.py:10261
def __ge__(self, other)
Definition: z3py.py:9357
def __gt__ (   self,
  other 
)

Definition at line 9360 of file z3py.py.

9360  def __gt__(self, other):
9361  return fpGT(self, other, self.ctx)
9362 
def __gt__(self, other)
Definition: z3py.py:9360
def fpGT
Definition: z3py.py:10249
def __le__ (   self,
  other 
)

Definition at line 9351 of file z3py.py.

9351  def __le__(self, other):
9352  return fpLEQ(self, other, self.ctx)
9353 
def __le__(self, other)
Definition: z3py.py:9351
def fpLEQ
Definition: z3py.py:10237
def __lt__ (   self,
  other 
)

Definition at line 9354 of file z3py.py.

9354  def __lt__(self, other):
9355  return fpLT(self, other, self.ctx)
9356 
def fpLT
Definition: z3py.py:10225
def __lt__(self, other)
Definition: z3py.py:9354
def __mod__ (   self,
  other 
)
Create the Z3 expression mod `self % other`.

Definition at line 9486 of file z3py.py.

9486  def __mod__(self, other):
9487  """Create the Z3 expression mod `self % other`."""
9488  return fpRem(self, other)
9489 
def fpRem
Definition: z3py.py:10105
def __mod__(self, other)
Definition: z3py.py:9486
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 9409 of file z3py.py.

9409  def __mul__(self, other):
9410  """Create the Z3 expression `self * other`.
9411 
9412  >>> x = FP('x', FPSort(8, 24))
9413  >>> y = FP('y', FPSort(8, 24))
9414  >>> x * y
9415  x * y
9416  >>> (x * y).sort()
9417  FPSort(8, 24)
9418  >>> 10 * y
9419  1.25*(2**3) * y
9420  """
9421  [a, b] = _coerce_fp_expr_list([self, other], self.ctx)
9422  return fpMul(_dflt_rm(), a, b, self.ctx)
9423 
def fpMul
Definition: z3py.py:10075
def __mul__(self, other)
Definition: z3py.py:9409
def __neg__ (   self)
Create the Z3 expression `-self`.

>>> x = FP('x', Float32())
>>> -x
-x

Definition at line 9441 of file z3py.py.

9441  def __neg__(self):
9442  """Create the Z3 expression `-self`.
9443 
9444  >>> x = FP('x', Float32())
9445  >>> -x
9446  -x
9447  """
9448  return fpNeg(self)
9449 
def __neg__(self)
Definition: z3py.py:9441
def fpNeg
Definition: z3py.py:9975
def __pos__ (   self)
Create the Z3 expression `+self`.

Definition at line 9437 of file z3py.py.

9437  def __pos__(self):
9438  """Create the Z3 expression `+self`."""
9439  return self
9440 
def __pos__(self)
Definition: z3py.py:9437
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 9376 of file z3py.py.

9376  def __radd__(self, other):
9377  """Create the Z3 expression `other + self`.
9378 
9379  >>> x = FP('x', FPSort(8, 24))
9380  >>> 10 + x
9381  1.25*(2**3) + x
9382  """
9383  [a, b] = _coerce_fp_expr_list([other, self], self.ctx)
9384  return fpAdd(_dflt_rm(), a, b, self.ctx)
9385 
def fpAdd
Definition: z3py.py:10043
def __radd__(self, other)
Definition: z3py.py:9376
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 9465 of file z3py.py.

9465  def __rdiv__(self, other):
9466  """Create the Z3 expression `other / self`.
9467 
9468  >>> x = FP('x', FPSort(8, 24))
9469  >>> y = FP('y', FPSort(8, 24))
9470  >>> x / y
9471  x / y
9472  >>> x / 10
9473  x / 1.25*(2**3)
9474  """
9475  [a, b] = _coerce_fp_expr_list([other, self], self.ctx)
9476  return fpDiv(_dflt_rm(), a, b, self.ctx)
9477 
def __rdiv__(self, other)
Definition: z3py.py:9465
def fpDiv
Definition: z3py.py:10090
def __rmod__ (   self,
  other 
)
Create the Z3 expression mod `other % self`.

Definition at line 9490 of file z3py.py.

9490  def __rmod__(self, other):
9491  """Create the Z3 expression mod `other % self`."""
9492  return fpRem(other, self)
9493 
9494 
def fpRem
Definition: z3py.py:10105
def __rmod__(self, other)
Definition: z3py.py:9490
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 9424 of file z3py.py.

9424  def __rmul__(self, other):
9425  """Create the Z3 expression `other * self`.
9426 
9427  >>> x = FP('x', FPSort(8, 24))
9428  >>> y = FP('y', FPSort(8, 24))
9429  >>> x * y
9430  x * y
9431  >>> x * 10
9432  x * 1.25*(2**3)
9433  """
9434  [a, b] = _coerce_fp_expr_list([other, self], self.ctx)
9435  return fpMul(_dflt_rm(), a, b, self.ctx)
9436 
def __rmul__(self, other)
Definition: z3py.py:9424
def fpMul
Definition: z3py.py:10075
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 9399 of file z3py.py.

9399  def __rsub__(self, other):
9400  """Create the Z3 expression `other - self`.
9401 
9402  >>> x = FP('x', FPSort(8, 24))
9403  >>> 10 - x
9404  1.25*(2**3) - x
9405  """
9406  [a, b] = _coerce_fp_expr_list([other, self], self.ctx)
9407  return fpSub(_dflt_rm(), a, b, self.ctx)
9408 
def __rsub__(self, other)
Definition: z3py.py:9399
def fpSub
Definition: z3py.py:10060
def __rtruediv__ (   self,
  other 
)
Create the Z3 expression division `other / self`.

Definition at line 9482 of file z3py.py.

9482  def __rtruediv__(self, other):
9483  """Create the Z3 expression division `other / self`."""
9484  return self.__rdiv__(other)
9485 
def __rtruediv__(self, other)
Definition: z3py.py:9482
def __rdiv__(self, other)
Definition: z3py.py:9465
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 9386 of file z3py.py.

9386  def __sub__(self, other):
9387  """Create the Z3 expression `self - other`.
9388 
9389  >>> x = FP('x', FPSort(8, 24))
9390  >>> y = FP('y', FPSort(8, 24))
9391  >>> x - y
9392  x - y
9393  >>> (x - y).sort()
9394  FPSort(8, 24)
9395  """
9396  [a, b] = _coerce_fp_expr_list([self, other], self.ctx)
9397  return fpSub(_dflt_rm(), a, b, self.ctx)
9398 
def fpSub
Definition: z3py.py:10060
def __sub__(self, other)
Definition: z3py.py:9386
def __truediv__ (   self,
  other 
)
Create the Z3 expression division `self / other`.

Definition at line 9478 of file z3py.py.

9478  def __truediv__(self, other):
9479  """Create the Z3 expression division `self / other`."""
9480  return self.__div__(other)
9481 
def __div__(self, other)
Definition: z3py.py:9450
def __truediv__(self, other)
Definition: z3py.py:9478
def as_string (   self)
Return a Z3 floating point expression as a Python string.

Definition at line 9347 of file z3py.py.

9347  def as_string(self):
9348  """Return a Z3 floating point expression as a Python string."""
9349  return Z3_ast_to_string(self.ctx_ref(), self.as_ast())
9350 
Z3_string Z3_API Z3_ast_to_string(Z3_context c, Z3_ast a)
Convert the given AST node into a string.
def as_ast(self)
Definition: z3py.py:391
def ctx_ref(self)
Definition: z3py.py:399
def as_string(self)
Definition: z3py.py:9347
def ebits (   self)
Retrieves the number of bits reserved for the exponent in the FloatingPoint expression `self`.
>>> b = FPSort(8, 24)
>>> b.ebits()
8

Definition at line 9331 of file z3py.py.

9331  def ebits(self):
9332  """Retrieves the number of bits reserved for the exponent in the FloatingPoint expression `self`.
9333  >>> b = FPSort(8, 24)
9334  >>> b.ebits()
9335  8
9336  """
9337  return self.sort().ebits()
9338 
def sort(self)
Definition: z3py.py:977
def ebits(self)
Definition: z3py.py:9331
def sbits (   self)
Retrieves the number of bits reserved for the exponent in the FloatingPoint expression `self`.
>>> b = FPSort(8, 24)
>>> b.sbits()
24

Definition at line 9339 of file z3py.py.

9339  def sbits(self):
9340  """Retrieves the number of bits reserved for the exponent in the FloatingPoint expression `self`.
9341  >>> b = FPSort(8, 24)
9342  >>> b.sbits()
9343  24
9344  """
9345  return self.sort().sbits()
9346 
def sbits(self)
Definition: z3py.py:9339
def sort(self)
Definition: z3py.py:977
def sort (   self)
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

Definition at line 9320 of file z3py.py.

Referenced by FPRef.__add__(), FPRef.__div__(), FPRef.__mul__(), and FPRef.__sub__().

9320  def sort(self):
9321  """Return the sort of the floating-point expression `self`.
9322 
9323  >>> x = FP('1.0', FPSort(8, 24))
9324  >>> x.sort()
9325  FPSort(8, 24)
9326  >>> x.sort() == FPSort(8, 24)
9327  True
9328  """
9329  return FPSortRef(Z3_get_sort(self.ctx_ref(), self.as_ast()), self.ctx)
9330 
def as_ast(self)
Definition: z3py.py:391
def sort(self)
Definition: z3py.py:9320
def ctx_ref(self)
Definition: z3py.py:399
Z3_sort Z3_API Z3_get_sort(Z3_context c, Z3_ast a)
Return the sort of an AST node.