Z3
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions
FPRef Class Reference

FP Expressions. More...

+ Inheritance diagram for FPRef:

Public Member Functions

def sort
 
def ebits
 
def sbits
 
def as_string
 
def __le__
 
def __lt__
 
def __ge__
 
def __gt__
 
def __add__
 
def __radd__
 
def __sub__
 
def __rsub__
 
def __mul__
 
def __rmul__
 
def __pos__
 
def __neg__
 
def __div__
 
def __rdiv__
 
def __truediv__
 
def __rtruediv__
 
def __mod__
 
def __rmod__
 
- Public Member Functions inherited from ExprRef
def as_ast
 
def get_id
 
def sort
 
def sort_kind
 
def __eq__
 
def __hash__
 
def __ne__
 
def params
 
def decl
 
def num_args
 
def arg
 
def children
 
- Public Member Functions inherited from AstRef
def __init__
 
def __del__
 
def __deepcopy__
 
def __str__
 
def __repr__
 
def __eq__
 
def __hash__
 
def __nonzero__
 
def __bool__
 
def sexpr
 
def as_ast
 
def get_id
 
def ctx_ref
 
def eq
 
def translate
 
def __copy__
 
def hash
 
- Public Member Functions inherited from Z3PPObject
def use_pp
 

Additional Inherited Members

- Data Fields inherited from AstRef
 ast
 
 ctx
 

Detailed Description

FP Expressions.

Floating-point expressions.

Definition at line 8756 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 8802 of file z3py.py.

8803  def __add__(self, other):
8804  """Create the Z3 expression `self + other`.
8805 
8806  >>> x = FP('x', FPSort(8, 24))
8807  >>> y = FP('y', FPSort(8, 24))
8808  >>> x + y
8809  x + y
8810  >>> (x + y).sort()
8811  FPSort(8, 24)
8812  """
8813  [a, b] = _coerce_fp_expr_list([self, other], self.ctx)
8814  return fpAdd(_dflt_rm(), a, b, self.ctx)
def __add__
Definition: z3py.py:8802
def fpAdd
Definition: z3py.py:9436
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 8889 of file z3py.py.

8890  def __div__(self, other):
8891  """Create the Z3 expression `self / other`.
8892 
8893  >>> x = FP('x', FPSort(8, 24))
8894  >>> y = FP('y', FPSort(8, 24))
8895  >>> x / y
8896  x / y
8897  >>> (x / y).sort()
8898  FPSort(8, 24)
8899  >>> 10 / y
8900  1.25*(2**3) / y
8901  """
8902  [a, b] = _coerce_fp_expr_list([self, other], self.ctx)
8903  return fpDiv(_dflt_rm(), a, b, self.ctx)
def __div__
Definition: z3py.py:8889
def fpDiv
Definition: z3py.py:9480
def __ge__ (   self,
  other 
)

Definition at line 8796 of file z3py.py.

8797  def __ge__(self, other):
8798  return fpGEQ(self, other, self.ctx)
def fpGEQ
Definition: z3py.py:9634
def __ge__
Definition: z3py.py:8796
def __gt__ (   self,
  other 
)

Definition at line 8799 of file z3py.py.

8800  def __gt__(self, other):
8801  return fpGT(self, other, self.ctx)
def fpGT
Definition: z3py.py:9623
def __gt__
Definition: z3py.py:8799
def __le__ (   self,
  other 
)

Definition at line 8790 of file z3py.py.

8791  def __le__(self, other):
8792  return fpLEQ(self, other, self.ctx)
def __le__
Definition: z3py.py:8790
def fpLEQ
Definition: z3py.py:9612
def __lt__ (   self,
  other 
)

Definition at line 8793 of file z3py.py.

8794  def __lt__(self, other):
8795  return fpLT(self, other, self.ctx)
def __lt__
Definition: z3py.py:8793
def fpLT
Definition: z3py.py:9601
def __mod__ (   self,
  other 
)
Create the Z3 expression mod `self % other`.

