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

FP Numerals. More...

+ Inheritance diagram for FPNumRef:

Public Member Functions

def sign
 
def sign_as_bv
 
def significand
 
def significand_as_long
 
def significand_as_bv
 
def exponent
 
def exponent_as_long
 
def exponent_as_bv
 
def isNaN
 
def isInf
 
def isZero
 
def isNormal
 
def isSubnormal
 
def isPositive
 
def isNegative
 
def as_string
 
- Public Member Functions inherited from FPRef
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 Numerals.

The sign of the numeral.

>>> x = FPVal(+1.0, FPSort(8, 24))
>>> x.sign()
False
>>> x = FPVal(-1.0, FPSort(8, 24))
>>> x.sign()
True

Definition at line 9000 of file z3py.py.

Member Function Documentation

def as_string (   self)

Definition at line 9114 of file z3py.py.

9115  def as_string(self):
9116  s = Z3_get_numeral_string(self.ctx.ref(), self.as_ast())
9117  return ("FPVal(%s, %s)" % (s, self.sort()))
def sort
Definition: z3py.py:879
Z3_string Z3_API Z3_get_numeral_string(Z3_context c, Z3_ast a)
Return numeral value, as a string of a numeric constant term.
def as_ast
Definition: z3py.py:344
def as_string
Definition: z3py.py:9114
def exponent (   self,
  biased = True 
)

Definition at line 9057 of file z3py.py.

9058  def exponent(self, biased=True):
9059  return Z3_fpa_get_numeral_exponent_string(self.ctx.ref(), self.as_ast(), biased)
def exponent
Definition: z3py.py:9057
def as_ast
Definition: z3py.py:344
Z3_string Z3_API Z3_fpa_get_numeral_exponent_string(Z3_context c, Z3_ast t, bool biased)
Return the exponent value of a floating-point numeral as a string.
def exponent_as_bv (   self,
  biased = True 
)

Definition at line 9076 of file z3py.py.

9077  def exponent_as_bv(self, biased=True):
9078  return BitVecNumRef(Z3_fpa_get_numeral_exponent_bv(self.ctx.ref(), self.as_ast(), biased), self.ctx)
def exponent_as_bv
Definition: z3py.py:9076
Z3_ast Z3_API Z3_fpa_get_numeral_exponent_bv(Z3_context c, Z3_ast t, bool biased)
Retrieves the exponent of a floating-point literal as a bit-vector expression.
def as_ast
Definition: z3py.py:344
def exponent_as_long (   self,
  biased = True 
)

Definition at line 9066 of file z3py.py.

9067  def exponent_as_long(self, biased=True):
9068  ptr = (ctypes.c_longlong * 1)()
9069  if not Z3_fpa_get_numeral_exponent_int64(self.ctx.ref(), self.as_ast(), ptr, biased):
9070  raise Z3Exception("error retrieving the exponent of a numeral.")
9071  return ptr[0]
bool Z3_API Z3_fpa_get_numeral_exponent_int64(Z3_context c, Z3_ast t, int64_t *n, bool biased)
Return the exponent value of a floating-point numeral as a signed 64-bit integer. ...
def as_ast
Definition: z3py.py:344
def exponent_as_long
Definition: z3py.py:9066
def isInf (   self)

Definition at line 9084 of file z3py.py.

9085  def isInf(self):
9086  return Z3_fpa_is_numeral_inf(self.ctx.ref(), self.as_ast())
def isInf
Definition: z3py.py:9084
bool Z3_API Z3_fpa_is_numeral_inf(Z3_context c, Z3_ast t)
Checks whether a given floating-point numeral is a +oo or -oo.
def as_ast
Definition: z3py.py:344
def isNaN (   self)

Definition at line 9080 of file z3py.py.

9081  def isNaN(self):
9082  return Z3_fpa_is_numeral_nan(self.ctx.ref(), self.as_ast())
def as_ast
Definition: z3py.py:344
bool Z3_API Z3_fpa_is_numeral_nan(Z3_context c, Z3_ast t)
Checks whether a given floating-point numeral is a NaN.
def isNaN
Definition: z3py.py:9080
def isNegative (   self)

Definition at line 9104 of file z3py.py.

9105  def isNegative(self):
9106  return Z3_fpa_is_numeral_negative(self.ctx.ref(), self.as_ast())
def isNegative
Definition: z3py.py:9104
def as_ast
Definition: z3py.py:344
bool Z3_API Z3_fpa_is_numeral_negative(Z3_context c, Z3_ast t)
Checks whether a given floating-point numeral is negative.
def isNormal (   self)

