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 __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_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 __nonzero__ (self)
 
def __bool__ (self)
 
def sexpr (self)
 
def ctx_ref (self)
 
def eq (self, other)
 
def translate (self, target)
 
def __copy__ (self)
 
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 9038 of file z3py.py.

Member Function Documentation

◆ as_string()

def as_string (   self)
Return a Z3 floating point expression as a Python string.

Reimplemented from FPRef.

Definition at line 9152 of file z3py.py.

9152  def as_string(self):
9153  s = Z3_get_numeral_string(self.ctx.ref(), self.as_ast())
9154  return ("FPVal(%s, %s)" % (s, self.sort()))
9155 

◆ exponent()

def exponent (   self,
  biased = True 
)

Definition at line 9095 of file z3py.py.

9095  def exponent(self, biased=True):
9096  return Z3_fpa_get_numeral_exponent_string(self.ctx.ref(), self.as_ast(), biased)
9097 

◆ exponent_as_bv()

def exponent_as_bv (   self,
  biased = True 
)

Definition at line 9114 of file z3py.py.

9114  def exponent_as_bv(self, biased=True):
9115  return BitVecNumRef(Z3_fpa_get_numeral_exponent_bv(self.ctx.ref(), self.as_ast(), biased), self.ctx)
9116 

◆ exponent_as_long()

def exponent_as_long (   self,
  biased = True 
)

Definition at line 9104 of file z3py.py.

9104  def exponent_as_long(self, biased=True):
9105  ptr = (ctypes.c_longlong * 1)()
9106  if not Z3_fpa_get_numeral_exponent_int64(self.ctx.ref(), self.as_ast(), ptr, biased):
9107  raise Z3Exception("error retrieving the exponent of a numeral.")
9108  return ptr[0]
9109 

◆ isInf()

def isInf (   self)

Definition at line 9122 of file z3py.py.

9122  def isInf(self):
9123  return Z3_fpa_is_numeral_inf(self.ctx.ref(), self.as_ast())
9124 

◆ isNaN()

def isNaN (   self)

Definition at line 9118 of file z3py.py.

9118  def isNaN(self):
9119  return Z3_fpa_is_numeral_nan(self.ctx.ref(), self.as_ast())
9120 

◆ isNegative()

def isNegative (   self)

Definition at line 9142 of file z3py.py.

9142  def isNegative(self):
9143  return Z3_fpa_is_numeral_negative(self.ctx.ref(), self.as_ast())
9144 

◆ isNormal()

def isNormal (   self)

Definition at line 9130 of file z3py.py.

9130  def isNormal(self):
9131  return Z3_fpa_is_numeral_normal(self.ctx.ref(), self.as_ast())
9132 

◆ isPositive()

def isPositive (   self)

Definition at line 9138 of file z3py.py.

9138  def isPositive(self):
9139  return Z3_fpa_is_numeral_positive(self.ctx.ref(), self.as_ast())
9140 

◆ isSubnormal()

def isSubnormal (   self)

Definition at line 9134 of file z3py.py.

9134  def isSubnormal(self):
9135  return Z3_fpa_is_numeral_subnormal(self.ctx.ref(), self.as_ast())
9136 

◆ isZero()

def isZero (   self)

Definition at line 9126 of file z3py.py.

9126  def isZero(self):
9127  return Z3_fpa_is_numeral_zero(self.ctx.ref(), self.as_ast())
9128 

◆ sign()

def sign (   self)

Definition at line 9048 of file z3py.py.

9048  def sign(self):
9049  l = (ctypes.c_int)()
9050  if Z3_fpa_get_numeral_sign(self.ctx.ref(), self.as_ast(), byref(l)) == False:
9051  raise Z3Exception("error retrieving the sign of a numeral.")
9052  return l.value != 0
9053 

◆ sign_as_bv()

def sign_as_bv (   self)

Definition at line 9058 of file z3py.py.

9058  def sign_as_bv(self):
9059  return BitVecNumRef(Z3_fpa_get_numeral_sign_bv(self.ctx.ref(), self.as_ast()), self.ctx)
9060 

◆ significand()

def significand (   self)

Definition at line 9067 of file z3py.py.

9067  def significand(self):
9068  return Z3_fpa_get_numeral_significand_string(self.ctx.ref(), self.as_ast())
9069 

◆ significand_as_bv()

def significand_as_bv (   self)

Definition at line 9086 of file z3py.py.

9086  def significand_as_bv(self):
9087  return BitVecNumRef(Z3_fpa_get_numeral_significand_bv(self.ctx.ref(), self.as_ast()), self.ctx)
9088 

◆ significand_as_long()

def significand_as_long (   self)

Definition at line 9076 of file z3py.py.

9076  def significand_as_long(self):
9077  ptr = (ctypes.c_ulonglong * 1)()
9078  if not Z3_fpa_get_numeral_significand_uint64(self.ctx.ref(), self.as_ast(), ptr):
9079  raise Z3Exception("error retrieving the significand of a numeral.")
9080  return ptr[0]
9081 
Z3_fpa_is_numeral_positive
bool Z3_API Z3_fpa_is_numeral_positive(Z3_context c, Z3_ast t)
Checks whether a given floating-point numeral is positive.
Z3_fpa_is_numeral_inf
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.
Z3_fpa_get_numeral_exponent_bv
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.
Z3_fpa_get_numeral_exponent_int64
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.
Z3_fpa_is_numeral_negative
bool Z3_API Z3_fpa_is_numeral_negative(Z3_context c, Z3_ast t)
Checks whether a given floating-point numeral is negative.
Z3_get_numeral_string
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.
Z3_fpa_get_numeral_significand_uint64
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.
Z3_fpa_get_numeral_sign_bv
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.
Z3_fpa_is_numeral_nan
bool Z3_API Z3_fpa_is_numeral_nan(Z3_context c, Z3_ast t)
Checks whether a given floating-point numeral is a NaN.
Z3_fpa_get_numeral_significand_string
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.
Z3_fpa_get_numeral_exponent_string
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.
Z3_fpa_is_numeral_subnormal
bool Z3_API Z3_fpa_is_numeral_subnormal(Z3_context c, Z3_ast t)
Checks whether a given floating-point numeral is subnormal.
Z3_fpa_get_numeral_sign
bool Z3_API Z3_fpa_get_numeral_sign(Z3_context c, Z3_ast t, int *sgn)
Retrieves the sign of a floating-point literal.
Z3_fpa_is_numeral_normal
bool Z3_API Z3_fpa_is_numeral_normal(Z3_context c, Z3_ast t)
Checks whether a given floating-point numeral is normal.
Z3_fpa_is_numeral_zero
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.
Z3_fpa_get_numeral_significand_bv
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.