lean2js

Lean2Js.Renderable

source

That the compiler only builds modules the reader takes back #

That the module compileProgram builds is one the reader in Parse takes back.

Roundtrip proves parseModule (render m) = some m for every m its RenderableModule accepts. What that leaves open is whether the compiler ever builds a module outside it. It does not, and this file is the argument: every name the compiler writes went through validateIdent or starts with the reserved prefix, every operator it writes is one of a handful it spells itself, and the doc comment is built from names and type renderings, none of which contain a *.

No * reaches the doc comment #

A doc comment goes into /** */ unescaped, so Renderable asks it not to spell */. The doc is built from names and type renderings, and neither can contain a * at all, which is the stronger and much shorter thing to prove.

def

Lean2Js.Compile.noStar

source
(s : String) :
Equations
Instances For
    Used by
      theorem

      Lean2Js.Compile.noStar_append

      source
      [Core.Discriminators] {s t : String} (hs : noStar s = true) (ht : noStar t = true) :
      noStar (s ++ t) = true
      Used by
        theorem

        Lean2Js.Compile.noCommentClose_of_all_ne_star

        source
        [Core.Discriminators] (cs : List Char) :
        (cs.all fun (x : Char) => x != '*') = true → Parse.noCommentClose cs = true
        Used by
          theorem

          Lean2Js.Compile.noCommentClose_of_noStar

          source
          Used by
            theorem

            Lean2Js.Compile.ne_star_of_isIdentPart

            source
            [Core.Discriminators] {c : Char} (h : isIdentPart c = true) :
            (c != '*') = true
            Used by
              theorem

              Lean2Js.Compile.noStar_of_okName

              source
              Used by

                Type renderings carry no * #

                A type renders as keywords, punctuation and the names of the types it mentions. wfTy has already found every one of those names in p.types, and validateType has already put every one of those through validateIdent, so the whole rendering is made of identifier characters and the separators between them.

                The scope is empty wherever a declaration's types are checked, so Ty.var never survives to be rendered and a type parameter's name never has to be accounted for.

                def

                Lean2Js.Compile.TypeNamesOk

                source

                Every type the program declares is named by an identifier.

                Equations
                Instances For
                  Used by
                    theorem

                    Lean2Js.Compile.typeNamesOk_of_validated

                    source
                    Used by
                      theorem

                      Lean2Js.Compile.okName_of_findType

                      source
                      Used by
                        theorem

                        Lean2Js.Compile.noStar_render

                        source
                        Used by
                          theorem

                          Lean2Js.Compile.noStar_renderArgs

                          source
                          Used by
                            theorem

                            Lean2Js.Compile.noStar_renderParamsRest

                            source
                            Used by
                              theorem

                              Lean2Js.Compile.noStar_renderParams

                              source
                              Used by
                                theorem

                                Lean2Js.Compile.noStar_render_of_wfParamTy

                                source
                                Used by
                                  theorem

                                  Lean2Js.Compile.noStar_declSigRest

                                  source
                                  [Core.Discriminators] {p : Core.Program} (hn : TypeNamesOk p) (params : List Core.Param) :
                                  (params.forM fun (param : Core.Param) => validateIdent "parameter" param.name) = Except.ok () → (params.forM fun (param : Core.Param) => wfParamTy p param.ty) = Except.ok () → noStar (declSigRest params) = true
                                  Used by
                                    theorem

                                    Lean2Js.Compile.noStar_declSig

                                    source
                                    [Core.Discriminators] {p : Core.Program} (hn : TypeNamesOk p) (params : List Core.Param) :
                                    (params.forM fun (param : Core.Param) => validateIdent "parameter" param.name) = Except.ok () → (params.forM fun (param : Core.Param) => wfParamTy p param.ty) = Except.ok () → noStar (declSig params) = true
                                    Used by

                                      Names the compiler writes #

                                      Renderable asks a name to be an identifier, and a name in callee position to be none of the ten the reader gives a meaning of its own. A user's name went through validateIdent, which rejects both the __ prefix and the JavaScript keywords, and those two rejections between them cover all ten.

                                      theorem

                                      Lean2Js.Compile.okCallee_of_validateIdent

                                      source
                                      [Core.Discriminators] {kind name : String} {u : Unit} (h : validateIdent kind name = Except.ok u) :
                                      Used by
                                        theorem

                                        Lean2Js.Compile.okCallee_bodyName

                                        source

                                        The name a declaration's body is compiled under is a callee the reader takes back: it is spelled as an identifier, and none of the names the reader gives a meaning of its own carries _ where the body prefix does.

                                        Used by

                                          What the compiler is holding while it builds an expression #

                                          The names in scope and the names of the declarations are the only two places a compiled expression can pick a name up from that is not one the compiler spells itself. Both went through validateIdent.

                                          def

                                          Lean2Js.Compile.CtxOk

                                          source
                                          (ctx : Ctx) :
                                          Equations
                                          Instances For
                                            Used by
                                              def

                                              Lean2Js.Compile.DeclNamesOk

                                              source
                                              Equations
                                              Instances For
                                                Used by
                                                  def

                                                  Lean2Js.Compile.FieldNamesOk

                                                  source

                                                  Field names reach the generated code through .field and through the paths a pattern reads, so a match and a projection both need them to be identifiers.

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

                                                      Lean2Js.Compile.ArmOk

                                                      source
                                                      (a : Arm) :

                                                      One lowered match arm the reader can take back: the tests it runs, the names it binds, the paths it reads them from and the body under them.

                                                      Equations
                                                      Instances For
                                                        Used by
                                                          theorem

                                                          Lean2Js.Compile.renderableList_append

                                                          source
                                                          Used by
                                                            theorem

                                                            Lean2Js.Compile.renderableList_nil

                                                            source
                                                            Used by
                                                              theorem

                                                              Lean2Js.Compile.renderablePairs_nil

                                                              source
                                                              Used by
                                                                theorem

                                                                Lean2Js.Compile.renderableList_of_all

                                                                source
                                                                Used by
                                                                  theorem

                                                                  Lean2Js.Compile.renderablePairs_zip

                                                                  source
                                                                  Used by
                                                                    theorem

                                                                    Lean2Js.Compile.renderable_objOf

                                                                    source
                                                                    Used by

                                                                      The lowered match #

                                                                      chain conjoins an arm's tests with && and nests the arms into conditionals, and apply wraps an arm's body in an arrow when it binds anything. Both build only shapes the reader has.

                                                                      theorem

                                                                      Lean2Js.Compile.renderable_foldl_and

                                                                      source
                                                                      Used by
                                                                        theorem

                                                                        Lean2Js.Compile.renderable_apply

                                                                        source
                                                                        Used by
                                                                          theorem

                                                                          Lean2Js.Compile.renderable_chain

                                                                          source
                                                                          Used by

                                                                            Patterns #

                                                                            A pattern lowers to tests over paths into the scrutinee. The paths are built by reading fields, so the field names a signature reports have to be identifiers; the declared ones went through validateType and the built-in ones are value and error.

                                                                            theorem

                                                                            Lean2Js.Compile.okName_of_signature

                                                                            source
                                                                            [Core.Discriminators] {p : Core.Program} (hf : FieldNamesOk p) (ty : Core.Ty) (heads : List (Head × List (String × Core.Ty))) :
                                                                            signature p.types ty = some heads → ∀ (hd : Head × List (String × Core.Ty)), hd ∈ heads → ∀ (f : String × Core.Ty), f ∈ hd.snd → okName f.fst = true
                                                                            Used by
                                                                              def

                                                                              Lean2Js.Compile.BindsOk

                                                                              source

                                                                              What a pattern's bindings have to be for the arm built from them to be readable back: a name the reader can read, bound to a path it can read.

                                                                              Equations
                                                                              Instances For
                                                                                Used by
                                                                                  theorem

                                                                                  Lean2Js.Compile.renderable_litJs

                                                                                  source
                                                                                  Used by
                                                                                    theorem

                                                                                    Lean2Js.Compile.renderable_patParts

                                                                                    source
                                                                                    [Core.Discriminators] {p : Core.Program} (hfn : FieldNamesOk p) :
                                                                                    (∀ (ty : Core.Ty) (path : Js.Expr) (pat : Core.Pat), Parse.RenderableExpr path = true → ∀ (tests : List Js.Expr) (binds : List (String × Js.Expr × Core.Ty)), patParts p.types ty path pat = Except.ok (tests, binds) → Parse.RenderableList tests = true ∧ BindsOk binds = true) ∧ ∀ (tys : List Core.Ty) (paths : List Js.Expr) (pats : List Core.Pat), paths.all Parse.RenderableExpr = true → ∀ (tests : List Js.Expr) (binds : List (String × Js.Expr × Core.Ty)), patPartsList p.types tys paths pats = Except.ok (tests, binds) → Parse.RenderableList tests = true ∧ BindsOk binds = true
                                                                                    Used by

                                                                                      Building readable expressions #

                                                                                      One lemma per shape the compiler builds, so that the case analysis over compileExpr reads as the shape it emits rather than as an unfolding of RenderableExpr.

                                                                                      theorem

                                                                                      Lean2Js.Compile.renderableList_cons

                                                                                      source
                                                                                      Used by
                                                                                        theorem

                                                                                        Lean2Js.Compile.renderable_num

                                                                                        source
                                                                                        Used by
                                                                                          theorem

                                                                                          Lean2Js.Compile.renderable_bigLit

                                                                                          source
                                                                                          Used by
                                                                                            theorem

                                                                                            Lean2Js.Compile.renderable_str

                                                                                            source
                                                                                            Used by
                                                                                              theorem

                                                                                              Lean2Js.Compile.renderable_bool

                                                                                              source
                                                                                              Used by
                                                                                                theorem

                                                                                                Lean2Js.Compile.renderable_ident

                                                                                                source
                                                                                                Used by
                                                                                                  theorem

                                                                                                  Lean2Js.Compile.renderable_unary

                                                                                                  source
                                                                                                  Used by
                                                                                                    theorem

                                                                                                    Lean2Js.Compile.renderable_binary

                                                                                                    source
                                                                                                    Used by
                                                                                                      theorem

                                                                                                      Lean2Js.Compile.renderable_cond

                                                                                                      source
                                                                                                      Used by
                                                                                                        theorem

                                                                                                        Lean2Js.Compile.renderable_call

                                                                                                        source
                                                                                                        Used by
                                                                                                          theorem

                                                                                                          Lean2Js.Compile.renderable_arrowCall

                                                                                                          source
                                                                                                          Used by
                                                                                                            theorem

                                                                                                            Lean2Js.Compile.renderable_member

                                                                                                            source
                                                                                                            Used by
                                                                                                              theorem

                                                                                                              Lean2Js.Compile.renderable_arrayLit

                                                                                                              source
                                                                                                              Used by
                                                                                                                theorem

                                                                                                                Lean2Js.Compile.renderable_dictLit

                                                                                                                source
                                                                                                                Used by
                                                                                                                  theorem

                                                                                                                  Lean2Js.Compile.renderable_mapJs

                                                                                                                  source
                                                                                                                  [Core.Discriminators] {arr : Js.Expr} {b : String} {body : Js.Expr} (ha : Parse.RenderableExpr arr = true) (hb : okName b = true) (hy : Parse.RenderableExpr body = true) :
                                                                                                                  Used by
                                                                                                                    theorem

                                                                                                                    Lean2Js.Compile.renderable_filterJs

                                                                                                                    source
                                                                                                                    Used by
                                                                                                                      theorem

                                                                                                                      Lean2Js.Compile.renderable_sortByJs

                                                                                                                      source
                                                                                                                      Used by
                                                                                                                        theorem

                                                                                                                        Lean2Js.Compile.renderable_findJs

                                                                                                                        source
                                                                                                                        Used by
                                                                                                                          theorem

                                                                                                                          Lean2Js.Compile.renderable_quantJs

                                                                                                                          source
                                                                                                                          Used by
                                                                                                                            theorem

                                                                                                                            Lean2Js.Compile.renderable_reduceJs

                                                                                                                            source
                                                                                                                            [Core.Discriminators] {arr init : Js.Expr} {a e : String} {body : Js.Expr} (ha : Parse.RenderableExpr arr = true) (hi : Parse.RenderableExpr init = true) (hac : okName a = true) (he : okName e = true) (hy : Parse.RenderableExpr body = true) :
                                                                                                                            Parse.RenderableExpr (arr.reduceJs init a e body) = true
                                                                                                                            Used by
                                                                                                                              theorem

                                                                                                                              Lean2Js.Compile.renderable_check

                                                                                                                              source
                                                                                                                              Used by
                                                                                                                                theorem

                                                                                                                                Lean2Js.Compile.renderable_out

                                                                                                                                source
                                                                                                                                Used by
                                                                                                                                  theorem

                                                                                                                                  Lean2Js.Compile.renderable_foldJs

                                                                                                                                  source
                                                                                                                                  [Core.Discriminators] {scrut : Js.Expr} {key : String} {spec : Js.FoldSpec} {b : String} {body : Js.Expr} (hs : Parse.RenderableExpr scrut = true) (hb : okName b = true) (hy : Parse.RenderableExpr body = true) :
                                                                                                                                  Parse.RenderableExpr (scrut.foldJs key spec b body) = true

                                                                                                                                  A fold's call is readable back where its scrutinee and its arm chain are. The key it indexes by and the spec it hands __fold are read off the declared type rather than written by an author, and the reader takes both back from the text without a name of its own.

                                                                                                                                  Used by
                                                                                                                                    theorem

                                                                                                                                    Lean2Js.Compile.renderable_retWalk

                                                                                                                                    source

                                                                                                                                    The entry's walk out is renderable either way: where it emits nothing the expression is the call itself, and where it emits the walk it is the call inside one more form.

                                                                                                                                    Used by
                                                                                                                                      theorem

                                                                                                                                      Lean2Js.Compile.okCallee_of_ctx

                                                                                                                                      source
                                                                                                                                      [Core.Discriminators] {ctx : Ctx} {name : String} {ty : Core.Ty} (hctx : CtxOk ctx) (h : Option.map (fun (x : String × Core.Ty) => x.snd) (List.find? (fun (x : String × Core.Ty) => x.fst == name) ctx) = some ty) :
                                                                                                                                      Used by
                                                                                                                                        theorem

                                                                                                                                        Lean2Js.Compile.okCallee_of_decl

                                                                                                                                        source
                                                                                                                                        [Core.Discriminators] {p : Core.Program} {name : String} {d : Core.Decl} (hp : DeclNamesOk p) (h : p.find? name = some d) :
                                                                                                                                        Used by
                                                                                                                                          theorem

                                                                                                                                          Lean2Js.Compile.okName_of_okCallee

                                                                                                                                          source
                                                                                                                                          Used by
                                                                                                                                            theorem

                                                                                                                                            Lean2Js.Compile.ctxOk_cons

                                                                                                                                            source
                                                                                                                                            [Core.Discriminators] {ctx : Ctx} {n : String} {ty : Core.Ty} (hn : Parse.okCallee n = true) (h : CtxOk ctx) :
                                                                                                                                            CtxOk ((n, ty) :: ctx)
                                                                                                                                            Used by
                                                                                                                                              theorem

                                                                                                                                              Lean2Js.Compile.ctxOk_append

                                                                                                                                              source
                                                                                                                                              [Core.Discriminators] {ctx : Ctx} {binds : List (String × Js.Expr × Core.Ty)} (hb : BindsOk binds = true) (h : CtxOk ctx) :
                                                                                                                                              CtxOk (List.map (fun (b : String × Js.Expr × Core.Ty) => (b.fst, b.snd.snd)) binds ++ ctx)
                                                                                                                                              Used by
                                                                                                                                                theorem

                                                                                                                                                Lean2Js.Compile.okCallee_of_decl_name

                                                                                                                                                source
                                                                                                                                                [Core.Discriminators] {p : Core.Program} {name : String} {d : Core.Decl} (hp : DeclNamesOk p) (h : p.find? name = some d) :
                                                                                                                                                Used by
                                                                                                                                                  theorem

                                                                                                                                                  Lean2Js.Compile.renderable_numericHelper

                                                                                                                                                  source
                                                                                                                                                  Used by
                                                                                                                                                    theorem

                                                                                                                                                    Lean2Js.Compile.okOp_of_orderSymbol

                                                                                                                                                    source
                                                                                                                                                    Used by
                                                                                                                                                      theorem

                                                                                                                                                      Lean2Js.Compile.okCallee_strUnHelper

                                                                                                                                                      source
                                                                                                                                                      Used by
                                                                                                                                                        theorem

                                                                                                                                                        Lean2Js.Compile.okCallee_strBinHelper

                                                                                                                                                        source
                                                                                                                                                        Used by
                                                                                                                                                          theorem

                                                                                                                                                          Lean2Js.Compile.okName_of_ctorsAt

                                                                                                                                                          source
                                                                                                                                                          [Core.Discriminators] {p : Core.Program} (hfn : FieldNamesOk p) {n : String} {t : Core.TypeDef} (ht : p.findType? n = some t) {args : List Core.Ty} {c : Core.CtorDef} (hc : c ∈ t.ctorsAt args) {f : Core.Field} (hf : f ∈ c.fields) :
                                                                                                                                                          Used by
                                                                                                                                                            theorem

                                                                                                                                                            Lean2Js.Compile.okName_of_proj

                                                                                                                                                            source
                                                                                                                                                            [Core.Discriminators] {p : Core.Program} (hfn : FieldNamesOk p) {n : String} {args : List Core.Ty} {t : Core.TypeDef} {c : Core.CtorDef} {f : Core.Field} {field : String} (hft : p.findType? n = some t) (hc : t.ctorsAt args = [c]) (hf : List.find? (fun (x : Core.Field) => x.name == field) c.fields = some f) :
                                                                                                                                                            okName field = true

                                                                                                                                                            The name a field read writes after the dot is the name of a field the type declares, and validateType has already put that through validateIdent.

                                                                                                                                                            Used by
                                                                                                                                                              theorem

                                                                                                                                                              Lean2Js.Compile.renderablePairs_cons

                                                                                                                                                              source
                                                                                                                                                              Used by
                                                                                                                                                                theorem

                                                                                                                                                                Lean2Js.Compile.renderable_foldPatParts

                                                                                                                                                                source
                                                                                                                                                                [Core.Discriminators] {p : Core.Program} (hfn : FieldNamesOk p) {typeName : String} {tyArgs : List Core.Ty} {result : Core.Ty} {path : Js.Expr} {pat : Core.Pat} (hpath : Parse.RenderableExpr path = true) (tests : List Js.Expr) (binds : List (String × Js.Expr × Core.Ty)) :
                                                                                                                                                                foldPatParts p.types typeName tyArgs result path pat = Except.ok (tests, binds) → Parse.RenderableList tests = true ∧ BindsOk binds = true

                                                                                                                                                                A fold's alternative reads the paths a match's reads. Only the types its binders carry move — a field that came round is bound to the answer for it — and a type is not something the reader sees.

                                                                                                                                                                Used by

                                                                                                                                                                  Every expression the compiler builds #

                                                                                                                                                                  The recursion is compileExpr's own: the names it picks up come from the scope and from the declarations, the operators and callees it writes it spells itself, and everything else is one of its subexpressions.

                                                                                                                                                                  theorem

                                                                                                                                                                  Lean2Js.Compile.renderable_compiled

                                                                                                                                                                  source
                                                                                                                                                                  [Core.Discriminators] {p : Core.Program} (hp : DeclNamesOk p) (hfn : FieldNamesOk p) :
                                                                                                                                                                  (∀ (ctx : Ctx) (e : Core.Expr), CtxOk ctx → ∀ (j : Js.Expr) (t : Core.Ty), compileExpr p ctx e = Except.ok (j, t) → Parse.RenderableExpr j = true) ∧ (∀ (ctx : Ctx) (entries : List (String × Core.Expr)), CtxOk ctx → ∀ (js : List (Js.Expr × Core.Ty)), compileValues p ctx entries = Except.ok js → Parse.RenderableList (List.map (fun (x : Js.Expr × Core.Ty) => x.fst) js) = true) ∧ (∀ (ctx : Ctx) (typeName : String) (tyArgs : List Core.Ty) (result : Core.Ty) (alts : List Core.Alt), CtxOk ctx → ∀ (arms : List Arm), compileFoldAlts p ctx typeName tyArgs result alts = Except.ok arms → arms.all ArmOk = true) ∧ (∀ (ctx : Ctx) (ty : Core.Ty) (alts : List Core.Alt), CtxOk ctx → ∀ (arms : List Arm), compileAlts p ctx ty alts = Except.ok arms → arms.all ArmOk = true) ∧ ∀ (ctx : Ctx) (es : List Core.Expr), CtxOk ctx → ∀ (js : List (Js.Expr × Core.Ty)), compileArgs p ctx es = Except.ok js → Parse.RenderableList (List.map (fun (x : Js.Expr × Core.Ty) => x.fst) js) = true
                                                                                                                                                                  Used by

                                                                                                                                                                    The statements a declaration's body becomes #

                                                                                                                                                                    The entry's consts bind the declared names to the raw __p0, __p1, … it was called with, and the body's are the lets lined up at its head. Both are names the reader takes back: the declared ones went through validateIdent and the raw ones are the compiler's own.

                                                                                                                                                                    theorem

                                                                                                                                                                    Lean2Js.Compile.isDigit_digitChar

                                                                                                                                                                    source
                                                                                                                                                                    Used by
                                                                                                                                                                      theorem

                                                                                                                                                                      Lean2Js.Compile.toDigitsCore_all_digit

                                                                                                                                                                      source
                                                                                                                                                                      Used by
                                                                                                                                                                        theorem

                                                                                                                                                                        Lean2Js.Compile.repr_all_digit

                                                                                                                                                                        source

                                                                                                                                                                        Nat.repr is a wall to a proof that wants to read its characters back, but not to one that only wants to know they are digits.

                                                                                                                                                                        Used by
                                                                                                                                                                          theorem

                                                                                                                                                                          Lean2Js.Compile.okCallee_rawParam

                                                                                                                                                                          source
                                                                                                                                                                          Used by
                                                                                                                                                                            theorem

                                                                                                                                                                            Lean2Js.Compile.rawParams_all_okName

                                                                                                                                                                            source
                                                                                                                                                                            Used by
                                                                                                                                                                              theorem

                                                                                                                                                                              Lean2Js.Compile.ctxOk_of_params

                                                                                                                                                                              source
                                                                                                                                                                              [Core.Discriminators] (params : List Core.Param) :
                                                                                                                                                                              (params.forM fun (param : Core.Param) => validateIdent "parameter" param.name) = Except.ok () → CtxOk (List.map (fun (param : Core.Param) => (param.name, param.ty)) params)
                                                                                                                                                                              Used by
                                                                                                                                                                                theorem

                                                                                                                                                                                Lean2Js.Compile.renderable_compileFinish

                                                                                                                                                                                source
                                                                                                                                                                                [Core.Discriminators] {p : Core.Program} (hp : DeclNamesOk p) (hfn : FieldNamesOk p) {ctx : Ctx} {e : Core.Expr} {acc stmts : List Js.Stmt} {ty : Core.Ty} (hctx : CtxOk ctx) (hacc : acc.all Parse.RenderableStmt = true) (h : compileFinish p ctx e acc = Except.ok (stmts, ty)) :
                                                                                                                                                                                Used by
                                                                                                                                                                                  theorem

                                                                                                                                                                                  Lean2Js.Compile.renderable_compileBody

                                                                                                                                                                                  source
                                                                                                                                                                                  [Core.Discriminators] {p : Core.Program} (hp : DeclNamesOk p) (hfn : FieldNamesOk p) (ctx : Ctx) (e : Core.Expr) (acc stmts : List Js.Stmt) (ty : Core.Ty) :
                                                                                                                                                                                  CtxOk ctx → acc.all Parse.RenderableStmt = true → compileBody p ctx e acc = Except.ok (stmts, ty) → stmts.all Parse.RenderableStmt = true
                                                                                                                                                                                  Used by
                                                                                                                                                                                    theorem

                                                                                                                                                                                    Lean2Js.Compile.renderable_paramChecks

                                                                                                                                                                                    source
                                                                                                                                                                                    [Core.Discriminators] {p : Core.Program} (i : Nat) (params : List Core.Param) (checks : List Js.Stmt) :
                                                                                                                                                                                    (params.forM fun (param : Core.Param) => validateIdent "parameter" param.name) = Except.ok () → paramChecks p i params = Except.ok checks → checks.all Parse.RenderableStmt = true
                                                                                                                                                                                    Used by

                                                                                                                                                                                      The declaration and the program #

                                                                                                                                                                                      theorem

                                                                                                                                                                                      Lean2Js.Compile.fieldNamesOk_of_validated

                                                                                                                                                                                      source
                                                                                                                                                                                      [Core.Discriminators] {p : Core.Program} (ts : List Core.TypeDef) (h : ts.forM (validateType p) = Except.ok ()) (t : Core.TypeDef) :
                                                                                                                                                                                      t ∈ ts → ∀ (c : Core.CtorDef), c ∈ t.ctors → ∀ (f : Core.Field), f ∈ c.fields → okName f.name = true
                                                                                                                                                                                      Used by
                                                                                                                                                                                        theorem

                                                                                                                                                                                        Lean2Js.Compile.renderable_paramIdents

                                                                                                                                                                                        source
                                                                                                                                                                                        [Core.Discriminators] (params : List Core.Param) :
                                                                                                                                                                                        (params.forM fun (param : Core.Param) => validateIdent "parameter" param.name) = Except.ok () → Parse.RenderableList (paramIdents params) = true
                                                                                                                                                                                        Used by
                                                                                                                                                                                          theorem

                                                                                                                                                                                          Lean2Js.Compile.paramNames_all_okName

                                                                                                                                                                                          source
                                                                                                                                                                                          [Core.Discriminators] (params : List Core.Param) :
                                                                                                                                                                                          (params.forM fun (param : Core.Param) => validateIdent "parameter" param.name) = Except.ok () → (List.map (fun (x : Core.Param) => x.name) params).all okName = true
                                                                                                                                                                                          Used by
                                                                                                                                                                                            theorem

                                                                                                                                                                                            Lean2Js.Compile.renderableFunc_of_compileDecl

                                                                                                                                                                                            source
                                                                                                                                                                                            Used by
                                                                                                                                                                                              theorem

                                                                                                                                                                                              Lean2Js.Compile.declNames_of_compileDecls

                                                                                                                                                                                              source
                                                                                                                                                                                              [Core.Discriminators] {p : Core.Program} (i : Nat) (ds : List Core.Decl) (fs : List Js.Func) :
                                                                                                                                                                                              compileDecls p i ds = Except.ok fs → ∀ (d : Core.Decl), d ∈ ds → Parse.okCallee d.name = true
                                                                                                                                                                                              Used by
                                                                                                                                                                                                theorem

                                                                                                                                                                                                Lean2Js.Compile.renderable_compileDecls

                                                                                                                                                                                                source
                                                                                                                                                                                                Used by
                                                                                                                                                                                                  theorem

                                                                                                                                                                                                  Lean2Js.Compile.renderableModule_of_compileProgram

                                                                                                                                                                                                  source

                                                                                                                                                                                                  Nothing the compiler builds falls outside what the reader takes back. Renderable names the trees render does not separate, and this says the compiler never writes one: the names it emits are the ones validateIdent accepted or the ones it spells itself, and its operators and callees are a fixed handful that the reader does not dispatch on.

                                                                                                                                                                                                  Used by
                                                                                                                                                                                                    theorem

                                                                                                                                                                                                    Lean2Js.Compile.parseModule_render_of_compileProgram

                                                                                                                                                                                                    source

                                                                                                                                                                                                    The file the compiler writes reads back as the module it was compiled from. No side condition is left: the roundtrip holds of everything compileProgram produces.

                                                                                                                                                                                                    Used by