This module contains
- the data type
TerminationMeasure
, the elaborated form of aTerminationBy
clause, - the
TerminationMeasures
type for a clique, and - elaboration and deelaboration functions.
Elaborated form for a termination_by
clause.
The fn
has the same (value) arity as the recursive functions (stored in
arity
), and maps its measures (including fixed prefix, in unpacked form) to
the termination measure.
If structural := Bool
, then the fn
is a lambda picking out exactly one measure.
Instances For
Equations
- Lean.Elab.instInhabitedTerminationMeasure = { default := { ref := default, structural := default, fn := default } }
@[reducible, inline]
A complete set of TerminationMeasure
s, as applicable to a single clique.
Instances For
def
Lean.Elab.TerminationMeasure.elab
(funName : Name)
(type : Expr)
(arity extraParams : Nat)
(hint : TerminationBy)
:
Elaborates a TerminationBy
to an TerminationMeasure
.
type
is the full type of the original recursive function, including fixed prefix.hint : TerminationBy
is the syntacticTerminationBy
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Lean.Elab.TerminationMeasure.elab.parameters 1 = (Lean.MessageData.ofFormat ∘ Std.format) "one parameter"
- Lean.Elab.TerminationMeasure.elab.parameters x✝ = Lean.toMessageData "" ++ Lean.toMessageData x✝ ++ Lean.toMessageData " parameters"
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Delaborates a TerminationMeasure
back to a TerminationHint
, e.g. for termination_by?
.
This needs extra information:
arity
is the value arity of the recursive functionextraParams
indicates how many of the function's parameters are bound “after the colon”.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[irreducible]
def
Lean.Elab.TerminationMeasure.delab.go
(measure : TerminationMeasure)
:
Nat → TSyntaxArray `ident → PrettyPrinter.Delaborator.DelabM (TSyntax `Lean.Parser.Termination.terminationBy)
Equations
- One or more equations did not get rendered due to their size.