Theorema86_step
Messages are handled one at a time, by r:p-update, in queue order, each update applying update to the model of the previous one; every other step keeps the model and only appends to the queue. The commands of an update are dispatched in its step.
Statement
theorem a86_step {PE : PortEnv} {r : List (String × Val)} {K K' : Config} {a : Option Event}
(h : Step PE r K a K') :
(K'.model = K.model ∧ ∃ ms, K'.msgs = K.msgs ++ ms) ∨
(a = none ∧ ∃ v1 fu v2 cm cs L, K.msgs = v1 :: K'.msgs ∧ field r "update" = some fu ∧
AppVal fu v1 v2 ∧ AppVal v2 K.model (.tuple K'.model cm none) ∧
flat cm = some cs ∧ L.Perm cs ∧
Dispatch K.time K.procs K.outq K.pending L K'.procs K'.outq K'.pending)Proof
by
cases h with
| r_p_update s v v1 M P sb Q H fu fs v2 v' cm cs L P' Q' H' sb' h1 _ h3 h4 h5 h6 h7 _ =>
exact .inr ⟨rfl, v1, fu, v2, cm, cs, L, rfl, h1, h3, h4, h5, h6, h7⟩
| r_p_proc_message => exact .inl ⟨rfl, _, rfl⟩
| r_p_in_accept => exact .inl ⟨rfl, _, rfl⟩
| r_p_platform _ _ _ hp => cases hp
| r_p_in_reject => exact .inl ⟨rfl, [], by simp⟩
| _ => exact .inl ⟨rfl, [], by simp⟩Proved with tactics, which Lean expands into a proof term that its kernel checks.
Rules of the book it uses
Used by
In StandardElmMech/Prog/Guarantees.lean: The guarantees of A86: a86_step (messages handled one at a time, in queue order, every other step keeps the model and only appends messages) and a86_out_fifo (each outgoing port delivers its values in the order they were queued).
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.