Definition at line 8926 of file z3py.py.

8927  def __mod__(self, other):
8928  """Create the Z3 expression mod `self % other`."""
8929  return fpRem(self, other)
def fpRem
Definition: z3py.py:9494
def __mod__
Definition: z3py.py:8926
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 8848 of file z3py.py.

8849  def __mul__(self, other):
8850  """Create the Z3 expression `self * other`.
8851 
8852  >>> x = FP('x', FPSort(8, 24))
8853  >>> y = FP('y', FPSort(8, 24))
8854  >>> x * y
8855  x * y
8856  >>> (x * y).sort()
8857  FPSort(8, 24)
8858  >>> 10 * y
8859  1.25*(2**3) * y
8860  """
8861  [a, b] = _coerce_fp_expr_list([self, other], self.ctx)
8862  return fpMul(_dflt_rm(), a, b, self.ctx)
def __mul__
Definition: z3py.py:8848
def fpMul
Definition: z3py.py:9466
def __neg__ (   self)
Create the Z3 expression `-self`.

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

Definition at line 8880 of file z3py.py.

8881  def __neg__(self):
8882  """Create the Z3 expression `-self`.
8883 
8884  >>> x = FP('x', Float32())
8885  >>> -x
8886  -x
8887  """
8888  return fpNeg(self)
def __neg__
Definition: z3py.py:8880
def fpNeg
Definition: z3py.py:9369
def __pos__ (   self)
Create the Z3 expression `+self`.

Definition at line 8876 of file z3py.py.

8877  def __pos__(self):
8878  """Create the Z3 expression `+self`."""
8879  return self
def __pos__
Definition: z3py.py:8876
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 8815 of file z3py.py.

8816  def __radd__(self, other):
8817  """Create the Z3 expression `other + self`.
8818 
8819  >>> x = FP('x', FPSort(8, 24))
8820  >>> 10 + x
8821  1.25*(2**3) + x
8822  """
8823  [a, b] = _coerce_fp_expr_list([other, self], self.ctx)
8824  return fpAdd(_dflt_rm(), a, b, self.ctx)
def __radd__
Definition: z3py.py:8815
def fpAdd
Definition: z3py.py:9436
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 8904 of file z3py.py.

8905  def __rdiv__(self, other):
8906  """Create the Z3 expression `other / self`.
8907 
8908  >>> x = FP('x', FPSort(8, 24))
8909  >>> y = FP('y', FPSort(8, 24))
8910  >>> x / y
8911  x / y
8912  >>> x / 10
8913  x / 1.25*(2**3)
8914  """
8915  [a, b] = _coerce_fp_expr_list([other, self], self.ctx)
8916  return fpDiv(_dflt_rm(), a, b, self.ctx)
def __rdiv__
Definition: z3py.py:8904
def fpDiv
Definition: z3py.py:9480
def __rmod__ (   self,
  other 
)
Create the Z3 expression mod `other % self`.

Definition at line 8930 of file z3py.py.

8931  def __rmod__(self, other):
8932  """Create the Z3 expression mod `other % self`."""
8933  return fpRem(other, self)
def __rmod__
Definition: z3py.py:8930
def fpRem
Definition: z3py.py:9494
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 8863 of file z3py.py.

8864  def __rmul__(self, other):
8865  """Create the Z3 expression `other * self`.
8866 
8867  >>> x = FP('x', FPSort(8, 24))
8868  >>> y = FP('y', FPSort(8, 24))
8869  >>> x * y
8870  x * y
8871  >>> x * 10
8872  x * 1.25*(2**3)
8873  """
8874  [a, b] = _coerce_fp_expr_list([other, self], self.ctx)
8875  return fpMul(_dflt_rm(), a, b, self.ctx)
def __rmul__
Definition: z3py.py:8863
def fpMul
Definition: z3py.py:9466
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 8838 of file z3py.py.