Definition at line 9092 of file z3py.py.

9093  def isNormal(self):
9094  return Z3_fpa_is_numeral_normal(self.ctx.ref(), self.as_ast())
def isNormal
Definition: z3py.py:9092
bool Z3_API Z3_fpa_is_numeral_normal(Z3_context c, Z3_ast t)
Checks whether a given floating-point numeral is normal.
def as_ast
Definition: z3py.py:344
def isPositive (   self)

Definition at line 9100 of file z3py.py.

9101  def isPositive(self):
9102  return Z3_fpa_is_numeral_positive(self.ctx.ref(), self.as_ast())
def isPositive
Definition: z3py.py:9100
bool Z3_API Z3_fpa_is_numeral_positive(Z3_context c, Z3_ast t)
Checks whether a given floating-point numeral is positive.
def as_ast
Definition: z3py.py:344
def isSubnormal (   self)

Definition at line 9096 of file z3py.py.

9097  def isSubnormal(self):
9098  return Z3_fpa_is_numeral_subnormal(self.ctx.ref(), self.as_ast())
def isSubnormal
Definition: z3py.py:9096
bool Z3_API Z3_fpa_is_numeral_subnormal(Z3_context c, Z3_ast t)
Checks whether a given floating-point numeral is subnormal.
def as_ast
Definition: z3py.py:344
def isZero (   self)

Definition at line 9088 of file z3py.py.

9089  def isZero(self):
9090  return Z3_fpa_is_numeral_zero(self.ctx.ref(), self.as_ast())
def isZero
Definition: z3py.py:9088
def as_ast
Definition: z3py.py:344
bool Z3_API Z3_fpa_is_numeral_zero(Z3_context c, Z3_ast t)
Checks whether a given floating-point numeral is +zero or -zero.
def sign (   self)

Definition at line 9010 of file z3py.py.

9011  def sign(self):
9012  l = (ctypes.c_int)()
9013  if Z3_fpa_get_numeral_sign(self.ctx.ref(), self.as_ast(), byref(l)) == False:
9014  raise Z3Exception("error retrieving the sign of a numeral.")
9015  return l.value != 0
def sign
Definition: z3py.py:9010
def as_ast
Definition: z3py.py:344
bool Z3_API Z3_fpa_get_numeral_sign(Z3_context c, Z3_ast t, int *sgn)
Retrieves the sign of a floating-point literal.
def sign_as_bv (   self)

Definition at line 9020 of file z3py.py.

9021  def sign_as_bv(self):
9022  return BitVecNumRef(Z3_fpa_get_numeral_sign_bv(self.ctx.ref(), self.as_ast()), self.ctx)
def sign_as_bv
Definition: z3py.py:9020
Z3_ast Z3_API Z3_fpa_get_numeral_sign_bv(Z3_context c, Z3_ast t)
Retrieves the sign of a floating-point literal as a bit-vector expression.
def as_ast
Definition: z3py.py:344
def significand (   self)

Definition at line 9029 of file z3py.py.

9030  def significand(self):
9031  return Z3_fpa_get_numeral_significand_string(self.ctx.ref(), self.as_ast())
def significand
Definition: z3py.py:9029
Z3_string Z3_API Z3_fpa_get_numeral_significand_string(Z3_context c, Z3_ast t)
Return the significand value of a floating-point numeral as a string.
def as_ast
Definition: z3py.py:344
def significand_as_bv (   self)

Definition at line 9048 of file z3py.py.

9049  def significand_as_bv(self):
9050  return BitVecNumRef(Z3_fpa_get_numeral_significand_bv(self.ctx.ref(), self.as_ast()), self.ctx)
def significand_as_bv
Definition: z3py.py:9048
Z3_ast Z3_API Z3_fpa_get_numeral_significand_bv(Z3_context c, Z3_ast t)
Retrieves the significand of a floating-point literal as a bit-vector expression. ...
def as_ast
Definition: z3py.py:344
def significand_as_long (   self)

Definition at line 9038 of file z3py.py.

9039  def significand_as_long(self):
9040  ptr = (ctypes.c_ulonglong * 1)()
9041  if not Z3_fpa_get_numeral_significand_uint64(self.ctx.ref(), self.as_ast(), ptr):
9042  raise Z3Exception("error retrieving the significand of a numeral.")
9043  return ptr[0]
bool Z3_API Z3_fpa_get_numeral_significand_uint64(Z3_context c, Z3_ast t, uint64_t *n)
Return the significand value of a floating-point numeral as a uint64.
def significand_as_long
Definition: z3py.py:9038
def as_ast
Definition: z3py.py:344