Documentation

Lean.Meta.Sym.AlphaShareBuilder

Helper functions for constructing maximally shared expressions from maximally shared expressions. That is, mkAppS f a assumes that f and a are maximally shared.

These functions are in the Internal namespace because they can be easily misused. We use them to construct safe functions.

Instances
    @[implicit_reducible, always_inline]
    @[reducible, inline]

    Helper monad for constructing maximally shared terms. The Bool flag indicates whether it is debug-mode or not.

    Instances For
      @[reducible, inline]

      Helper function for lifting a AlphaShareBuilderM action to GrindM

      Instances For
        def Lean.Meta.Sym.Internal.mkConstS {m : TypeType} [MonadShareCommon m] (declName : Name) (us : List Level := []) :
        Instances For
          Instances For
            Instances For
              Instances For
                Instances For
                  def Lean.Meta.Sym.Internal.mkProjS {m : TypeType} [MonadShareCommon m] [Monad m] (structName : Name) (idx : Nat) (struct : Expr) :
                  Instances For
                    Instances For
                      Instances For
                        Instances For
                          def Lean.Meta.Sym.Internal.mkLetS {m : TypeType} [MonadShareCommon m] [Monad m] (x : Name) (t v b : Expr) (nondep : Bool := false) :
                          Instances For
                            def Lean.Meta.Sym.Internal.mkHaveS {m : TypeType} [MonadShareCommon m] [Monad m] (x : Name) (t v b : Expr) :
                            Instances For
                              @[inline]
                              Instances For
                                @[inline]
                                Instances For
                                  @[inline]
                                  Instances For
                                    @[inline]
                                    def Lean.Expr.updateForallS! {m : TypeType} [Meta.Sym.Internal.MonadShareCommon m] [Monad m] (e newDomain newBody : Expr) :
                                    Instances For
                                      @[inline]
                                      def Lean.Expr.updateLambdaS! {m : TypeType} [Meta.Sym.Internal.MonadShareCommon m] [Monad m] (e newDomain newBody : Expr) :
                                      Instances For
                                        @[inline]
                                        def Lean.Expr.updateLetS! {m : TypeType} [Meta.Sym.Internal.MonadShareCommon m] [Monad m] (e newType newVal newBody : Expr) :
                                        Instances For
                                          def Lean.Meta.Sym.Internal.mkAppS₂ {m : TypeType} [MonadShareCommon m] [Monad m] (f a₁ a₂ : Expr) :
                                          Instances For
                                            def Lean.Meta.Sym.Internal.mkAppS₃ {m : TypeType} [MonadShareCommon m] [Monad m] (f a₁ a₂ a₃ : Expr) :
                                            Instances For
                                              def Lean.Meta.Sym.Internal.mkAppS₄ {m : TypeType} [MonadShareCommon m] [Monad m] (f a₁ a₂ a₃ a₄ : Expr) :
                                              Instances For
                                                def Lean.Meta.Sym.Internal.mkAppS₅ {m : TypeType} [MonadShareCommon m] [Monad m] (f a₁ a₂ a₃ a₄ a₅ : Expr) :
                                                Instances For
                                                  def Lean.Meta.Sym.Internal.mkAppS₆ {m : TypeType} [MonadShareCommon m] [Monad m] (f a₁ a₂ a₃ a₄ a₅ a₆ : Expr) :
                                                  Instances For
                                                    def Lean.Meta.Sym.Internal.mkAppS₇ {m : TypeType} [MonadShareCommon m] [Monad m] (f a₁ a₂ a₃ a₄ a₅ a₆ a₇ : Expr) :
                                                    Instances For
                                                      def Lean.Meta.Sym.Internal.mkAppS₈ {m : TypeType} [MonadShareCommon m] [Monad m] (f a₁ a₂ a₃ a₄ a₅ a₆ a₇ a₈ : Expr) :
                                                      Instances For
                                                        def Lean.Meta.Sym.Internal.mkAppS₉ {m : TypeType} [MonadShareCommon m] [Monad m] (f a₁ a₂ a₃ a₄ a₅ a₆ a₇ a₈ a₉ : Expr) :
                                                        Instances For
                                                          def Lean.Meta.Sym.Internal.mkAppS₁₀ {m : TypeType} [MonadShareCommon m] [Monad m] (f a₁ a₂ a₃ a₄ a₅ a₆ a₇ a₈ a₉ a₁₀ : Expr) :
                                                          Instances For
                                                            def Lean.Meta.Sym.Internal.mkAppS₁₁ {m : TypeType} [MonadShareCommon m] [Monad m] (f a₁ a₂ a₃ a₄ a₅ a₆ a₇ a₈ a₉ a₁₀ a₁₁ : Expr) :
                                                            Instances For
                                                              def Lean.Meta.Sym.Internal.mkAppRangeS {m : TypeType} [MonadShareCommon m] [Monad m] (f : Expr) (beginIdx endIdx : Nat) (args : Array Expr) :

                                                              mkAppRangeS f i j #[a₀, ..., aᵢ, ..., aⱼ, ...] ==> f aᵢ ... aⱼ₋₁ with max sharing.

                                                              Instances For

                                                                mkAppNS f #[a₀, ..., aₙ] constructs f a₀ ... aₙ with max sharing.

                                                                Instances For
                                                                  def Lean.Meta.Sym.Internal.mkAppRevRangeS {m : TypeType} [MonadShareCommon m] [Monad m] (f : Expr) (beginIdx endIdx : Nat) (revArgs : Array Expr) :

                                                                  mkAppRevRangeS f b e revArgs ==> mkAppRev f (revArgs.extract b e) with max sharing.

                                                                  Instances For

                                                                    Same as mkAppS f args but reversing args, with max sharing.

                                                                    Instances For