Documentation

Lean.Compiler.LCNF.Simp.DiscrM

Instances For
    • discrCtorMap : FVarIdMap CtorInfo

      A mapping from discriminant to constructor application it is equal to in the current context.

    • ctorDiscrMap : PersistentExprMap FVarId

      A mapping from constructor application to discriminant it is equal to in the current context.

    Instances For
      @[reducible, inline]

      Helper monad for tracking mappings from discriminant to constructor applications and back. The combinator withDiscrCtor should be used when visiting cases alternatives.

      Equations
      Instances For

        If fvarId is a constructor application, returns constructor information. Remark: we use the map discrCtorMap. Remark: We use this method when simplifying projections and cases-constructor.

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          Equations
          • One or more equations did not get rendered due to their size.
          Instances For

            If type is an application of the inductive type ind, return its universe levels and parameters.

            Equations
            • One or more equations did not get rendered due to their size.
            Instances For
              @[inline]
              def Lean.Compiler.LCNF.Simp.withDiscrCtorImp {α : Type} (discr : FVarId) (ctorName : Name) (ctorFields : Array Param) (x : DiscrM α) :

              Execute x with the information that discr = ctorName ctorFields. We use this information to simplify nested cases on the same discriminant.

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For
                @[inline]
                def Lean.Compiler.LCNF.Simp.withDiscrCtor {m : TypeType u_1} {α : Type} [MonadFunctorT DiscrM m] (discr : FVarId) (ctorName : Name) (ctorFields : Array Param) :
                m αm α

                Execute x with the information that discr = ctorName ctorFields. We use this information to simplify nested cases on the same discriminant.

                Equations
                Instances For
                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For