Definition initial_mem_match (bc: block_classification) (m: mem) (g: genv) :=
  forall id b v,
  Genv.find_symbol g id = Some b -> Genv.find_var_info g b = Some v ->
  v.(gvar_volatile) = false -> v.(gvar_readonly) = true ->
  bmatch bc m b (store_init_data_list (ablock_init Pbot) 0 v.(gvar_init)).

(* Specifications: *)
Lemma alloc_global_match: forall m g idg m', Genv.genv_next g = Mem.nextblock m -> initial_mem_match bc m g -> Genv.alloc_global ge m idg = Some m' -> initial_mem_match bc m' (Genv.add_global g idg).
Lemma alloc_globals_match: forall gl m g m', Genv.genv_next g = Mem.nextblock m -> initial_mem_match bc m g -> Genv.alloc_globals ge m gl = Some m' -> initial_mem_match bc m' (Genv.add_globals g gl).
Lemma alloc_global_consistent: forall dm rm idg, romem_consistent dm rm -> romem_consistent (PTree.set (fst idg) (snd idg) dm) (alloc_global rm idg).
Lemma romem_for_consistent: forall cunit, romem_consistent (prog_defmap cunit) (romem_for cunit).
Lemma romem_for_consistent_2: forall cunit, linkorder cunit prog -> romem_consistent (prog_defmap prog) (romem_for cunit).
Theorem initial_mem_matches: forall m, Genv.init_mem prog = Some m -> exists bc, genv_match bc ge /\ bc_below bc (Mem.nextblock m) /\ bc_nostack bc /\ (forall cunit, linkorder cunit prog -> romatch bc m (romem_for cunit)) /\ (forall b, Mem.valid_block m b -> bc b <> BCinvalid).
Theorem sound_initial: forall prog st, initial_state prog st -> sound_state prog st.