Elm Exactly

Theoremdispatch_preserves_existing

StandardElmMech/Prog/Rulings.lean:172, A79: a failing process ends, whatever its origin, and nothing else happens · tactic proof

Dispatch only adds processes with fresh identifiers: an existing entry is kept.

Statement

theorem dispatch_preserves_existing {s : Time} {P : Procs} {Q : OutQ} {H : Pending} {L : List Val}
    {P' : Procs} {Q' : OutQ} {H' : Pending} (h : Dispatch s P Q H L P' Q' H') {n : Nat}
    {e : PEntry} (hn : P.get n = some e) : P'.get n = some e

Proof

by
  induction h with
  | r_p_disp_empty => exact hn
  | r_p_disp_task P _ _ _ _ n' _ _ _ _ _ hf _ ih =>
    apply ih
    have hne : n ≠ n' := fun he => hf (he ▸ natLookup_some_mem P n e hn)
    simp only [Procs.get, Procs.set] at hn ⊢
    rw [natLookup_natSet_other _ _ _ _ hne]; exact hn
  | r_p_disp_out _ _ _ _ _ _ _ _ _ _ _ _ _ _ ih => exact ih hn
  | r_p_disp_plat _ _ _ _ _ _ _ _ _ _ _ _ _ ih => exact ih hn

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/Rulings.lean: The rulings A62, A72, A77, A79, A80 and A81 as theorems, and a66_batch_order_open: a program whose batch is delivered in either order.

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.