mirror of
https://github.com/leanprover/lean4.git
synced 2026-03-17 18:34:06 +00:00
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.
26 lines
644 B
Lean4
26 lines
644 B
Lean4
def copy (curr : Nat) (input : Array Nat) (output : Array Nat) : Array Nat :=
|
|
if hcurr:curr < input.size then
|
|
copy (curr + 1) input (output.push (input[curr]'hcurr))
|
|
else
|
|
output
|
|
termination_by input.size - curr
|
|
|
|
/--
|
|
info: Try this:
|
|
[apply] termination_by input.size - curr
|
|
-/
|
|
#guard_msgs(drop warning, info) in
|
|
theorem foo (curr : Nat) (input : Array Nat) (output : Array Nat)
|
|
: ∀ (idx : Nat) (hidx1 : idx < curr),
|
|
(copy curr input output)[idx]'sorry
|
|
=
|
|
output[idx]'sorry := by
|
|
intro idx hidx
|
|
unfold copy
|
|
split
|
|
. rw [foo]
|
|
. rw [Array.getElem_push_lt]
|
|
. omega
|
|
. rfl
|
|
termination_by?
|