Theoremtr_prefix
Tr is closed under prefixes (sec:programs-behaviour: every finite prefix of transitions is an execution).
Statement
theorem tr_prefix {B : Mod.Basis} {ms : List Mod.Module} {τ1 : PTy} {j : BVal} {tr tr' : List Event}
(h : Tr B ms τ1 j tr) (hp : tr' <+: tr) : Tr B ms τ1 j tr'Proof
by
obtain ⟨r, K0, π, hs, he, hst, hx, rfl⟩ := h
obtain ⟨n, hn⟩ := trace_take_prefix π tr' hp
obtain ⟨hs'', hx'⟩ := exec_take n hx
exact ⟨r, K0, π.take n, hs'', he, hst, hx', hn⟩Proved with tactics, which Lean expands into a proof term that its kernel checks.
Theorems it uses
In StandardElmMech/Prog/Exec.lean: Hosts (any, none, the test runner's echo), executions with and without logs, a worker's executions (WorkerExec, its log as D9 defines it), traces and Tr (tr_nil, tr_prefix, tr_empty_iff_no_start).
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.