(* /SOLUTION *)

(* Specifications: *)
Lemma apply_heap_get :  forall h D x e,
scoped_heap D h ->
get x h = Some e ->
apply_heap h (var_f x) = apply_heap h (nom_to_exp e).
Lemma simulate_error : forall D h e s,
machine_step (dom h \u D) (h,e,s) = Error _ ->
scoped_conf D (h,e,s) ->
not (exists e0, step (decode (h,e,s)) e0).