this makes `termination_by?` even slicker. The heuristics is agressive in the non-mutual case (will omit `sizeOf` if the argument is non-dependent and the `WellFoundedRelation` relation is via `sizeOfWFRel`. In the mutual case we'd also have to check the arguments, as they line up in the termination argument, have the same types. I did not bother at this point; in the mutual case we omit `sizeOf` only if the argument type is `Nat`. As a drive-by fix, `termination_by?` now also works on functions that have only one plausible measure.
65 lines
2.1 KiB
Text
65 lines
2.1 KiB
Text
Inferred termination argument:
|
|
termination_by (n, m)
|
|
Inferred termination argument:
|
|
termination_by (m, n)
|
|
Inferred termination argument:
|
|
termination_by (n, m)
|
|
Inferred termination argument:
|
|
termination_by x1 x2 => (x2, x1)
|
|
Inferred termination argument:
|
|
termination_by x1 => x1
|
|
Inferred termination argument:
|
|
termination_by x1 => x1
|
|
Inferred termination argument:
|
|
termination_by x1 => x1
|
|
Inferred termination argument:
|
|
termination_by x1 => x1
|
|
Inferred termination argument:
|
|
termination_by x1 => (x1, 0)
|
|
Inferred termination argument:
|
|
termination_by (n, 1)
|
|
Inferred termination argument:
|
|
termination_by (m, n)
|
|
Inferred termination argument:
|
|
termination_by x1 x2 x3 x4 x5 x6 x7 x8 => (x8, x7, x6, x5, x4, x3, x2, x1)
|
|
Inferred termination argument:
|
|
termination_by x1 => sizeOf x1
|
|
Inferred termination argument:
|
|
termination_by x1 x2 => (x1, sizeOf x2)
|
|
Inferred termination argument:
|
|
termination_by x1 x2 => x1
|
|
Inferred termination argument:
|
|
termination_by (sizeOf a, 1)
|
|
Inferred termination argument:
|
|
termination_by (sizeOf a, 0)
|
|
Inferred termination argument:
|
|
termination_by x2' => x2'
|
|
Inferred termination argument:
|
|
termination_by x2 => x2
|
|
Inferred termination argument:
|
|
termination_by x1 => sizeOf x1
|
|
Inferred termination argument:
|
|
termination_by x2 => SizeOf.sizeOf x2
|
|
Inferred termination argument:
|
|
termination_by x1 x2 => SizeOf.sizeOf x1
|
|
Inferred termination argument:
|
|
termination_by x2 => SizeOf.sizeOf x2
|
|
Inferred termination argument:
|
|
termination_by x1 => x1
|
|
Inferred termination argument:
|
|
termination_by x1 => sizeOf x1
|
|
Inferred termination argument:
|
|
termination_by x1 => x1
|
|
Inferred termination argument:
|
|
termination_by sizeOf o
|
|
guessLex.lean:217:0-229:3: error: 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 MutualNotNat2.MutualNotNat2.MutualNotNat3.foo to MutualNotNat2.MutualNotNat2.MutualNotNat3.bar at 221:23-35:
|
|
x1
|
|
x1 <
|
|
Call from MutualNotNat2.MutualNotNat2.MutualNotNat3.bar to MutualNotNat2.MutualNotNat2.MutualNotNat3.foo at 226:30-42:
|
|
x1
|
|
x1 ?
|
|
|
|
Please use `termination_by` to specify a decreasing measure.
|