aboutsummaryrefslogtreecommitdiff
path: root/comparison/Inpla/src/fib-38-reuse.in
blob: 6b3d32b3c14ef81c0c2f4f0c64f9527b12dd1d24 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// Fibonacci number
Fib(r) >< (int n)
| n == 0 => r~0
| n == 1 => r~1
| _ => Fib(cnt1)~(n-1), Fib(cnt2)~(n-2), (*L)Add(r,cnt2)~cnt1;

/* Add is realised as built-in.
Addd(r,n) >< (int m)
=> Addd2(r,m) ~ n;

Addd2(r,int m) >< (int n)
=> r~(m+n);
*/

Fib(r)~38;
r;
free r;