TheoremevTopDec_next_ge
Statement
theorem evTopDec_next_ge (o : Oracle) (n : Nat) : ∀ E td k, k ≤ (evTopDec o n E td k).next
| E, .val vb, k => by
simp only [evTopDec]
split
· simp
· rcases h1 : evValBind o n E (thunkGroup vb) k with ⟨out1, l1, k1⟩
have e1Proof
evValBind_next h1
simp only at e1
cases out1 with
| value VE =>
dsimp only
rcases h2 : evForces o n (E.plusVE (recVE VE)) (vb.map (thunkVar ∘ Prod.fst)) k1 with ⟨out2, l2, k2⟩
have e2 := evForces_next h2
simp only at e2
cases out2 <;> simp <;> omega
| stuck => simp; omega
| outOfFuel => simp; omega
| E, .type db, k => by simp [evTopDec]
| E, .alias tb, k => by simp [evTopDec]
| E, .port x .out τ, k => by simp [evTopDec]
| E, .port x .inn τ, k => by simp [evTopDec]
| E, .seq t1 t2, k => by
simp only [evTopDec]
rcases h1 : evTopDec o n E t1 k with ⟨out1, l1, k1⟩
have e1 := evTopDec_next_ge o n E t1 k
rw [h1] at e1; simp only at e1
cases out1 with
| value I1 =>
dsimp only
rcases h2 : evTopDec o n (E.plusVE I1.VE) t2 k1 with ⟨out2, l2, k2⟩
have e2 := evTopDec_next_ge o n (E.plusVE I1.VE) t2 k1
rw [h2] at e2; simp only at e2
cases out2 <;> simp <;> omega
| stuck => simp; omega
| outOfFuel => simp; omegaProved by a term, which Lean's kernel checks directly.
Theorems it uses
Used by
In StandardElmMech/Mod/Complete.lean: The functional parts' converses, nostuck for modules and programs, noMeaning_of_stuck, evProgram_unique_l, completeness (evProgram_complete, noMeaning_iff).
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.