1
1
mirror of https://github.com/anoma/juvix.git synced 2024-12-14 17:32:00 +03:00
juvix/tests/positive/Termination/Fib.juvix

18 lines
257 B
Plaintext

module Fib;
type Nat :=
zero : Nat
| suc : Nat → Nat;
infixl 6 +;
+ : Nat → Nat → Nat;
+ zero b := b;
+ (suc a) b := suc (a + b);
fib : Nat -> Nat;
fib zero := zero;
fib (suc (zero)) := suc zero;
fib (suc (suc n)) := fib (suc n) + fib n;
end;