(** *SyncStep simulation*)
(** Proof of the step diagram when the step is a synchronization step. TODO: Split the proof in each diagram. *)
Inductive deltaMap_cases (dmap:delta_map) b ofs:=
| DMAPS df p:  dmap ! b = Some df -> df ofs = Some p -> deltaMap_cases dmap b ofs
| DNONE1 df:  dmap ! b = Some df -> df ofs = None -> deltaMap_cases dmap b ofs
| DNONE2:  dmap ! b = None -> deltaMap_cases dmap b ofs.

(* Proof of the smallstep diagram *)
Lemma core_diagram':
forall (m : Mem.mem)  (U0 U U': schedule)
(ds : dstate) dtr (js js': jstate) jtr jtr' rmap pmap
(m' : Mem.mem),
match_st js ds ->
invariant ds ->
corestep (JMachineSem U0 rmap) (U, jtr, js) m (U', jtr', js') m' ->
exists (ds' : dstate),
invariant ds' /\
match_st js' ds' /\
exists dtr', corestep (ClightMachineSem U0 pmap) (U, dtr, ds) m (U', dtr ++ dtr', ds') m'.