Documentation

Lean.Compiler.LCNF.ToLCNF

Return true if e is a lcProof application. Recall that we use lcProof to erase all nested proofs.

Equations
Instances For
    @[inline, reducible]

    State for BindCasesM monad Mapping from _alt. variables to new join points

    Equations
    Instances For

      This method returns code that at each exit point of cases, it jumps to jpDecl. It is similar to Code.bind, but we add special support for inlineMatcher. The inlineMatcher function inlines the auxiliary _match_ declarations. To make sure there is no code duplication, inlineMatcher creates auxiliary declarations _alt.. We can say the _alt. declarations are pre join points. For each auxiliary declaration used at an exit point of cases, this method creates an new auxiliary join point that invokes _alt., and then jumps to jpDecl. The goal is to make sure the auxiliary join point is the only occurrence of _alt., then simp will inline it. That is, our goal is to try to promote the pre join points _alt. into a proper join point.

      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
          Equations
          • One or more equations did not get rendered due to their size.
          Instances For
            Instances For
              @[inline]
              Equations
              • One or more equations did not get rendered due to their size.
              Instances For

                Add LCNF element to the current sequence

                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
                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For

                      Create Code that executes the current seq and then returns result

                      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
                          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
                              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

                                  Create a new local declaration using a Lean regular type.

                                  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
                                      Equations
                                      • One or more equations did not get rendered due to their size.
                                      Instances For

                                        Eta-expand with n lambdas.

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

                                          Eta reduce implicits. We use this function to eliminate introduced by the implicit lambda feature, where it generates terms such as fun {α} => ReaderT.pure

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

                                            Put the given expression in LCNF.

                                            • Nested proofs are replaced with lcProof-applications.
                                            • Eta-expand applications of declarations that satisfy shouldEtaExpand.
                                            • Put computationally relevant expressions in A-normal form.
                                            Equations
                                            Instances For

                                              Giving f a constant .const declName us, convert args into args', and return .const declName us args'

                                              If args.size == arity, then just return app. Otherwise return

                                              let k := app
                                              k args[arity:]
                                              

                                              Visit a matcher/casesOn alternative.