Hint Constructors context contextlist.
Hint Resolve context_compose contextlist_compose.
(** * Safe executions. *)
(** A state is safe according to the nondeterministic semantics if it cannot get stuck by doing silent transitions only. *)
Definition safe (s: Csem.state) : Prop :=
forall s', star Csem.step ge s E0 s' ->
(exists r, final_state s' r) \/ (exists t, exists s'', Csem.step ge s' t s'').

Lemma safe_imm_safe:
forall f C a k e m K,
safe (ExprState f (C a) k e m) ->
context K RV C ->
imm_safe ge e K a m.