TheoremelProgram_main_of_kind
r:p-stat-main-program or r:p-stat-main-view from mainKind.
Statement
theorem elProgram_main_of_kind {B : SBasis} {m : BModule} {B' : SBasis} {E : Env} {σ : Scheme}
{k : Mod.ProgKind × Eff.PTy} (hd : PrincipalModDer B m B' E) (hp : PortsDisjoint B B')
(hσ : E.VE.find? "main" = some (σ, .v)) (hk : mainKind σ = some k) :
∃ τ, ElProgram B [m] τ (B.plus B').PEProof
by
obtain ⟨kind, π⟩ := k
cases kind with
| worker =>
obtain ⟨τ1, τ2, τ3, hb, hP, -⟩ := (mainKind_worker_iff σ π).mp hk
exact ⟨_, .r_p_stat_main_program hd hp hσ hb hP⟩
| view =>
obtain ⟨-, -, τ, hd'⟩ := (mainKind_view_iff σ π).mp hk
exact ⟨_, .r_p_stat_main_view hd hp hσ hd'⟩Proved with tactics, which Lean expands into a proof term that its kernel checks.
Rules of the book it uses
Theorems it uses
Used by
In StandardElmMech/Stat/Pipeline.lean: SpecOf, DynOf (in Lib.Btest for a view, Mod.Btest [] for a worker: dynBasis), ProgramSem (r:p-program), D11For; copy names, payload types and main (copyName_inj, toPTy_isSome_iff, mainKind_worker_iff, mainKind_view_iff); the pipeline theorems (specOf_of_endToEnd, programSem_of_legal).
A Standard Definition of Elm? (Draft version 0.4) © Rupert Smith. The text is licensed under CC BY 4.0: share and adapt it freely, with credit and a link to the licence.