TheoremtextValue_eval
Every text derives its value in its environment.
Statement
theorem textValue_eval (E : Env) (x : Var) (p : AtPat) (ps : List AtPat) (e : Exp) :
EvalDec E (.val (.var x (lams (p :: ps) e) none)) (textValue E (.fn x (p :: ps) e))Proof
by
have hv : EvalValBind E (.var x (lams (p :: ps) e) none) (fmPlus [(x, .closure p (lams ps e) E [])] []) :=
EvalValBind.r_d_valbind_var _ _ _ _ _ _ (EvalExp.r_d_exp_lambda E p (lams ps e)) (EvalValBindOpt.opt_none _)
have he : fmPlus [(x, Val.closure p (lams ps e) E [])] ([] : ValEnv) = [(x, .closure p (lams ps e) E [])] := by
simp [fmPlus]
rw [he] at hv
simp only [textValue]
split
· rename_i h; exact EvalDec.r_d_dec_rec _ _ _ hv h
· rename_i h; exact EvalDec.r_d_dec_nonrec _ _ _ hv (by simpa using h)Proved with tactics, which Lean expands into a proof term that its kernel checks.
Rules of the book it uses
Used by
In StandardElmMech/Eff/TaskTexts.lean: The elm/core 1.0.5 texts of Task and of the List functions it reaches, their values taken in order, and their derivations (textValue_eval, taskTexts_eval, listTexts_eval); ME0(Task) and ME0(Process).
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.