Skip to content

Commit a1928a2

Browse files
update expected
1 parent 97fe2c8 commit a1928a2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/api/python/z3/z3.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -859,13 +859,14 @@ def RecFunction(name, *sig):
859859

860860
def RecAddDefinition(f, args, body):
861861
"""Set the body of a recursive function.
862-
Recursive definitions are only unfolded during search.
862+
Recursive definitions can be simplified if they are applied to ground
863+
arguments.
863864
>>> ctx = Context()
864865
>>> fac = RecFunction('fac', IntSort(ctx), IntSort(ctx))
865866
>>> n = Int('n', ctx)
866867
>>> RecAddDefinition(fac, n, If(n == 0, 1, n*fac(n-1)))
867868
>>> simplify(fac(5))
868-
fac(5)
869+
120
869870
>>> s = Solver(ctx=ctx)
870871
>>> s.add(fac(n) < 3)
871872
>>> s.check()

0 commit comments

Comments
 (0)