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.
32 lines
801 B
Text
32 lines
801 B
Text
partial def f (x : Nat) : Nat → Nat
|
||
| 0 => x + 1
|
||
| i+1 => h i + 2
|
||
where
|
||
g y := f x y
|
||
h y := g y + 1
|
||
|
||
def reverse (as : List α) : List α :=
|
||
loop as []
|
||
where
|
||
loop : List α → List α → List α
|
||
| [], acc => acc
|
||
| a::as, acc => loop as (a::acc)
|
||
|
||
theorem ex : reverse [1, 2, 3] = [3, 2, 1] :=
|
||
rfl
|
||
|
||
theorem lengthReverse (as : List α) : (reverse as).length = as.length :=
|
||
revLoop as []
|
||
where
|
||
revLoop (as bs : List α) : (reverse.loop as bs).length = as.length + bs.length := by
|
||
induction as generalizing bs with
|
||
| nil => simp [reverse.loop]
|
||
| cons a as ih =>
|
||
show (reverse.loop as (a::bs)).length = (a :: as).length + bs.length
|
||
simp [ih, Nat.add_assoc, Nat.succ_add]
|
||
|
||
def h : Nat -> Nat
|
||
| 0 => g 0
|
||
| x+1 => g (h x)
|
||
where
|
||
g x := x + 1
|