mirror of
https://github.com/anoma/juvix.git
synced 2024-11-30 05:42:26 +03:00
20 lines
317 B
Plaintext
20 lines
317 B
Plaintext
-- mutual recursion
|
|
module test023;
|
|
|
|
import Stdlib.Prelude open;
|
|
|
|
terminating
|
|
f : Nat → Nat
|
|
|
|
| x := ite (x < 1) 1 (2 * x + g (sub x 1));
|
|
|
|
terminating
|
|
g : Nat → Nat
|
|
| x := ite (x < 1) 1 (x + h (sub x 1));
|
|
|
|
terminating
|
|
h : Nat → Nat
|
|
| x := ite (x < 1) 1 (x * f (sub x 1));
|
|
|
|
main : Nat := f 5 + f 10 + f 20;
|