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 plus_safe:
forall s1 s2 t s3,
safe s1 -> star Csem.step ge s1 E0 s2 -> (safe s2 -> plus Csem.step ge s2 t s3) ->
plus Csem.step ge s1 t s3.