mirror of
https://github.com/Z3Prover/z3
synced 2025-06-13 01:16:15 +00:00
Fixed FPA Python doctest
This commit is contained in:
parent
d4dd608bad
commit
d6398c4fdc
1 changed files with 9 additions and 9 deletions
|
@ -8194,21 +8194,21 @@ def FP(name, fpsort, ctx=None):
|
||||||
>>> eq(x, x2)
|
>>> eq(x, x2)
|
||||||
True
|
True
|
||||||
"""
|
"""
|
||||||
ctx = fpsort.ctx
|
if isinstance(fpsort, FPSortRef):
|
||||||
|
ctx = fpsort.ctx
|
||||||
|
else:
|
||||||
|
ctx = _get_ctx(ctx)
|
||||||
return FPRef(Z3_mk_const(ctx.ref(), to_symbol(name, ctx), fpsort.ast), ctx)
|
return FPRef(Z3_mk_const(ctx.ref(), to_symbol(name, ctx), fpsort.ast), ctx)
|
||||||
|
|
||||||
def FPs(names, fpsort, ctx=None):
|
def FPs(names, fpsort, ctx=None):
|
||||||
"""Return an array of floating-point constants.
|
"""Return an array of floating-point constants.
|
||||||
|
|
||||||
>>> x, y, z = BitVecs('x y z', 16)
|
>>> x, y, z = FPs('x y z', FPSort(8, 24))
|
||||||
>>> x.size()
|
|
||||||
16
|
|
||||||
>>> x.sort()
|
>>> x.sort()
|
||||||
BitVec(16)
|
>>> x.sbits()
|
||||||
>>> Sum(x, y, z)
|
24
|
||||||
0 + x + y + z
|
>>> x.ebits()
|
||||||
>>> Product(x, y, z)
|
8
|
||||||
1*x*y*z
|
|
||||||
>>> simplify(Product(x, y, z))
|
>>> simplify(Product(x, y, z))
|
||||||
x*y*z
|
x*y*z
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue