Theorema25_loop
The evaluator runs out of fuel forcing the thunk, at every fuel.
Statement
theorem a25_loop (E1 : Env) (o : Oracle) (k : Nat) :
∀ n, (appVal o n (cloA25 E1) .unit k).out = .outOfFuelProof
by
intro n
induction n using Nat.strongRecOn with
| _ n ih =>
by_cases h : n < 14
· have : n = 0 ∨ n = 1 ∨ n = 2 ∨ n = 3 ∨ n = 4 ∨ n = 5 ∨ n = 6 ∨ n = 7 ∨ n = 8 ∨ n = 9 ∨
n = 10 ∨ n = 11 ∨ n = 12 ∨ n = 13 := by omega
rcases this with rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl <;>
simp (config := {decide := true}) [cloA25, a25T, appVal, matchAtPat, evExp, evAtExp, evDec,
evValBind, evValBindOpt, isRecursive, recVE, Env.plusVE, fmPlus, Env.lookup, fmLookup, Env.VE,
Env.QE, fmDom, fvValBindRhs, fvValBindRhsOpt, fvExp, fvAtExp]
· obtain ⟨M, rfl⟩ : ∃ M, n = M + 14 := ⟨n - 14, by omega⟩
rw [a25_step]; exact ih (M + 6) (by omega)Proved with tactics, which Lean expands into a proof term that its kernel checks.
Theorems it uses
Used by
In StandardElmMech/Mod/A25.lean: A25: the module x = let f _ = x in f () has no meaning (a25_no_value, a25_no_meaning), by the loop of the evaluator forcing x's thunk (a25_loop) and completeness.
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.