Z3
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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 __ne__
 
def __add__
 
def __radd__
 
def __sub__
 
def __rsub__
 
def __mul__
 
def __rmul__
 
def __pos__
 
def __neg__
 
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 __ne__
 
def decl
 
def num_args
 
def arg
 
def children
 
- Public Member Functions inherited from AstRef
def __init__
 
def __del__
 
def __str__
 
def __repr__
 
def sexpr
 
def as_ast
 
def get_id
 
def ctx_ref
 
def eq
 
def translate
 
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 7800 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 7850 of file z3py.py.

7851  def __add__(self, other):
7852  """Create the Z3 expression `self + other`.
7853 
7854  >>> x = FP('x', FPSort(8, 24))
7855  >>> y = FP('y', FPSort(8, 24))
7856  >>> x + y
7857  x + y
7858  >>> (x + y).sort()
7859  FPSort(8, 24)
7860  """
7861  a, b = z3._coerce_exprs(self, other)
7862  return fpAdd(_dflt_rm(), self, other)
def __add__
Definition: z3py.py:7850
def fpAdd
Definition: z3py.py:8299
def __ge__ (   self,
  other 
)

Definition at line 7840 of file z3py.py.

7841  def __ge__(self, other):
7842  return fpGEQ(self, other)
def fpGEQ
Definition: z3py.py:8553
def __ge__
Definition: z3py.py:7840
def __gt__ (   self,
  other 
)

Definition at line 7843 of file z3py.py.

7844  def __gt__(self, other):
7845  return fpGT(self, other)
def fpGT
Definition: z3py.py:8539
def __gt__
Definition: z3py.py:7843
def __le__ (   self,
  other 
)

Definition at line 7834 of file z3py.py.

7835  def __le__(self, other):
7836  return fpLEQ(self, other)
def __le__
Definition: z3py.py:7834
def fpLEQ
Definition: z3py.py:8526
def __lt__ (   self,
  other 
)

Definition at line 7837 of file z3py.py.

7838  def __lt__(self, other):
7839  return fpLEQ(self, other)
def __lt__
Definition: z3py.py:7837
def fpLEQ
Definition: z3py.py:8526
def __mod__ (   self,
  other 
)
Create the Z3 expression mod `self % other`.

Definition at line 7940 of file z3py.py.

7941  def __mod__(self, other):
7942  """Create the Z3 expression mod `self % other`."""
7943  return fpRem(self, other)
def fpRem
Definition: z3py.py:8371
def __mod__
Definition: z3py.py:7940
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 7896 of file z3py.py.

7897  def __mul__(self, other):
7898  """Create the Z3 expression `self * other`.
7899 
7900  >>> x = FP('x', FPSort(8, 24))
7901  >>> y = FP('y', FPSort(8, 24))
7902  >>> x * y
7903  x * y
7904  >>> (x * y).sort()
7905  FPSort(8, 24)
7906  >>> 10 * y
7907  1.25*(2**3) * y
7908  """
7909  a, b = z3._coerce_exprs(self, other)
7910  return fpMul(_dflt_rm(), self, other)
def __mul__
Definition: z3py.py:7896
def fpMul
Definition: z3py.py:8335
def __ne__ (   self,
  other 
)

Definition at line 7846 of file z3py.py.

7847  def __ne__(self, other):
7848  return fpNEQ(self, other)
7849 
def fpNEQ
Definition: z3py.py:8581
def __ne__
Definition: z3py.py:7846
def __neg__ (   self)
Create the Z3 expression `-self`.

Definition at line 7928 of file z3py.py.

7929  def __neg__(self):
7930  """Create the Z3 expression `-self`."""
7931  return FPRef(fpNeg(self))
FP Expressions.
Definition: z3py.py:7800
def __neg__
Definition: z3py.py:7928
def fpNeg
Definition: z3py.py:8277
def __pos__ (   self)
Create the Z3 expression `+self`.

Definition at line 7924 of file z3py.py.

7925  def __pos__(self):
7926  """Create the Z3 expression `+self`."""
7927  return self
def __pos__
Definition: z3py.py:7924
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 7863 of file z3py.py.

7864  def __radd__(self, other):
7865  """Create the Z3 expression `other + self`.
7866 
7867  >>> x = FP('x', FPSort(8, 24))
7868  >>> 10 + x
7869  1.25*(2**3) + x
7870  """
7871  a, b = _coerce_exprs(self, other)
7872  return fpAdd(_dflt_rm(), other, self)
def __radd__
Definition: z3py.py:7863
def fpAdd
Definition: z3py.py:8299
def __rmod__ (   self,
  other 
)
Create the Z3 expression mod `other % self`.

