Elm Exactly

TheoremacceptMsgsL_one

StandardElmMech/Prog/Invariant.lean:382, Inversions · tactic proof

The messages of one subscription c that receives x as the evaluator computes, with no choice.

Statement

theorem acceptMsgsL_one {o : Oracle} {n : Nat} {c : Val} {x : Input}
    (h : (recvL o n c x 0).isAt 0 = true) {Ms : List Val} {l : Log} (d : AcceptMsgsL [c] x Ms l) :
    Ms = [(recvL o n c x 0).get] ∧ l = (recvL o n c x 0).log

Proof

by
  have he := Res.eq_get h
  cases d with
  | seq_recv_l _ _ _ v ms l1 ls hr hrest =>
    obtain ⟨rfl, rfl⟩ := recvL_det h v l1 hr
    cases hrest
    simp
  | seq_none_l _ _ _ ms ls hno _ =>
    exact absurd ⟨_, (recvL_sound c he).forget⟩ hno

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

Theorems it uses

In StandardElmMech/Prog/Invariant.lean: CHECK-NOT as a statement about every execution (WorkerTest.HoldsNot), per-test invariants (TestInv, TestInv.sound, holdsNot_any), and the determinism and inversion lemmas they use.

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.