Z3
Public Member Functions
FPNumRef Class Reference

FP Numerals. More...

+ Inheritance diagram for FPNumRef:

Public Member Functions

def sign (self)
 
def sign_as_bv (self)
 
def significand (self)
 
def significand_as_long (self)
 
def significand_as_bv (self)
 
def exponent (self, biased=True)
 
def exponent_as_long (self, biased=True)
 
def exponent_as_bv (self, biased=True)
 
def isNaN (self)
 
def isInf (self)
 
def isZero (self)
 
def isNormal (self)
 
def isSubnormal (self)
 
def isPositive (self)
 
def isNegative (self)
 
def as_string (self)
 
- Public Member Functions inherited from FPRef
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__ (self, ast, ctx=None)
 
def __del__ (self)
 
def __deepcopy__ (self, memo={})
 
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 hash (self)
 
- Public Member Functions inherited from Z3PPObject
def use_pp (self)
 

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

Member Function Documentation

◆ as_string()

def as_string (   self)

Definition at line 8819 of file z3py.py.

8819  def as_string(self):
8820  s = Z3_get_numeral_string(self.ctx.ref(), self.as_ast())
8821  return ("FPVal(%s, %s)" % (s, self.sort()))
8822 
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.

◆ exponent()

def exponent (   self,
  biased = True 
)

Definition at line 8762 of file z3py.py.

8762  def exponent(self, biased=True):
8763  return Z3_fpa_get_numeral_exponent_string(self.ctx.ref(), self.as_ast(), biased)
8764 
Z3_string Z3_API Z3_fpa_get_numeral_exponent_string(Z3_context c, Z3_ast t, Z3_bool biased)
Return the exponent value of a floating-point numeral as a string.

◆ exponent_as_bv()

def exponent_as_bv (   self,
  biased = True 
)

Definition at line 8781 of file z3py.py.

8781  def exponent_as_bv(self, biased=True):
8782  return BitVecNumRef(Z3_fpa_get_numeral_exponent_bv(self.ctx.ref(), self.as_ast(), biased), self.ctx)
8783 
Z3_ast Z3_API Z3_fpa_get_numeral_exponent_bv(Z3_context c, Z3_ast t, Z3_bool biased)
Retrieves the exponent of a floating-point literal as a bit-vector expression.

◆ exponent_as_long()

def exponent_as_long (   self,
  biased = True 
)

Definition at line 8771 of file z3py.py.

8771  def exponent_as_long(self, biased=True):
8772  ptr = (ctypes.c_longlong * 1)()
8773  if not Z3_fpa_get_numeral_exponent_int64(self.ctx.ref(), self.as_ast(), ptr, biased):
8774  raise Z3Exception("error retrieving the exponent of a numeral.")
8775  return ptr[0]
8776 
Z3_bool Z3_API Z3_fpa_get_numeral_exponent_int64(Z3_context c, Z3_ast t, __int64 *n, Z3_bool biased)
Return the exponent value of a floating-point numeral as a signed 64-bit integer. ...

◆ isInf()

def isInf (   self)

Definition at line 8789 of file z3py.py.

8789  def isInf(self):
8790  return Z3_fpa_is_numeral_inf(self.ctx.ref(), self.as_ast())
8791 
Z3_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.

◆ isNaN()

def isNaN (   self)

Definition at line 8785 of file z3py.py.

8785  def isNaN(self):
8786  return Z3_fpa_is_numeral_nan(self.ctx.ref(), self.as_ast())
8787 
Z3_bool Z3_API Z3_fpa_is_numeral_nan(Z3_context c, Z3_ast t)
Checks whether a given floating-point numeral is a NaN.

◆ isNegative()

def isNegative (   self)

Definition at line 8809 of file z3py.py.

8809  def isNegative(self):
8810  return Z3_fpa_is_numeral_negative(self.ctx.ref(), self.as_ast())
8811 
Z3_bool Z3_API Z3_fpa_is_numeral_negative(Z3_context c, Z3_ast t)
Checks whether a given floating-point numeral is negative.

◆ isNormal()

def isNormal (   self)

Definition at line 8797 of file z3py.py.

8797  def isNormal(self):
8798  return Z3_fpa_is_numeral_normal(self.ctx.ref(), self.as_ast())
8799 
Z3_bool Z3_API Z3_fpa_is_numeral_normal(Z3_context c, Z3_ast t)
Checks whether a given floating-point numeral is normal.

◆ isPositive()

def isPositive (   self)

Definition at line 8805 of file z3py.py.

8805  def isPositive(self):
8806  return Z3_fpa_is_numeral_positive(self.ctx.ref(), self.as_ast())
8807 
Z3_bool Z3_API Z3_fpa_is_numeral_positive(Z3_context c, Z3_ast t)
Checks whether a given floating-point numeral is positive.

◆ isSubnormal()

def isSubnormal (   self)

Definition at line 8801 of file z3py.py.

8801  def isSubnormal(self):
8802  return Z3_fpa_is_numeral_subnormal(self.ctx.ref(), self.as_ast())
8803 
Z3_bool Z3_API Z3_fpa_is_numeral_subnormal(Z3_context c, Z3_ast t)
Checks whether a given floating-point numeral is subnormal.

◆ isZero()

def isZero (   self)

Definition at line 8793 of file z3py.py.

8793  def isZero(self):
8794  return Z3_fpa_is_numeral_zero(self.ctx.ref(), self.as_ast())
8795 
Z3_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.

◆ sign()

def sign (   self)

Definition at line 8718 of file z3py.py.

8718  def sign(self):
8719  l = (ctypes.c_int)()
8720  if Z3_fpa_get_numeral_sign(self.ctx.ref(), self.as_ast(), byref(l)) == False:
8721  raise Z3Exception("error retrieving the sign of a numeral.")
8722  return l.value != 0
8723 
Z3_bool Z3_API Z3_fpa_get_numeral_sign(Z3_context c, Z3_ast t, int *sgn)
Retrieves the sign of a floating-point literal.

◆ sign_as_bv()

def sign_as_bv (   self)

Definition at line 8728 of file z3py.py.

8728  def sign_as_bv(self):
8729  return BitVecNumRef(Z3_fpa_get_numeral_sign_bv(self.ctx.ref(), self.as_ast()), self.ctx)
8730 
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.

◆ significand()

def significand (   self)

Definition at line 8737 of file z3py.py.

8737  def significand(self):
8738  return Z3_fpa_get_numeral_significand_string(self.ctx.ref(), self.as_ast())
8739 
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.

◆ significand_as_bv()

def significand_as_bv (   self)

Definition at line 8753 of file z3py.py.

8753  def significand_as_bv(self):
8754  return BitVecNumRef(Z3_fpa_get_numeral_significand_bv(self.ctx.ref(), self.as_ast()), self.ctx)
8755 
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. ...

◆ significand_as_long()

def significand_as_long (   self)

Definition at line 8746 of file z3py.py.

8746  def significand_as_long(self):
8747  return Z3_fpa_get_numeral_significand_uint64(self.ctx.ref(), self.as_ast())
8748 
Z3_bool Z3_API Z3_fpa_get_numeral_significand_uint64(Z3_context c, Z3_ast t, __uint64 *n)
Return the significand value of a floating-point numeral as a uint64.