this is in preparation for #4542, and extracts from `findRecArg` the functionality for trying one particular argument. It also refactors the code a bit. In particular * It reports errors in the order of the parameters, not the order of in which they are tried (it tries non-indices first). * For every argument it will say why it wasn't tried, even if the reason is quite obviously (fixed prefix, or `Prop`-typed etc.) Therefore there is some error message churn.
38 lines
1 KiB
Text
38 lines
1 KiB
Text
terminationFailure.lean:7:2-7:3: error: fail to show termination for
|
|
f.g
|
|
f
|
|
with errors
|
|
structural recursion does not handle mutually recursive functions
|
|
|
|
Could not find a decreasing measure.
|
|
The arguments relate at each recursive call as follows:
|
|
(<, ≤, =: relation proved, ? all proofs failed, _: no proof attempted)
|
|
Call from f.g to f at 9:9-12:
|
|
x1
|
|
x =
|
|
Call from f to f.g at 3:4-7:
|
|
x
|
|
x1 =
|
|
|
|
Please use `termination_by` to specify a decreasing measure.
|
|
f (x : Nat) : Nat
|
|
f.g : Nat → Nat
|
|
1
|
|
2
|
|
terminationFailure.lean:20:4-20:5: error: fail to show termination for
|
|
h
|
|
with errors
|
|
structural recursion cannot be used:
|
|
|
|
argument #1 cannot be used for structural recursion
|
|
failed to eliminate recursive application
|
|
h x
|
|
|
|
failed to prove termination, possible solutions:
|
|
- Use `have`-expressions to prove the remaining goals
|
|
- Use `termination_by` to specify a different well-founded relation
|
|
- Use `decreasing_by` to specify your own tactic for discharging this kind of goal
|
|
x : Nat
|
|
⊢ False
|
|
h (x : Nat) : Foo
|
|
Foo.a
|