Program Definition funspecOracle2jspec (ext_link: Strings.String.string -> ident) f : juicy_ext_spec Z :=
  Build_juicy_ext_spec _ (funspecOracle2extspec ext_link f) _ _ _.Fixpoint add_funspecsOracle_rec (ext_link: string -> ident) Z (Espec : juicy_ext_spec Z) (fs : list (ident * funspecOracle Z)) :=
  match fs with
    | nil => Espec
    | cons (i,f) fs' => funspecOracle2jspec Z (add_funspecsOracle_rec ext_link Z Espec fs') ext_link (i,f)
  end.

(* Specifications: *)
Lemma add_funspecs_pre (ext_link: Strings.String.string -> ident) {Z fs id sig cc A P Q x args m} Espec tys ge_s phi0 phi1 z : let ef := EF_external id (funsig2signature sig cc) in list_norepet (map fst fs) -> In (ext_link id, (mk_funspecOracle Z sig cc A P Q)) fs -> join phi0 phi1 (m_phi m) -> P x z (make_ext_args (filter_genv (symb2genv ge_s)) (fst (split (fst sig))) args) phi0 -> exists x' : ext_spec_type (JE_spec _ (add_funspecsOracle_rec ext_link Z Espec fs)) ef, JMeq (phi1, x) x' /\ ext_spec_pre (add_funspecsOracle_rec ext_link Z Espec fs) ef x' ge_s tys args z m.
Lemma add_funspecs_post (ext_link: Strings.String.string -> ident) {Z Espec tret fs id sig cc A} {P Q : A -> Z -> environ -> mpred} {x ret z m ge_s} : let ef := EF_external id (funsig2signature sig cc) in list_norepet (map fst fs) -> In (ext_link id, (mk_funspecOracle Z sig cc A P Q)) fs -> In (ext_link id) (map fst fs) -> ext_spec_post (add_funspecsOracle_rec ext_link Z Espec fs) ef x ge_s tret ret z m -> exists (phi0 phi1 phi1' : rmap) (x' : A), join phi0 phi1 (m_phi m) /\ necR phi1' phi1 /\ JMeq x (phi1', x') /\ Q x' z (make_ext_rval (filter_genv (symb2genv ge_s)) ret) phi0.