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

40 lines
959 B
Text

inductive Foo : Nat → Type where
| foo: (Nat → Foo n) → Foo n
-- structural recursion failed, produced type incorrect term
/--
error: fail to show termination for
Foo.bar
with errors
failed to infer structural recursion:
Not considering parameter #2 of Foo.bar:
its type is an inductive datatype
Foo x✝¹
and the datatype parameter
x✝¹
depends on the function parameter
x✝¹
which is not fixed.
Cannot use parameter #1:
failed to eliminate recursive application
(f 0).bar
Could not find a decreasing measure.
The basic measures relate at each recursive call as follows:
(<, ≤, =: relation proved, ? all proofs failed, _: no proof attempted)
n #1
1) 36:14-23 = ?
#1: sizeOf x2
Please use `termination_by` to specify a decreasing measure.
-/
#guard_msgs in
def Foo.bar : {n: Nat} → Foo n → Foo n
| _, foo f => (f 0).bar
-- it works
def Foo.bar' {n: Nat} : Foo n → Foo n
| foo f => (f 0).bar'