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 kind (self)
 
def num_args (self)
 
def arg (self, idx)
 
def children (self)
 
def update (self, args)
 
def from_string (self, s)
 
def serialize (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)
 
def py_value (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 9883 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 9929 of file z3py.py.

9929  def __add__(self, other):
9930  """Create the Z3 expression `self + other`.
9931 
9932  >>> x = FP('x', FPSort(8, 24))
9933  >>> y = FP('y', FPSort(8, 24))
9934  >>> x + y
9935  x + y
9936  >>> (x + y).sort()
9937  FPSort(8, 24)
9938  """
9939  [a, b] = _coerce_fp_expr_list([self, other], self.ctx)
9940  return fpAdd(_dflt_rm(), a, b, self.ctx)
9941 
def __add__(self, other)
Definition: z3py.py:9929
def fpAdd
Definition: z3py.py:10619
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 10016 of file z3py.py.

10016  def __div__(self, other):
10017  """Create the Z3 expression `self / other`.
10018 
10019  >>> x = FP('x', FPSort(8, 24))
10020  >>> y = FP('y', FPSort(8, 24))
10021  >>> x / y
10022  x / y
10023  >>> (x / y).sort()
10024  FPSort(8, 24)
10025  >>> 10 / y
10026  1.25*(2**3) / y
10027  """
10028  [a, b] = _coerce_fp_expr_list([self, other], self.ctx)
10029  return fpDiv(_dflt_rm(), a, b, self.ctx)
10030 
def __div__(self, other)
Definition: z3py.py:10016
def fpDiv
Definition: z3py.py:10666
def __ge__ (   self,
  other 
)

Definition at line 9923 of file z3py.py.

9923  def __ge__(self, other):
9924  return fpGEQ(self, other, self.ctx)
9925 
def fpGEQ
Definition: z3py.py:10837
def __ge__(self, other)
Definition: z3py.py:9923
def __gt__ (   self,
  other 
)

Definition at line 9926 of file z3py.py.

9926  def __gt__(self, other):
9927  return fpGT(self, other, self.ctx)
9928 
def __gt__(self, other)
Definition: z3py.py:9926
def fpGT
Definition: z3py.py:10825
def __le__ (   self,
  other 
)

Definition at line 9917 of file z3py.py.

9917  def __le__(self, other):
9918  return fpLEQ(self, other, self.ctx)
9919 
def __le__(self, other)
Definition: z3py.py:9917
def fpLEQ
Definition: z3py.py:10813
def __lt__ (   self,
  other 
)

Definition at line 9920 of file z3py.py.

9920  def __lt__(self, other):
9921  return fpLT(self, other, self.ctx)
9922 
def fpLT
Definition: z3py.py:10801
def __lt__(self, other)
Definition: z3py.py:9920
def __mod__ (   self,
  other 
)
Create the Z3 expression mod `self % other`.

Definition at line 10052 of file z3py.py.

10052  def __mod__(self, other):
10053  """Create the Z3 expression mod `self % other`."""
10054  return fpRem(self, other)
10055 
def fpRem
Definition: z3py.py:10681
def __mod__(self, other)
Definition: z3py.py:10052
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 9975 of file z3py.py.

9975  def __mul__(self, other):
9976  """Create the Z3 expression `self * other`.
9977 
9978  >>> x = FP('x', FPSort(8, 24))
9979  >>> y = FP('y', FPSort(8, 24))
9980  >>> x * y
9981  x * y
9982  >>> (x * y).sort()
9983  FPSort(8, 24)
9984  >>> 10 * y
9985  1.25*(2**3) * y
9986  """
9987  [a, b] = _coerce_fp_expr_list([self, other], self.ctx)
9988  return fpMul(_dflt_rm(), a, b, self.ctx)
9989 
def fpMul
Definition: z3py.py:10651
def __mul__(self, other)
Definition: z3py.py:9975
def __neg__ (   self)
Create the Z3 expression `-self`.

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

Definition at line 10007 of file z3py.py.

10007  def __neg__(self):
10008  """Create the Z3 expression `-self`.
10009 
10010  >>> x = FP('x', Float32())
10011  >>> -x
10012  -x
10013  """
10014  return fpNeg(self)
10015 
def __neg__(self)
Definition: z3py.py:10007
def fpNeg
Definition: z3py.py:10551
def __pos__ (   self)
Create the Z3 expression `+self`.

Definition at line 10003 of file z3py.py.

10003  def __pos__(self):
10004  """Create the Z3 expression `+self`."""
10005  return self
10006 
def __pos__(self)
Definition: z3py.py:10003
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 9942 of file z3py.py.

9942  def __radd__(self, other):
9943  """Create the Z3 expression `other + self`.
9944 
9945  >>> x = FP('x', FPSort(8, 24))
9946  >>> 10 + x
9947  1.25*(2**3) + x
9948  """
9949  [a, b] = _coerce_fp_expr_list([other, self], self.ctx)
9950  return fpAdd(_dflt_rm(), a, b, self.ctx)
9951 
def fpAdd
Definition: z3py.py:10619
def __radd__(self, other)
Definition: z3py.py:9942
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 10031 of file z3py.py.

10031  def __rdiv__(self, other):
10032  """Create the Z3 expression `other / self`.
10033 
10034  >>> x = FP('x', FPSort(8, 24))
10035  >>> y = FP('y', FPSort(8, 24))
10036  >>> x / y
10037  x / y
10038  >>> x / 10
10039  x / 1.25*(2**3)
10040  """
10041  [a, b] = _coerce_fp_expr_list([other, self], self.ctx)
10042  return fpDiv(_dflt_rm(), a, b, self.ctx)
10043 
def __rdiv__(self, other)
Definition: z3py.py:10031
def fpDiv
Definition: z3py.py:10666
def __rmod__ (   self,
  other 
)
Create the Z3 expression mod `other % self`.

Definition at line 10056 of file z3py.py.

10056  def __rmod__(self, other):
10057  """Create the Z3 expression mod `other % self`."""
10058  return fpRem(other, self)
10059 
10060 
def fpRem
Definition: z3py.py:10681
def __rmod__(self, other)
Definition: z3py.py:10056
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 9990 of file z3py.py.

9990  def __rmul__(self, other):
9991  """Create the Z3 expression `other * self`.
9992 
9993  >>> x = FP('x', FPSort(8, 24))
9994  >>> y = FP('y', FPSort(8, 24))
9995  >>> x * y
9996  x * y
9997  >>> x * 10
9998  x * 1.25*(2**3)
9999  """
10000  [a, b] = _coerce_fp_expr_list([other, self], self.ctx)
10001  return fpMul(_dflt_rm(), a, b, self.ctx)
10002 
def __rmul__(self, other)
Definition: z3py.py:9990
def fpMul
Definition: z3py.py:10651
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 9965 of file z3py.py.

9965  def __rsub__(self, other):
9966  """Create the Z3 expression `other - self`.
9967 
9968  >>> x = FP('x', FPSort(8, 24))
9969  >>> 10 - x
9970  1.25*(2**3) - x
9971  """
9972  [a, b] = _coerce_fp_expr_list([other, self], self.ctx)
9973  return fpSub(_dflt_rm(), a, b, self.ctx)
9974 
def __rsub__(self, other)
Definition: z3py.py:9965
def fpSub
Definition: z3py.py:10636
def __rtruediv__ (   self,
  other 
)
Create the Z3 expression division `other / self`.

Definition at line 10048 of file z3py.py.

10048  def __rtruediv__(self, other):
10049  """Create the Z3 expression division `other / self`."""
10050  return self.__rdiv__(other)
10051 
def __rtruediv__(self, other)
Definition: z3py.py:10048
def __rdiv__(self, other)
Definition: z3py.py:10031
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 9952 of file z3py.py.

9952  def __sub__(self, other):
9953  """Create the Z3 expression `self - other`.
9954 
9955  >>> x = FP('x', FPSort(8, 24))
9956  >>> y = FP('y', FPSort(8, 24))
9957  >>> x - y
9958  x - y
9959  >>> (x - y).sort()
9960  FPSort(8, 24)
9961  """
9962  [a, b] = _coerce_fp_expr_list([self, other], self.ctx)
9963  return fpSub(_dflt_rm(), a, b, self.ctx)
9964 
def fpSub
Definition: z3py.py:10636
def __sub__(self, other)
Definition: z3py.py:9952
def __truediv__ (   self,
  other 
)
Create the Z3 expression division `self / other`.

Definition at line 10044 of file z3py.py.

10044  def __truediv__(self, other):
10045  """Create the Z3 expression division `self / other`."""
10046  return self.__div__(other)
10047 
def __div__(self, other)
Definition: z3py.py:10016
def __truediv__(self, other)
Definition: z3py.py:10044
def as_string (   self)
Return a Z3 floating point expression as a Python string.

Definition at line 9913 of file z3py.py.

9913  def as_string(self):
9914  """Return a Z3 floating point expression as a Python string."""
9915  return Z3_ast_to_string(self.ctx_ref(), self.as_ast())
9916 
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:419
def ctx_ref(self)
Definition: z3py.py:427
def as_string(self)
Definition: z3py.py:9913
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 9897 of file z3py.py.

9897  def ebits(self):
9898  """Retrieves the number of bits reserved for the exponent in the FloatingPoint expression `self`.
9899  >>> b = FPSort(8, 24)
9900  >>> b.ebits()
9901  8
9902  """
9903  return self.sort().ebits()
9904 
def sort(self)
Definition: z3py.py:1035
def ebits(self)
Definition: z3py.py:9897
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 9905 of file z3py.py.

9905  def sbits(self):
9906  """Retrieves the number of bits reserved for the exponent in the FloatingPoint expression `self`.
9907  >>> b = FPSort(8, 24)
9908  >>> b.sbits()
9909  24
9910  """
9911  return self.sort().sbits()
9912 
def sbits(self)
Definition: z3py.py:9905
def sort(self)
Definition: z3py.py:1035
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 9886 of file z3py.py.

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

9886  def sort(self):
9887  """Return the sort of the floating-point expression `self`.
9888 
9889  >>> x = FP('1.0', FPSort(8, 24))
9890  >>> x.sort()
9891  FPSort(8, 24)
9892  >>> x.sort() == FPSort(8, 24)
9893  True
9894  """
9895  return FPSortRef(Z3_get_sort(self.ctx_ref(), self.as_ast()), self.ctx)
9896 
def as_ast(self)
Definition: z3py.py:419
def sort(self)
Definition: z3py.py:9886
def ctx_ref(self)
Definition: z3py.py:427
Z3_sort Z3_API Z3_get_sort(Z3_context c, Z3_ast a)
Return the sort of an AST node.