lean4-htt/tests/lean/reduceArity.lean

14 lines
356 B
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import Lean
open Lean Compiler LCNF
@[noinline] def double (x : Nat) := x + x
set_option pp.funBinderTypes true
set_option trace.Compiler.result true in
def g (n : Nat) (a b : α) (f : αα) :=
match n with
| 0 => a
| n+1 => f (g n a b f)
set_option trace.Compiler.result true in
def h (n : Nat) (a : Nat) :=
g n a a double + g a n n double