Z3
 
Loading...
Searching...
No Matches
FPNumRef Class Reference
+ Inheritance diagram for FPNumRef:

Public Member Functions

 sign (self)
 
 sign_as_bv (self)
 
 significand (self)
 
 significand_as_long (self)
 
 significand_as_bv (self)
 
 exponent (self, biased=True)
 
 exponent_as_long (self, biased=True)
 
 exponent_as_bv (self, biased=True)
 
 isNaN (self)
 
 isInf (self)
 
 isZero (self)
 
 isNormal (self)
 
 isSubnormal (self)
 
 isPositive (self)
 
 isNegative (self)
 
 as_string (self)
 
- Public Member Functions inherited from FPRef
 sort (self)
 
 ebits (self)
 
 sbits (self)
 
 __le__ (self, other)
 
 __lt__ (self, other)
 
 __ge__ (self, other)
 
 __gt__ (self, other)
 
 __add__ (self, other)
 
 __radd__ (self, other)
 
 __sub__ (self, other)
 
 __rsub__ (self, other)
 
 __mul__ (self, other)
 
 __rmul__ (self, other)
 
 __pos__ (self)
 
 __neg__ (self)
 
 __div__ (self, other)
 
 __rdiv__ (self, other)
 
 __truediv__ (self, other)
 
 __rtruediv__ (self, other)
 
 __mod__ (self, other)
 
 __rmod__ (self, other)
 
- Public Member Functions inherited from ExprRef
 as_ast (self)
 
 get_id (self)
 
 sort_kind (self)
 
 __eq__ (self, other)
 
 __hash__ (self)
 
 __ne__ (self, other)
 
 params (self)
 
 decl (self)
 
 num_args (self)
 
 arg (self, idx)
 
 children (self)
 
 from_string (self, s)
 
 serialize (self)
 
- Public Member Functions inherited from AstRef
 __init__ (self, ast, ctx=None)
 
 __del__ (self)
 
 __deepcopy__ (self, memo={})
 
 __str__ (self)
 
 __repr__ (self)
 
 __nonzero__ (self)
 
 __bool__ (self)
 
 sexpr (self)
 
 ctx_ref (self)
 
 eq (self, other)
 
 translate (self, target)
 
 __copy__ (self)
 
 hash (self)
 
- Public Member Functions inherited from Z3PPObject
 use_pp (self)
 

Data Fields

 ctx
 
- Data Fields inherited from FPRef
 ctx = _coerce_fp_expr_list([other, self], self.ctx)
 
- Data Fields inherited from ExprRef
 ctx
 
- Data Fields inherited from AstRef
 ast = ast
 
 ctx = _get_ctx(ctx)
 

Additional Inherited Members

- Protected Member Functions inherited from Z3PPObject
 _repr_html_ (self)
 

Detailed Description

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

Member Function Documentation

◆ as_string()

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

Reimplemented from FPRef.

Definition at line 10000 of file z3py.py.

10000 def as_string(self):
10001 s = Z3_get_numeral_string(self.ctx.ref(), self.as_ast())
10002 return ("FPVal(%s, %s)" % (s, self.sort()))
10003
10004
Z3_string Z3_API Z3_get_numeral_string(Z3_context c, Z3_ast a)
Return numeral value, as a decimal string of a numeric constant term.

Referenced by BitVecNumRef.as_long(), and IntNumRef.as_long().

◆ exponent()

exponent ( self,
biased = True )

Definition at line 9933 of file z3py.py.

9933 def exponent(self, biased=True):
9934 return Z3_fpa_get_numeral_exponent_string(self.ctx.ref(), self.as_ast(), biased)
9935
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.

◆ exponent_as_bv()

exponent_as_bv ( self,
biased = True )

Definition at line 9954 of file z3py.py.

9954 def exponent_as_bv(self, biased=True):
9955 return BitVecNumRef(Z3_fpa_get_numeral_exponent_bv(self.ctx.ref(), self.as_ast(), biased), self.ctx)
9956
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.

◆ exponent_as_long()

exponent_as_long ( self,
biased = True )

Definition at line 9943 of file z3py.py.

9943 def exponent_as_long(self, biased=True):
9944 ptr = (ctypes.c_longlong * 1)()
9945 if not Z3_fpa_get_numeral_exponent_int64(self.ctx.ref(), self.as_ast(), ptr, biased):
9946 raise Z3Exception("error retrieving the exponent of a numeral.")
9947 return ptr[0]
9948
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.

