mirror of
https://github.com/anoma/juvix.git
synced 2024-12-15 01:52:11 +03:00
19 lines
265 B
Plaintext
19 lines
265 B
Plaintext
|
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;
|