Elm Exactly

TheoremdispatchFn_sound

StandardElmMech/Prog/Dispatch.lean:77 · term proof

Statement

theorem dispatchFn_sound {s : Time} {H : Pending} : ∀ {L : List Val} {P : Procs} {Q : OutQ}
    {P' : Procs} {Q' : OutQ} {ns : List Nat},
    dispatchFn s P Q L = some (P', Q', ns) → Dispatch s P Q H L P' Q' H
  | [], P, Q, P', Q', ns, h => by
    simp only [dispatchFn, Option.some.injEq, Prod.mk.injEq] at h
    obtain ⟨rfl, rfl, -⟩

Proof

h
    exact .r_p_disp_empty s P Q H
  | c :: L, P, Q, P', Q', ns, h => by
    simp only [dispatchFn] at h
    split at h
    · rename_i tk hc
      cases hr : dispatchFn s (P.set (freshPid P) (.live ⟨tk, s, some c⟩)) Q L with
      | none => simp [hr] at h
      | some t =>
        obtain ⟨P1, Q1, ns1⟩ := t
        simp only [hr, Option.map_some, Option.some.injEq, Prod.mk.injEq] at h
        obtain ⟨rfl, rfl, -⟩ := h
        exact .r_p_disp_task s P Q H c tk _ L _ _ H hc (freshPid_fresh P) (dispatchFn_sound hr)
    · rename_i p j hc
      split at h
      · rename_i js hq
        exact .r_p_disp_out s P Q H c p j js L _ _ H hc hq (dispatchFn_sound h)
      · cases h
    · cases h

Proved by a term, which Lean's kernel checks directly.

Rules of the book it uses

Theorems it uses

Used by

In StandardElmMech/Prog/Dispatch.lean: Dispatch (4 rules, r_p_disp_*) and the executable dispatchFn with fresh identifiers, sound.

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.