Support for termination_by notation #
A single termination_by clause
- ref : Lean.Syntax
- vars : Lean.TSyntaxArray [`ident, `Lean.Parser.Term.hole]
- body : Lean.Term
Instances For
Equations
- Lean.Elab.WF.instInhabitedTerminationBy = { default := { ref := default, vars := default, body := default } }
Equations
- One or more equations did not get rendered due to their size.
Instances For
A complete set of termination_by hints, as applicable to a single clique.
Instances For
A single decreasing_by clause
- ref : Lean.Syntax
- tactic : Lean.TSyntax `Lean.Parser.Tactic.tacticSeq
Instances For
Equations
- Lean.Elab.WF.instInhabitedDecreasingBy = { default := { ref := default, tactic := default } }
The termination annotations for a single function.
For decreasing_by, we store the whole decreasing_by tacticSeq expression, as this
is what Term.runTactic expects.
- ref : Lean.Syntax
- termination_by? : Option Lean.Elab.WF.TerminationBy
- decreasing_by? : Option Lean.Elab.WF.DecreasingBy
- extraParams : Nat
Here we record the number of parameters past the
:. This isGuessLexwhen there is notermination_byannotation, so that we can print the guessed order in the right form.- If there are fewer variables in the
termination_byannotation than there are extra parameters, we know which parameters they should apply to.
It it set in
TerminationHints.checkVars, which is the place where we also check that the user does not bind more extra parameters than present in the predefinition.
Instances For
Equations
- Lean.Elab.WF.instInhabitedTerminationHints = { default := { ref := default, termination_by? := default, decreasing_by? := default, extraParams := default } }
Equations
- Lean.Elab.WF.TerminationHints.none = { ref := Lean.Syntax.missing, termination_by? := none, decreasing_by? := none, extraParams := 0 }
Instances For
Logs warnings when the TerminationHints are present.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Checks that termination_by binds at most as many variables are present in the outermost
lambda of value, and logs (without failing) appropriate errors.
Also remembers extraParams for later use.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Takes apart a Termination.suffix syntax object
Equations
- One or more equations did not get rendered due to their size.