Documentation

Lean.Elab.PreDefinition.TerminationMeasure

This module contains

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
    @[reducible, inline]

    A complete set of TerminationMeasures, as applicable to a single clique.

    Equations
      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 syntactic TerminationBy.
        Equations
          Instances For
            def Lean.Elab.TerminationMeasure.delab (arity extraParams : Nat) (measure : TerminationMeasure) :
            MetaM (TSyntax `Lean.Parser.Termination.terminationBy)

            Delaborates a TerminationMeasure back to a TerminationHint, e.g. for termination_by?.

            This needs extra information:

            • arity is the value arity of the recursive function
            • extraParams indicates how many of the function's parameters are bound “after the colon”.
            Equations
              Instances For
                @[irreducible]
                def Lean.Elab.TerminationMeasure.delab.go (measure : TerminationMeasure) :
                NatTSyntaxArray `identPrettyPrinter.Delaborator.DelabM (TSyntax `Lean.Parser.Termination.terminationBy)
                Equations
                  Instances For