diff options
| author | Shinya Sato <shinnya.sato@gmail.com> | 2021-10-24 23:04:45 +0900 |
|---|---|---|
| committer | Shinya Sato <shinnya.sato@gmail.com> | 2021-10-24 23:04:45 +0900 |
| commit | 787dc13c837f0955fbd85b8f26a05d720d361333 (patch) | |
| tree | fec3abebb1e867e8b2239d7cf07b4c7d13ce0f81 /comparison/Inpla/src/fib-38-reuse.in | |
| parent | e607a57dfafb784c4e27da143214afb2ccd07fbf (diff) | |
| download | inpla-787dc13c837f0955fbd85b8f26a05d720d361333.tar.gz inpla-787dc13c837f0955fbd85b8f26a05d720d361333.zip | |
Upload the comparison directory
Diffstat (limited to 'comparison/Inpla/src/fib-38-reuse.in')
| -rw-r--r-- | comparison/Inpla/src/fib-38-reuse.in | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/comparison/Inpla/src/fib-38-reuse.in b/comparison/Inpla/src/fib-38-reuse.in new file mode 100644 index 0000000..6b3d32b --- /dev/null +++ b/comparison/Inpla/src/fib-38-reuse.in @@ -0,0 +1,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; |
