This module contains
- the data type
TerminationArgument
, the elaborated form of aTerminationBy
clause, - the
TerminationArguments
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 arguments (including fixed prefix, in unpacked form) to
the termination argument.
If structural := Bool
, then the fn
is a lambda picking out exactly one argument.
- ref : Lean.Syntax
- structural : Bool
- fn : Lean.Expr
Instances For
Equations
- Lean.Elab.instInhabitedTerminationArgument = { default := { ref := default, structural := default, fn := default } }
@[reducible, inline]
A complete set of TerminationArgument
s, as applicable to a single clique.
Instances For
def
Lean.Elab.TerminationArgument.elab
(funName : Lake.Name)
(type : Lean.Expr)
(arity : Nat)
(extraParams : Nat)
(hint : Lean.Elab.TerminationBy)
:
Elaborates a TerminationBy
to an TerminationArgument
.
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.TerminationArgument.elab.parameters 1 = (Lean.MessageData.ofFormat ∘ Lean.format) "one parameter"
- Lean.Elab.TerminationArgument.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
def
Lean.Elab.TerminationArgument.delab
(arity : Nat)
(extraParams : Nat)
(termArg : Lean.Elab.TerminationArgument)
:
Lean.MetaM (Lean.TSyntax `Lean.Parser.Termination.terminationBy)
Delaborates a TerminationArgument
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 functions arguments are bound “after the colon”.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[irreducible]
def
Lean.Elab.TerminationArgument.delab.go
(termArg : Lean.Elab.TerminationArgument)
:
Nat →
Lean.TSyntaxArray `ident → Lean.PrettyPrinter.Delaborator.DelabM (Lean.TSyntax `Lean.Parser.Termination.terminationBy)
Equations
- One or more equations did not get rendered due to their size.