Elm Exactly

TheoremhostAfter_sound

StandardElmMech/Prog/Sched.lean:162, Helpers, each with its soundness · tactic proof

Statement

theorem hostAfter_sound {h : Host} {hs : List BVal} {a : Option Event} {hs' : List BVal}
    (e : hostAfter h hs a = some hs') : HostAllows h hs a hs'

Proof

by
  cases h with
  | any =>
    cases a with
    | none => simp [hostAfter] at e; subst e; exact .any _ _
    | some ev => cases ev <;> simp [hostAfter] at e <;> subst e <;> exact .any _ _
  | none =>
    cases a with
    | none => simp [hostAfter] at e; subst e; exact .silent _ _
    | some ev =>
      cases ev with
      | inn => simp [hostAfter] at e
      | out p j => simp [hostAfter] at e; subst e; exact .out_none _ _ _
      | act x => simp [hostAfter] at e; subst e; exact .act _ _ _
      | wait d => simp [hostAfter] at e; subst e; exact .wait _ _ _
  | echo o i =>
    cases a with
    | none => simp [hostAfter] at e; subst e; exact .silent _ _
    | some ev =>
      cases ev with
      | inn p j =>
        cases hs with
        | nil => simp [hostAfter] at e
        | cons j' rest =>
          simp only [hostAfter] at e
          split at e
          · rename_i hc; obtain ⟨rfl, rfl⟩ := hc; cases e; exact .in_echo _ _ _ _
          · cases e
      | out p j =>
        simp only [hostAfter] at e
        split at e
        · rename_i hp; subst hp; cases e; exact .out_echo _ _ _ _
        · rename_i hp; cases e; exact .out_other _ _ _ _ _ hp
      | act x => simp [hostAfter] at e; subst e; exact .act _ _ _
      | wait d => simp [hostAfter] at e; subst e; exact .wait _ _ _
  | feed i js =>
    cases a with
    | none => simp [hostAfter] at e; subst e; exact .silent _ _
    | some ev =>
      cases ev with
      | inn p j =>
        simp only [hostAfter] at e
        split at e
        · rename_i hc; obtain ⟨rfl, hp⟩ := hc; cases e; exact .in_feed _ _ _ _ hp
        · cases e
      | out p j => simp [hostAfter] at e; subst e; exact .out_feed _ _ _ _ _
      | act x => simp [hostAfter] at e; subst e; exact .act _ _ _
      | wait d => simp [hostAfter] at e; subst e; exact .wait _ _ _

Proved with tactics, which Lean expands into a proof term that its kernel checks.

Used by

In StandardElmMech/Prog/Sched.lean: The default scheduler (run): one choice per iteration, overridable per test, each transition proved by doChoice_sound; run_sound: every run is an execution.

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.