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

FP Sorts. More...

+ Inheritance diagram for FPSortRef:

Public Member Functions

def ebits
 
def sbits
 
def cast
 
- Public Member Functions inherited from SortRef
def as_ast
 
def get_id
 
def kind
 
def subsort
 
def cast
 
def name
 
def __eq__
 
def __ne__
 
def __hash__
 
- 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
 

Data Fields

 ctx
 
- Data Fields inherited from AstRef
 ast
 
 ctx
 

Detailed Description

FP Sorts.

Floating-point sort.

Definition at line 8655 of file z3py.py.

Member Function Documentation

def cast (   self,
  val 
)
Try to cast `val` as a floating-point expression.
>>> b = FPSort(8, 24)
>>> b.cast(1.0)
1
>>> b.cast(1.0).sexpr()
'(fp #b0 #x7f #b00000000000000000000000)'

Definition at line 8674 of file z3py.py.

8675  def cast(self, val):
8676  """Try to cast `val` as a floating-point expression.
8677  >>> b = FPSort(8, 24)
8678  >>> b.cast(1.0)
8679  1
8680  >>> b.cast(1.0).sexpr()
8681  '(fp #b0 #x7f #b00000000000000000000000)'
8682  """
8683  if is_expr(val):
8684  if z3_debug():
8685  _z3_assert(self.ctx == val.ctx, "Context mismatch")
8686  return val
8687  else:
8688  return FPVal(val, None, self, self.ctx)
8689 
def FPVal
Definition: z3py.py:9262
def is_expr
Definition: z3py.py:1105
def z3_debug
Definition: z3py.py:58
def ebits (   self)
Retrieves the number of bits reserved for the exponent in the FloatingPoint sort `self`.
>>> b = FPSort(8, 24)
>>> b.ebits()
8

Definition at line 8658 of file z3py.py.

8659  def ebits(self):
8660  """Retrieves the number of bits reserved for the exponent in the FloatingPoint sort `self`.
8661  >>> b = FPSort(8, 24)
8662  >>> b.ebits()
8663  8
8664  """
8665  return int(Z3_fpa_get_ebits(self.ctx_ref(), self.ast))
unsigned Z3_API Z3_fpa_get_ebits(Z3_context c, Z3_sort s)
Retrieves the number of bits reserved for the exponent in a FloatingPoint sort.
def ctx_ref
Definition: z3py.py:352
def sbits (   self)
Retrieves the number of bits reserved for the significand in the FloatingPoint sort `self`.
>>> b = FPSort(8, 24)
>>> b.sbits()
24

Definition at line 8666 of file z3py.py.

8667  def sbits(self):
8668  """Retrieves the number of bits reserved for the significand in the FloatingPoint sort `self`.
8669  >>> b = FPSort(8, 24)
8670  >>> b.sbits()
8671  24
8672  """
8673  return int(Z3_fpa_get_sbits(self.ctx_ref(), self.ast))
unsigned Z3_API Z3_fpa_get_sbits(Z3_context c, Z3_sort s)
Retrieves the number of bits reserved for the significand in a FloatingPoint sort.
def ctx_ref
Definition: z3py.py:352

Field Documentation

ctx

Definition at line 8684 of file z3py.py.