Z3
Public Member Functions
FPNumRef Class Reference

FP Numerals. More...

+ Inheritance diagram for FPNumRef:

Public Member Functions

def isNaN (self)
 
def isInf (self)
 
def isZero (self)
 
def isNegative (self)
 
def sign (self)
 
def significand (self)
 
def exponent (self)
 
def exponent_as_long (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 __ne__ (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 __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 __ne__ (self, other)
 
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 __str__ (self)
 
def __repr__ (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.

Definition at line 8014 of file z3py.py.

Member Function Documentation

def as_string (   self)

Definition at line 8081 of file z3py.py.

8081  def as_string(self):
8082  s = Z3_fpa_get_numeral_string(self.ctx.ref(), self.as_ast())
8083  return ("FPVal(%s, %s)" % (s, FPSortRef(self.sort()).as_string()))
8084 
8085 
def as_ast(self)
Definition: z3py.py:296
def sort(self)
Definition: z3py.py:752
FP Sorts.
Definition: z3py.py:7698
def as_string(self)
Definition: z3py.py:8081
def exponent (   self)

Definition at line 8060 of file z3py.py.

8060  def exponent(self):
8061  return Z3_fpa_get_numeral_exponent_string(self.ctx.ref(), self.as_ast())
8062 
Z3_string Z3_API Z3_fpa_get_numeral_exponent_string(Z3_context c, Z3_ast t)
Return the exponent value of a floating-point numeral as a string.
def as_ast(self)
Definition: z3py.py:296
def exponent(self)
Definition: z3py.py:8060
def exponent_as_long (   self)

Definition at line 8069 of file z3py.py.

8069  def exponent_as_long(self):
8070  ptr = (ctypes.c_longlong * 1)()
8071  if not Z3_fpa_get_numeral_exponent_int64(self.ctx.ref(), self.as_ast(), ptr):
8072  raise Z3Exception("error retrieving the exponent of a numeral.")
8073  return ptr[0]
8074 
def as_ast(self)
Definition: z3py.py:296
Z3_bool Z3_API Z3_fpa_get_numeral_exponent_int64(Z3_context c, Z3_ast t, __int64 *n)
Return the exponent value of a floating-point numeral as a signed 64-bit integer. ...
def exponent_as_long(self)
Definition: z3py.py:8069
def isInf (   self)

Definition at line 8018 of file z3py.py.

8018  def isInf(self):
8019  return self.decl().kind() == Z3_OP_FPA_PLUS_INF or self.decl().kind() == Z3_OP_FPA_MINUS_INF
8020 
def isInf(self)
Definition: z3py.py:8018
def decl(self)
Definition: z3py.py:810
def isNaN (   self)

Definition at line 8015 of file z3py.py.

8015  def isNaN(self):
8016  return self.decl().kind() == Z3_OP_FPA_NAN
8017 
def isNaN(self)
Definition: z3py.py:8015
def decl(self)
Definition: z3py.py:810
def isNegative (   self)

Definition at line 8024 of file z3py.py.

8024  def isNegative(self):
8025  k = self.decl().kind()
8026  return (self.num_args() == 0 and (k == Z3_OP_FPA_MINUS_INF or k == Z3_OP_FPA_MINUS_ZERO)) or (self.sign() == True)
8027 
def isNegative(self)
Definition: z3py.py:8024
def decl(self)
Definition: z3py.py:810
def num_args(self)
Definition: z3py.py:825
def sign(self)
Definition: z3py.py:8038
def isZero (   self)

Definition at line 8021 of file z3py.py.

8021  def isZero(self):
8022  return self.decl().kind() == Z3_OP_FPA_PLUS_ZERO or self.decl().kind() == Z3_OP_FPA_MINUS_ZERO
8023 
def decl(self)
Definition: z3py.py:810
def isZero(self)
Definition: z3py.py:8021
def sign (   self)

Definition at line 8038 of file z3py.py.

Referenced by FPNumRef.isNegative().

8038  def sign(self):
8039  l = (ctypes.c_int)()
8040  if Z3_fpa_get_numeral_sign(self.ctx.ref(), self.as_ast(), byref(l)) == False:
8041  raise Z3Exception("error retrieving the sign of a numeral.")
8042  return l.value != 0
8043 
def as_ast(self)
Definition: z3py.py:296
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.
def sign(self)
Definition: z3py.py:8038
def significand (   self)

Definition at line 8050 of file z3py.py.

8050  def significand(self):
8051  return Z3_fpa_get_numeral_significand_string(self.ctx.ref(), self.as_ast())
8052 
def as_ast(self)
Definition: z3py.py:296
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 significand(self)
Definition: z3py.py:8050