Definition Delta1 V G {C: compspecs}: tycontext :=
  make_tycontext ((1%positive,(Tfunction Tnil Tvoid cc_default))::nil) nil nil Tvoid V G nil.

(* Specifications: *)
Lemma match_globvars_in': forall i t vl vs, match_globvars vl vs = true -> In (i,t) vs -> exists g, In (i,g) vl /\ gvar_info g = t.
Lemma match_globvars_in: forall i vl vs, match_globvars vl vs = true -> In i (map (@fst _ _) vs) -> In i (map (@fst _ _) vl).
Lemma match_globvars_norepet: forall vl vs, list_norepet (map (@fst _ _) vl) -> match_globvars vl vs = true -> list_norepet (map (@fst _ _) vs).
Lemma tc_ge_denote_initial: forall vs G (prog: program), list_norepet (prog_defs_names prog) -> match_globvars (prog_vars prog) vs = true-> match_fdecs (prog_funct prog) G -> typecheck_glob_environ (filter_genv (globalenv prog)) (make_tycontext_g vs G).
Lemma semax_prog_typecheck_aux: forall vs G {C: compspecs} (prog: program) b, list_norepet (prog_defs_names prog) -> match_globvars (prog_vars prog) vs = true -> match_fdecs (prog_funct prog) G -> typecheck_environ (Delta1 vs G) (construct_rho (filter_genv (globalenv prog)) empty_env (PTree.set 1 (Vptr b Ptrofs.zero) (PTree.empty val))) .
Lemma in_map_sig {A B} (E:forall b b' : B, {b=b'}+{b<>b'}) y (f : A -> B) l : In y (map f l) -> {x : A | f x = y /\ In x l }.
Lemma find_symbol_funct_ptr_ex_sig V ge id f : (exists b : block, Genv.find_symbol ge id = Some b /\ Genv.find_funct_ptr ge b = Some f) -> {b : block | Genv.find_symbol ge id = Some b /\ @Genv.find_funct_ptr (Ctypes.fundef function) V ge b = Some f}.
Lemma initial_jm_funassert V (prog : Clight.program) m G n H H1 H2 : (funassert (nofunc_tycontext V G) (empty_environ (globalenv prog))) (m_phi (initial_jm prog m G n H H1 H2)).
Lemma initial_jm_ext_funassert (ora : OK_ty) V (prog : Clight.program) m G n H H1 H2 : (funassert (nofunc_tycontext V G) (empty_environ (globalenv prog))) (m_phi (initial_jm_ext ora prog m G n H H1 H2)).
Lemma semax_prog_rule' {CS: compspecs} : forall V G prog m h, @semax_prog CS prog V G -> Genv.init_mem prog = Some m -> { b : block & { q : corestate & (Genv.find_symbol (globalenv prog) (prog_main prog) = Some b) * (forall jm, m_dry jm = m -> exists jm', semantics.initial_core (juicy_core_sem (cl_core_sem (globalenv prog))) h jm q jm' (Vptr b Ptrofs.zero) nil) * forall n z, { jm | m_dry jm = m /\ level jm = n /\ nth_error (ghost_of (m_phi jm)) 0 = Some (Some (ext_ghost z, NoneP)) /\ jsafeN (@OK_spec Espec) (globalenv prog) n z q jm /\ no_locks (m_phi jm) /\ matchfunspecs (globalenv prog) G (m_phi jm) /\ (funassert (nofunc_tycontext V G) (empty_environ (globalenv prog))) (m_phi jm) } } }%type.
Lemma semax_prog_rule {CS: compspecs} : OK_ty = unit -> forall V G prog m h, @semax_prog CS prog V G -> Genv.init_mem prog = Some m -> { b : block & { q : corestate & (Genv.find_symbol (globalenv prog) (prog_main prog) = Some b) * (forall jm, m_dry jm = m -> exists jm', semantics.initial_core (juicy_core_sem (cl_core_sem (globalenv prog))) h jm q jm' (Vptr b Ptrofs.zero) nil) * forall n, { jm | m_dry jm = m /\ level jm = n /\ (forall z, jsafeN (@OK_spec Espec) (globalenv prog) n z q jm) /\ no_locks (m_phi jm) /\ matchfunspecs (globalenv prog) G (m_phi jm) /\ (funassert (nofunc_tycontext V G) (empty_environ (globalenv prog))) (m_phi jm) } } }%type.