Z3
Public Member Functions | Data Fields
FPSortRef Class Reference

FP Sorts. More...

+ Inheritance diagram for FPSortRef:

Public Member Functions

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

Data Fields

 ctx
 
- Data Fields inherited from AstRef
 ast
 
 ctx
 

Detailed Description

FP Sorts.

Floating-point sort.

Definition at line 8694 of file z3py.py.

Member Function Documentation

◆ cast()

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)'

Reimplemented from SortRef.

Definition at line 8713 of file z3py.py.

8713  def cast(self, val):
8714  """Try to cast `val` as a floating-point expression.
8715  >>> b = FPSort(8, 24)
8716  >>> b.cast(1.0)
8717  1
8718  >>> b.cast(1.0).sexpr()
8719  '(fp #b0 #x7f #b00000000000000000000000)'
8720  """
8721  if is_expr(val):
8722  if z3_debug():
8723  _z3_assert(self.ctx == val.ctx, "Context mismatch")
8724  return val
8725  else:
8726  return FPVal(val, None, self, self.ctx)
8727 
8728 
def FPVal(sig, exp=None, fps=None, ctx=None)
Definition: z3py.py:9300
def z3_debug()
Definition: z3py.py:56
def is_expr(a)
Definition: z3py.py:1115

◆ ebits()

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

8697  def ebits(self):
8698  """Retrieves the number of bits reserved for the exponent in the FloatingPoint sort `self`.
8699  >>> b = FPSort(8, 24)
8700  >>> b.ebits()
8701  8
8702  """
8703  return int(Z3_fpa_get_ebits(self.ctx_ref(), self.ast))
8704 
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.

◆ sbits()

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

8705  def sbits(self):
8706  """Retrieves the number of bits reserved for the significand in the FloatingPoint sort `self`.
8707  >>> b = FPSort(8, 24)
8708  >>> b.sbits()
8709  24
8710  """
8711  return int(Z3_fpa_get_sbits(self.ctx_ref(), self.ast))
8712 
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.

Field Documentation

◆ ctx

ctx

Definition at line 8723 of file z3py.py.