-- letrec def sum : Int -> Int := letrec sum : Int -> Int := \(x : Int) if x = 0 then 0 else x + sum (x - 1) in sum; def fact : Int -> Int := \(x : Int) letrec fact' : Int -> Int -> Int := \(x : Int) \(acc : Int) if x = 0 then acc else fact' (x - 1) (acc * x) in fact' x 1; def fib : Int -> Int := letrec fib' : Int -> Int -> Int -> Int := \(n : Int) \(x : Int) \(y : Int) if n = 0 then x else fib' (n - 1) y (x + y) in \(n : Int) fib' n 0 1; def mutrec : Int -> Int -> Int := \(x5 : Int) \(x10 : Int) let two : Int := 2 in let one : Int := 1 in letrec[f g h] f : Int -> Int := \(x : Int) { if x < one then one else g (x - one) + two * x }; g : Int -> Int := \(x : Int) { if x < one then one else x + h (x - one) }; h : Int -> Int := \(x : Int) letrec z : Int := { if x < one then one else x * f (x - one) } in z; in f x5 + f x10 + g x5 + h x5; \(x3 : Int) \(x5 : Int) \(x10 : Int) \(x100 : Int) letrec x : Int := x3 in x + sum x100 + fact x5 + fib x10 + mutrec x5 x10 + letrec x : Int := 1 in letrec x' : Int := x + letrec x : Int := 2 in x in letrec x : Int := x' * x' in letrec y : Int := x + 2 in letrec z : Int := x + y in x + y + z