Elm Exactly

Theorema25_force_out

StandardElmMech/Mod/A25.lean:81 · tactic proof

Forcing x's thunk, in the environment the group's value binding gives, never ends.

Statement

theorem a25_force_out (Ev : Env) (o : Oracle) (k : Nat) : ∀ n,
    (evExp o n (Ev.plusVE (recVE [("#x", .closure .wild a25T Ev [])])) (forceExp "#x") k).out =
      .outOfFuel

Proof

by
  intro n
  rcases n with _ | _ | _ | n
  · simp [evExp]
  · simp (config := {decide := true}) [evExp, recVE, Env.plusVE, fmPlus,
      Env.VE, Env.QE, forceExp]
  · simp (config := {decide := true}) [evExp, evAtExp, recVE, Env.plusVE, fmPlus,
      Env.VE, Env.QE, forceExp]
  · have hl := a25_loop Ev o k
    simp (config := {decide := true}) only [evExp, evAtExp, recVE, Env.plusVE, fmPlus, Env.lookup,
      fmLookup, Env.VE, Env.QE, forceExp, List.map_cons,
      List.map_nil, List.any_cons, List.any_nil, List.nil_append, List.cons_append, Bool.or_false,
      ite_true, List.append_nil]
    have h := hl (n + 2)
    rw [cloA25] at h
    generalize appVal o (n + 2) _ Val.unit k = r at h ⊢
    rcases r with ⟨out, l, k'⟩
    cases out <;> simp_all

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.