Lean2Js.Verified
What an author writes next to a def #
A package is a namespace of ordinary Lean defs, each marked @[ship], and one ship_package under
them. Marking a def reads the declaration out of it; ship_package gathers those into the program,
writes the certificate saying each one denotes the def it came from, and puts up the wall emit puts
up. None of it is a shortcut — the declarations and the certificates come out of the same walk, so a
declaration cannot reach the program without one.
The certificates are written after the program because a certificate names it: a declaration that calls
another goes through p.find?.
Lean2Js.Verified.«commandCertificates%»
sourceThe certificate for every declaration the program carries: the same walk that read the declaration
out of the def also emits the proof that the declaration denotes it. A def that takes a function is
handed a declaration's name rather than a value, so its certificate takes the name and what running it
does.
Equations
- Lean2Js.Verified.«commandCertificates%» = Lean.ParserDescr.node `Lean2Js.Verified.«commandCertificates%» 1024 (Lean.ParserDescr.symbol "certificates%")
Instances For
Used by
Lean2Js.Verified.commandShip_package
sourceThe package: the program gathered from the defs marked above, a certificate for each declaration in
it, and what emit refuses by reading the program alone, asked here where it costs a compile rather than
a differential run.
Equations
- Lean2Js.Verified.commandShip_package = Lean.ParserDescr.node `Lean2Js.Verified.commandShip_package 1024 (Lean.ParserDescr.symbol "ship_package")