(* Specialization of stuff in initial_world:
Lemma level_initial_core ge G n : level (initial_core ge G n) = n.
Proof.
  apply level_make_rmap.
Qed.*)

Definition matchfunspecs (ge : genv) (G : funspecs) (Phi : rmap) : Prop :=
  forall (b : block) fsig cc A P Q,
    func_at'' fsig cc A P Q (b, 0%Z) Phi ->
    exists id P' Q' P'_ne Q'_ne,
      Genv.find_symbol ge id = Some b /\
      find_id id G = Some (mk_funspec fsig cc A P' Q' P'_ne Q'_ne) /\
      cond_approx_eq (level Phi) A P P' /\
      cond_approx_eq (level Phi) A Q Q'.

Lemma initial_jm_ext_matchfunspecs {Z} (ora : Z) prog m G n H H1 H2: matchfunspecs (globalenv prog) G (m_phi (initial_jm_ext ora prog m G n H H1 H2)).