8839  def __rsub__(self, other):
8840  """Create the Z3 expression `other - self`.
8841 
8842  >>> x = FP('x', FPSort(8, 24))
8843  >>> 10 - x
8844  1.25*(2**3) - x
8845  """
8846  [a, b] = _coerce_fp_expr_list([other, self], self.ctx)
8847  return fpSub(_dflt_rm(), a, b, self.ctx)
def fpSub
Definition: z3py.py:9452
def __rsub__
Definition: z3py.py:8838
def __rtruediv__ (   self,
  other 
)
Create the Z3 expression division `other / self`.

Definition at line 8922 of file z3py.py.

8923  def __rtruediv__(self, other):
8924  """Create the Z3 expression division `other / self`."""
8925  return self.__rdiv__(other)
def __rdiv__
Definition: z3py.py:8904
def __rtruediv__
Definition: z3py.py:8922
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 8825 of file z3py.py.

8826  def __sub__(self, other):
8827  """Create the Z3 expression `self - other`.
8828 
8829  >>> x = FP('x', FPSort(8, 24))
8830  >>> y = FP('y', FPSort(8, 24))
8831  >>> x - y
8832  x - y
8833  >>> (x - y).sort()
8834  FPSort(8, 24)
8835  """
8836  [a, b] = _coerce_fp_expr_list([self, other], self.ctx)
8837  return fpSub(_dflt_rm(), a, b, self.ctx)
def fpSub
Definition: z3py.py:9452
def __sub__
Definition: z3py.py:8825
def __truediv__ (   self,
  other 
)
Create the Z3 expression division `self / other`.

Definition at line 8918 of file z3py.py.

8919  def __truediv__(self, other):
8920  """Create the Z3 expression division `self / other`."""
8921  return self.__div__(other)
def __div__
Definition: z3py.py:8889
def __truediv__
Definition: z3py.py:8918
def as_string (   self)
Return a Z3 floating point expression as a Python string.

Definition at line 8786 of file z3py.py.

8787  def as_string(self):
8788  """Return a Z3 floating point expression as a Python string."""
8789  return Z3_ast_to_string(self.ctx_ref(), self.as_ast())
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
Definition: z3py.py:344
def ctx_ref
Definition: z3py.py:352
def as_string
Definition: z3py.py:8786
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 8770 of file z3py.py.

8771  def ebits(self):
8772  """Retrieves the number of bits reserved for the exponent in the FloatingPoint expression `self`.
8773  >>> b = FPSort(8, 24)
8774  >>> b.ebits()
8775  8
8776  """
8777  return self.sort().ebits();
def sort
Definition: z3py.py:879
def ebits
Definition: z3py.py:8770
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 8778 of file z3py.py.

8779  def sbits(self):
8780  """Retrieves the number of bits reserved for the exponent in the FloatingPoint expression `self`.
8781  >>> b = FPSort(8, 24)
8782  >>> b.sbits()
8783  24
8784  """
8785  return self.sort().sbits();
def sort
Definition: z3py.py:879
def sbits
Definition: z3py.py:8778
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 8759 of file z3py.py.

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

8760  def sort(self):
8761  """Return the sort of the floating-point expression `self`.
8762 
8763  >>> x = FP('1.0', FPSort(8, 24))
8764  >>> x.sort()
8765  FPSort(8, 24)
8766  >>> x.sort() == FPSort(8, 24)
8767  True
8768  """
8769  return FPSortRef(Z3_get_sort(self.ctx_ref(), self.as_ast()), self.ctx)
def as_ast
Definition: z3py.py:344
FP Sorts.
Definition: z3py.py:8655
def ctx_ref
Definition: z3py.py:352
Z3_sort Z3_API Z3_get_sort(Z3_context c, Z3_ast a)
Return the sort of an AST node.
def sort
Definition: z3py.py:8759