From a1928a243860f49786fae11b84592c1f6c8351f2 Mon Sep 17 00:00:00 2001 From: Nikolaj Bjorner Date: Tue, 28 Apr 2020 15:54:48 -0700 Subject: [PATCH] update expected --- src/api/python/z3/z3.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/api/python/z3/z3.py b/src/api/python/z3/z3.py index 0a01fd2e1..e9eb003bc 100644 --- a/src/api/python/z3/z3.py +++ b/src/api/python/z3/z3.py @@ -859,13 +859,14 @@ def RecFunction(name, *sig): def RecAddDefinition(f, args, body): """Set the body of a recursive function. - Recursive definitions are only unfolded during search. + Recursive definitions can be simplified if they are applied to ground + arguments. >>> ctx = Context() >>> fac = RecFunction('fac', IntSort(ctx), IntSort(ctx)) >>> n = Int('n', ctx) >>> RecAddDefinition(fac, n, If(n == 0, 1, n*fac(n-1))) >>> simplify(fac(5)) - fac(5) + 120 >>> s = Solver(ctx=ctx) >>> s.add(fac(n) < 3) >>> s.check()