Definition at line 7944 of file z3py.py.

7945  def __rmod__(self, other):
7946  """Create the Z3 expression mod `other % self`."""
7947  return fpRem(other, self)
def __rmod__
Definition: z3py.py:7944
def fpRem
Definition: z3py.py:8371
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 7911 of file z3py.py.

7912  def __rmul__(self, other):
7913  """Create the Z3 expression `other * self`.
7914 
7915  >>> x = FP('x', FPSort(8, 24))
7916  >>> y = FP('y', FPSort(8, 24))
7917  >>> x * y
7918  x * y
7919  >>> x * 10
7920  x * 1.25*(2**3)
7921  """
7922  a, b = _coerce_exprs(self, other)
7923  return fpMul(_dflt_rm(), other, self)
def __rmul__
Definition: z3py.py:7911
def fpMul
Definition: z3py.py:8335
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 7886 of file z3py.py.

7887  def __rsub__(self, other):
7888  """Create the Z3 expression `other - self`.
7889 
7890  >>> x = FP('x', FPSort(8, 24))
7891  >>> 10 - x
7892  1.25*(2**3) - x
7893  """
7894  a, b = _coerce_exprs(self, other)
7895  return fpSub(_dflt_rm(), other, self)
def fpSub
Definition: z3py.py:8317
def __rsub__
Definition: z3py.py:7886
def __rtruediv__ (   self,
  other 
)
Create the Z3 expression division `other / self`.

Definition at line 7936 of file z3py.py.

7937  def __rtruediv__(self, other):
7938  """Create the Z3 expression division `other / self`."""
7939  return self.__rdiv__(other)
def __rtruediv__
Definition: z3py.py:7936
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 7873 of file z3py.py.

7874  def __sub__(self, other):
7875  """Create the Z3 expression `self - other`.
7876 
7877  >>> x = FP('x', FPSort(8, 24))
7878  >>> y = FP('y', FPSort(8, 24))
7879  >>> x - y
7880  x - y
7881  >>> (x - y).sort()
7882  FPSort(8, 24)
7883  """
7884  a, b = z3._coerce_exprs(self, other)
7885  return fpSub(_dflt_rm(), self, other)
def fpSub
Definition: z3py.py:8317
def __sub__
Definition: z3py.py:7873
def __truediv__ (   self,
  other 
)
Create the Z3 expression division `self / other`.

Definition at line 7932 of file z3py.py.

7933  def __truediv__(self, other):
7934  """Create the Z3 expression division `self / other`."""
7935  return self.__div__(other)
def __truediv__
Definition: z3py.py:7932
def as_string (   self)
Return a Z3 floating point expression as a Python string.

Definition at line 7830 of file z3py.py.

7831  def as_string(self):
7832  """Return a Z3 floating point expression as a Python string."""
7833  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:296
def ctx_ref
Definition: z3py.py:304
def as_string
Definition: z3py.py:7830
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 7814 of file z3py.py.

7815  def ebits(self):
7816  """Retrieves the number of bits reserved for the exponent in the FloatingPoint expression `self`.
7817  >>> b = FPSort(8, 24)
7818  >>> b.ebits()
7819  8
7820  """
7821  return self.sort().ebits();
def sort
Definition: z3py.py:752
def ebits
Definition: z3py.py:7814
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 7822 of file z3py.py.

7823  def sbits(self):
7824  """Retrieves the number of bits reserved for the exponent in the FloatingPoint expression `self`.
7825  >>> b = FPSort(8, 24)
7826  >>> b.sbits()
7827  24
7828  """
7829  return self.sort().sbits();
def sort
Definition: z3py.py:752
def sbits
Definition: z3py.py:7822
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 7803 of file z3py.py.

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

7804  def sort(self):
7805  """Return the sort of the floating-point expression `self`.
7806 
7807  >>> x = FP('1.0', FPSort(8, 24))
7808  >>> x.sort()
7809  FPSort(8, 24)
7810  >>> x.sort() == FPSort(8, 24)
7811  True
7812  """
7813  return FPSortRef(Z3_get_sort(self.ctx_ref(), self.as_ast()), self.ctx)
def as_ast
Definition: z3py.py:296
FP Sorts.
Definition: z3py.py:7698
def ctx_ref
Definition: z3py.py:304
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:7803