lean4-htt/tests/elab/guessLexTricky2.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

25 lines
577 B
Text

/-!
Another “tricky” example from “Finding Lexicographic Orders for Termination Proofs in
Isabelle/HOL” by Lukas Bulwahn, Alexander Krauss, and Tobias Nipkow,
10.1007/978-3-540-74591-4_5.
Works out of the box!
-/
set_option showInferredTerminationBy true
mutual
def pedal : Nat → Nat → Nat → Nat
| 0, _m, c => c
| _n, 0, c => c
| n+1, m+1, c =>
if n < m
then coast n m (c + m + 1)
else pedal n (m + 1) (c + m + 1)
def coast : Nat → Nat → Nat → Nat
| n, m , c =>
if n < m
then coast n (m - 1) (c + n)
else pedal n m (c + n)
end