lean4-htt/tests/elab/def17.lean
Garmelon 08eb78a5b2
chore: switch to new test/bench suite (#12590)
This PR sets up the new integrated test/bench suite. It then migrates
all benchmarks and some related tests to the new suite. There's also
some documentation and some linting.

For now, a lot of the old tests are left alone so this PR doesn't become
even larger than it already is. Eventually, all tests should be migrated
to the new suite though so there isn't a confusing mix of two systems.
2026-02-25 13:51:53 +00:00

27 lines
519 B
Text

def mk (a : Nat) : Nat → List Nat
| 0 => []
| n+1 => a :: mk a n
def sum : List Nat → Nat → Nat
| [], r => r
| n::ns, r => sum ns (r + n)
def loop1 : Nat → Nat → Nat
| s, 0 => s
| s, n+1 => loop1 (s + (sum (mk 1 1000000) 0)) n
def loop2 : Nat → Nat → Nat
| 0, s => s
| n+1, s => loop2 n (s + (sum (mk 1 1000000) 0))
def expensive (n : Nat) : Nat :=
100000000000000 - 100000000000000
def foo : Nat → Nat
| n => expensive n
def bla : Nat → Nat
| 100 => expensive 0
| _ => expensive 1