3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-27 10:55:50 +00:00
This commit is contained in:
Nikolaj Bjorner 2016-10-22 21:51:11 -07:00
commit 6d3430c689
2 changed files with 11 additions and 20 deletions

View file

@ -8504,7 +8504,7 @@ class FPNumRef(FPRef):
"""
def as_string(self):
s = Z3_fpa_get_numeral_string(self.ctx.ref(), self.as_ast())
return ("FPVal(%s, %s)" % (s, FPSortRef(self.sort()).as_string()))
return ("FPVal(%s, %s)" % (s, self.sort()))
def is_fp(a):
"""Return `True` if `a` is a Z3 floating-point expression.
@ -8544,7 +8544,7 @@ def FPSort(ebits, sbits, ctx=None):
>>> eq(x, FP('x', FPSort(8, 24)))
True
"""
ctx = z3._get_ctx(ctx)
ctx = _get_ctx(ctx)
return FPSortRef(Z3_mk_fpa_sort(ctx.ref(), ebits, sbits), ctx)
def _to_float_str(val, exp=0):
@ -8730,7 +8730,7 @@ def FPs(names, fpsort, ctx=None):
>>> fpMul(RNE(), fpAdd(RNE(), x, y), z)
fpMul(RNE(), fpAdd(RNE(), x, y), z)
"""
ctx = z3._get_ctx(ctx)
ctx = _get_ctx(ctx)
if isinstance(names, str):
names = names.split(" ")
return [FP(name, fpsort, ctx) for name in names]