Definition mem_rmap_cohere m phi :=
contents_cohere m phi /\
access_cohere m phi /\
max_access_cohere m phi /\ alloc_cohere m phi.

Lemma whole_program_sequential_safety:
forall {CS: compspecs} {Espec: OracleKind} (initial_oracle: OK_ty)
(dryspec: ext_spec OK_ty)
(dessicate : forall (ef : external_function) jm,
ext_spec_type OK_spec ef ->
ext_spec_type dryspec ef)
(JDE: juicy_dry_ext_spec _ (@JE_spec OK_ty OK_spec) dryspec dessicate)
(DME: ext_spec_mem_evolve _ dryspec)
prog V G m,
@semax_prog Espec (*NullExtension.Espec*) CS prog V G ->
Genv.init_mem prog = Some m ->
exists b, exists q, exists m',
Genv.find_symbol (Genv.globalenv prog) (prog_main prog) = Some b /\
initial_core  (cl_core_sem (globalenv prog))
0 m q m' (Vptr b Ptrofs.zero) nil /\
forall n,
@dry_safeN _ _ _ OK_ty (genv_symb_injective)
(coresem_extract_cenv  (cl_core_sem (globalenv prog))
(prog_comp_env prog))
forall {CS: compspecs} (prog: program) (V: varspecs) (G: funspecs) ora m f f_id f_b f_body args,
let ge := Genv.globalenv prog in
let ext_link := ext_link_prog prog in
let spec := add_funspecs NullExtension.Espec ext_link G in
let tys := sig_args (ef_sig f) in
let rty := sig_res (ef_sig f) in
let sem := juicy_core_sem (cl_core_sem (Build_genv ge (prog_comp_env prog))) in
@semax_prog spec CS prog V G ->
fun_id ext_link f = Some f_id ->
Genv.find_symbol ge f_id = Some f_b ->
Genv.find_funct  ge (Vptr f_b Ptrofs.zero) = Some f_body ->
forall x : ext_spec_type (@OK_spec spec) f,
ext_spec_pre (@OK_spec spec) f x (genv_symb_injective ge) tys args ora m ->
exists q,
initial_core sem
0 (*additional temporary argument - TODO (Santiago): FIXME*)
m q m
(Vptr f_b Ptrofs.zero) args /\
forall n, safeN_(genv_symb := @genv_symb_injective _ _)(Hrel := juicy_extspec.Hrel) (coresem_extract_cenv sem (prog_comp_env prog))
(upd_exit (@OK_spec spec) x (genv_symb_injective ge)) ge n ora q m.