Elm Exactly

TheoremstartFn_sound

StandardElmMech/Prog/Worker.lean:43 · tactic proof

Statement

theorem startFn_sound {PE : PortEnv} {τ1 : PTy} {j : BVal} {r : List (String × Val)} {lo : LeafOrder}
    {o : Oracle} {fuel k : Nat} {K : Config} {ns : List Nat} {l : Log} {k' : Nat}
    (h : startFn PE τ1 j r lo o fuel k = some (K, ns, l, k')) : StartL PE τ1 j r K l

Proof

by
  unfold startFn at h
  split at h
  · rename_i fi fs hfi hfs
    simp only at h
    split at h
    · rename_i v1 hv1
      have hflags : FlagsVal τ1 j v1 := by
        by_cases hu : τ1 = .unit
        · simp only [hu, ite_true, Option.some.injEq] at hv1; exact Or.inl ⟨hu, hv1.symm⟩
        · simp only [hu, ite_false] at hv1; exact Or.inr ⟨hu, (dec_iff τ1 j v1).mpr hv1⟩
      split at h
      · rename_i v cm l1 k1 h1
        split at h
        · rename_i cs hf
          split at h
          · rename_i P Q ns' hd
            split at h
            · rename_i sb l2 k2 h2
              simp only [Option.some.injEq, Prod.mk.injEq] at h
              obtain ⟨rfl, -, rfl, -⟩ := h
              exact .r_p_init_l PE τ1 j r fi fs v1 v cm cs _ P Q [] sb l1 l2 hfi hfs hflags
                (appVal_sound_l h1) hf (lo.perm cs) (dispatchFn_sound hd) (appVal_sound_l h2)
            · cases h
          · cases h
        · cases h
      · cases h
    · cases h
  · cases h

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/Prog/Worker.lean: Worker tests: WorkerTest.Holds (some execution the book allows, under the test's host, has a log meeting every check), runWorker (evaluate the modules, start, run the scheduler), runWorker_sound, holds_of_run.

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.