1
1
mirror of https://github.com/anoma/juvix.git synced 2024-12-12 14:28:08 +03:00
juvix/tests/Rust/Compilation/positive/test023.juvix
2024-07-02 10:03:06 +02:00

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;