◆ isInf()

isInf ( self)

Definition at line 9964 of file z3py.py.

9964 def isInf(self):
9965 return Z3_fpa_is_numeral_inf(self.ctx.ref(), self.as_ast())
9966
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()

isNaN ( self)

Definition at line 9959 of file z3py.py.

9959 def isNaN(self):
9960 return Z3_fpa_is_numeral_nan(self.ctx.ref(), self.as_ast())
9961
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()

isNegative ( self)

Definition at line 9989 of file z3py.py.

9989 def isNegative(self):
9990 return Z3_fpa_is_numeral_negative(self.ctx.ref(), self.as_ast())
9991
bool Z3_API Z3_fpa_is_numeral_negative(Z3_context c, Z3_ast t)
Checks whether a given floating-point numeral is negative.

◆ isNormal()

isNormal ( self)

Definition at line 9974 of file z3py.py.

9974 def isNormal(self):
9975 return Z3_fpa_is_numeral_normal(self.ctx.ref(), self.as_ast())
9976
bool Z3_API Z3_fpa_is_numeral_normal(Z3_context c, Z3_ast t)
Checks whether a given floating-point numeral is normal.

◆ isPositive()

isPositive ( self)

Definition at line 9984 of file z3py.py.

9984 def isPositive(self):
9985 return Z3_fpa_is_numeral_positive(self.ctx.ref(), self.as_ast())
9986
bool Z3_API Z3_fpa_is_numeral_positive(Z3_context c, Z3_ast t)
Checks whether a given floating-point numeral is positive.

◆ isSubnormal()

isSubnormal ( self)

Definition at line 9979 of file z3py.py.

9979 def isSubnormal(self):
9980 return Z3_fpa_is_numeral_subnormal(self.ctx.ref(), self.as_ast())
9981
bool Z3_API Z3_fpa_is_numeral_subnormal(Z3_context c, Z3_ast t)
Checks whether a given floating-point numeral is subnormal.

◆ isZero()

isZero ( self)

Definition at line 9969 of file z3py.py.

9969 def isZero(self):
9970 return Z3_fpa_is_numeral_zero(self.ctx.ref(), self.as_ast())
9971
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()

sign ( self)

Definition at line 9880 of file z3py.py.

9880 def sign(self):
9881 num = (ctypes.c_int)()
9882 nsign = Z3_fpa_get_numeral_sign(self.ctx.ref(), self.as_ast(), byref(num))
9883 if nsign is False:
9884 raise Z3Exception("error retrieving the sign of a numeral.")
9885 return num.value != 0
9886
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()

sign_as_bv ( self)

Definition at line 9892 of file z3py.py.

9892 def sign_as_bv(self):
9893 return BitVecNumRef(Z3_fpa_get_numeral_sign_bv(self.ctx.ref(), self.as_ast()), self.ctx)
9894
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()

significand ( self)

Definition at line 9902 of file z3py.py.

9902 def significand(self):
9903 return Z3_fpa_get_numeral_significand_string(self.ctx.ref(), self.as_ast())
9904
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()

significand_as_bv ( self)

Definition at line 9923 of file z3py.py.

9923 def significand_as_bv(self):
9924 return BitVecNumRef(Z3_fpa_get_numeral_significand_bv(self.ctx.ref(), self.as_ast()), self.ctx)
9925
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()

significand_as_long ( self)

Definition at line 9912 of file z3py.py.

9912 def significand_as_long(self):
9913 ptr = (ctypes.c_ulonglong * 1)()
9914 if not Z3_fpa_get_numeral_significand_uint64(self.ctx.ref(), self.as_ast(), ptr):
9915 raise Z3Exception("error retrieving the significand of a numeral.")
9916 return ptr[0]
9917
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.

Field Documentation

◆ ctx

ctx

Definition at line 9893 of file z3py.py.

