the support for mutual structural recursion (new since #4575) is extended so that Lean tries to infer it even without annotations. * The error message when termination checking fails looks quite different now. Maybe a bit better, maybe with more room for improvements. * If there are too many combinations (with an arbitrary cut-off) for a given argument type, it will just give up and ask the user to use `termination_by structural`. * It is now legal to specify `termination_by structural` on not necessarily all functions of a clique; this simply restricts the combinations of arguments that Lean considers. --------- Co-authored-by: Tobias Grosser <tobias@grosser.es>
105 lines
2.7 KiB
Text
105 lines
2.7 KiB
Text
Inferred termination argument:
|
|
termination_by n - i
|
|
Inferred termination argument:
|
|
termination_by xs.size - i
|
|
Inferred termination argument:
|
|
termination_by xs.size - i
|
|
Inferred termination argument:
|
|
termination_by (xs.size - i, ys.size - j)
|
|
Inferred termination argument:
|
|
termination_by (xs.size - i, i - j)
|
|
Inferred termination argument:
|
|
termination_by (xs.size - i, i)
|
|
guessLexDiff.lean:84:4-84:11: error: fail to show termination for
|
|
failure
|
|
with errors
|
|
failed to infer structural recursion:
|
|
Not considering parameter xs of failure:
|
|
it is unchanged in the recursive calls
|
|
Cannot use parameter i:
|
|
failed to eliminate recursive application
|
|
_root_.failure xs i
|
|
|
|
|
|
Could not find a decreasing measure.
|
|
The arguments relate at each recursive call as follows:
|
|
(<, ≤, =: relation proved, ? all proofs failed, _: no proof attempted)
|
|
i #1 #2 i + i
|
|
1) 85:26-38 = = = =
|
|
2) 85:58-76 ? < _ _
|
|
3) 85:26-38 = = = =
|
|
4) 88:26-42 _ < _ _
|
|
5) 88:26-42 ? ≤ ≤ ?
|
|
6) 88:26-42 _ < _ _
|
|
7) 88:26-42 _ < _ _
|
|
8) 88:26-42 _ < _ _
|
|
9) 97:8-20 _ < _ _
|
|
|
|
#1: xs.size - i
|
|
#2: xs.size - (i + 1)
|
|
|
|
Please use `termination_by` to specify a decreasing measure.
|
|
guessLexDiff.lean:102:4-102:18: error: fail to show termination for
|
|
mutual_failure
|
|
mutual_failure2
|
|
with errors
|
|
failed to infer structural recursion:
|
|
Not considering parameter xs of mutual_failure:
|
|
it is unchanged in the recursive calls
|
|
Not considering parameter xs of mutual_failure2:
|
|
it is unchanged in the recursive calls
|
|
Cannot use parameters i of mutual_failure and i of mutual_failure2:
|
|
failed to eliminate recursive application
|
|
mutual_failure2 xs i
|
|
|
|
|
|
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 mutual_failure to mutual_failure2 at 104:4-24:
|
|
i #1 #2
|
|
i = ? ?
|
|
#3 ? = ?
|
|
Call from mutual_failure to mutual_failure2 at 104:52-78:
|
|
i #1 #2
|
|
i ? _ _
|
|
#3 _ < _
|
|
Call from mutual_failure to mutual_failure2 at 104:4-24:
|
|
i #1 #2
|
|
i _ _ _
|
|
#3 _ = _
|
|
Call from mutual_failure to mutual_failure2 at 111:4-28:
|
|
i #1 #2
|
|
i _ _ _
|
|
#3 _ < _
|
|
Call from mutual_failure to mutual_failure2 at 117:8-28:
|
|
i #1 #2
|
|
i _ _ _
|
|
#3 _ ? _
|
|
Call from mutual_failure2 to mutual_failure at 123:4-23:
|
|
i #3
|
|
i _ _
|
|
#1 _ _
|
|
#2 _ _
|
|
Call from mutual_failure2 to mutual_failure at 123:50-75:
|
|
i #3
|
|
i _ _
|
|
#1 _ _
|
|
#2 _ _
|
|
Call from mutual_failure2 to mutual_failure at 127:4-27:
|
|
i #3
|
|
i _ _
|
|
#1 _ _
|
|
#2 _ _
|
|
Call from mutual_failure2 to mutual_failure at 133:8-27:
|
|
i #3
|
|
i _ _
|
|
#1 _ _
|
|
#2 _ _
|
|
|
|
|
|
#1: xs.size - i
|
|
#2: xs.size - (i + 1)
|
|
#3: xs.size - i
|
|
|
|
Please use `termination_by` to specify a decreasing measure.
|