1
1
mirror of https://github.com/anoma/juvix.git synced 2024-12-15 01:52:11 +03:00
juvix/tests/positive/Termination/Fib.juvix

19 lines
265 B
Plaintext
Raw Normal View History

module Fib;
inductive 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;