3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-27 10:55:50 +00:00

Bugfixes for the FPA API

This commit is contained in:
Christoph M. Wintersteiger 2016-10-21 15:39:02 +01:00
parent bb6d826908
commit 5bd00d3f83
2 changed files with 11 additions and 20 deletions

View file

@ -8496,7 +8496,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.
@ -8536,7 +8536,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):
@ -8722,7 +8722,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]