Referenced by ArithRef.__add__(), BitVecRef.__add__(), BitVecRef.__and__(), FuncDeclRef.__call__(), AstMap.__contains__(), AstRef.__copy__(), AstVector.__copy__(), FuncInterp.__copy__(), Goal.__copy__(), ModelRef.__copy__(), AstMap.__deepcopy__(), AstRef.__deepcopy__(), AstVector.__deepcopy__(), Datatype.__deepcopy__(), FuncEntry.__deepcopy__(), FuncInterp.__deepcopy__(), Goal.__deepcopy__(), ModelRef.__deepcopy__(), ParamDescrsRef.__deepcopy__(), ParamsRef.__deepcopy__(), Statistics.__deepcopy__(), AstMap.__del__(), AstRef.__del__(), AstVector.__del__(), Context.__del__(), FuncEntry.__del__(), FuncInterp.__del__(), Goal.__del__(), ModelRef.__del__(), ParamDescrsRef.__del__(), ParamsRef.__del__(), ScopedConstructor.__del__(), ScopedConstructorList.__del__(), Solver.__del__(), Statistics.__del__(), ArithRef.__div__(), BitVecRef.__div__(), ExprRef.__eq__(), ArithRef.__ge__(), BitVecRef.__ge__(), AstMap.__getitem__(), AstVector.__getitem__(), ModelRef.__getitem__(), Statistics.__getitem__(), ArithRef.__gt__(), BitVecRef.__gt__(), BitVecRef.__invert__(), ArithRef.__le__(), BitVecRef.__le__(), AstMap.__len__(), AstVector.__len__(), ModelRef.__len__(), Statistics.__len__(), BitVecRef.__lshift__(), ArithRef.__lt__(), BitVecRef.__lt__(), ArithRef.__mod__(), BitVecRef.__mod__(), ArithRef.__mul__(), BitVecRef.__mul__(), BoolRef.__mul__(), ExprRef.__ne__(), ArithRef.__neg__(), BitVecRef.__neg__(), BitVecRef.__or__(), ArithRef.__pow__(), ArithRef.__radd__(), BitVecRef.__radd__(), BitVecRef.__rand__(), ArithRef.__rdiv__(), BitVecRef.__rdiv__(), AstMap.__repr__(), ParamDescrsRef.__repr__(), ParamsRef.__repr__(), Statistics.__repr__(), BitVecRef.__rlshift__(), ArithRef.__rmod__(), BitVecRef.__rmod__(), ArithRef.__rmul__(), BitVecRef.__rmul__(), BitVecRef.__ror__(), ArithRef.__rpow__(), BitVecRef.__rrshift__(), BitVecRef.__rshift__(), ArithRef.__rsub__(), BitVecRef.__rsub__(), BitVecRef.__rxor__(), AstMap.__setitem__(), AstVector.__setitem__(), ArithRef.__sub__(), BitVecRef.__sub__(), BitVecRef.__xor__(), DatatypeSortRef.accessor(), ExprRef.arg(), FuncEntry.arg_value(), FuncInterp.arity(), Goal.as_expr(), Solver.assert_and_track(), Goal.assert_exprs(), Solver.assert_exprs(), QuantifierRef.body(), Solver.check(), Goal.convert_model(), AstRef.ctx_ref(), ExprRef.decl(), ModelRef.decls(), ArrayRef.default(), RatNumRef.denominator(), Goal.depth(), Goal.dimacs(), FuncDeclRef.domain(), ArraySortRef.domain_n(), FuncInterp.else_value(), FuncInterp.entry(), AstMap.erase(), ModelRef.eval(), Goal.get(), ParamDescrsRef.get_documentation(), ModelRef.get_interp(), Statistics.get_key_value(), ParamDescrsRef.get_kind(), ParamDescrsRef.get_name(), ModelRef.get_sort(), ModelRef.get_universe(), Goal.inconsistent(), AstMap.keys(), Statistics.keys(), Solver.model(), SortRef.name(), QuantifierRef.no_pattern(), FuncEntry.num_args(), FuncInterp.num_entries(), Solver.num_scopes(), ModelRef.num_sorts(), FuncDeclRef.params(), QuantifierRef.pattern(), AlgebraicNumRef.poly(), Solver.pop(), Goal.prec(), AstVector.push(), Solver.push(), QuantifierRef.qid(), ArraySortRef.range(), FuncDeclRef.range(), DatatypeSortRef.recognizer(), Context.ref(), AstMap.reset(), Solver.reset(), AstVector.resize(), ParamsRef.set(), Solver.set(), AstVector.sexpr(), Goal.sexpr(), ModelRef.sexpr(), Goal.size(), ParamDescrsRef.size(), QuantifierRef.skolem_id(), AstRef.translate(), AstVector.translate(), Goal.translate(), ModelRef.translate(), ParamsRef.validate(), FuncEntry.value(), QuantifierRef.var_name(), and QuantifierRef.var_sort().