Program Definition HO_pred_eq {T}{agT: ageable T}
(A: Type) (P: A -> pred T) (A': Type) (P': A' -> pred T) : pred nat :=
fun v => exists H: A=A',
match H in (_ = A) return (A -> pred T) -> Prop with
| refl_equal => fun (u3: A -> pred T) =>
forall x: A, (P x <=> u3 x) v
end P'.
Next Obligation.
intros; intro; intros.
destruct H0. exists x.
destruct x.
intros. specialize (H0 x). eapply pred_hereditary; eauto.
Qed.

(* Specifications: *)
Lemma laterR_level: forall w w' : rmap, laterR w w' -> (level w > level w')%nat.
Lemma necR_level:  forall w w' : rmap, necR w w' -> (level w >= level w')%nat.
Lemma HO_pred_eq_i1:
forall A P P' m,
approx (level m) oo  P = approx (level m) oo P' ->
(|> HO_pred_eq A P A  P') m.
Lemma semax_func_cons_aux:
forall (psi: genv) id fsig1 cc1 A1 P1 Q1 NEP1 NEQ1 fsig2 cc2 A2 P2 Q2 (V: varspecs) (G': funspecs) {C: compspecs} b fs,
Genv.find_symbol psi id = Some b ->
~ In id (map (fst (A:=ident) (B:=fundef)) fs) ->
match_fdecs fs G'  ->
claims  psi (nofunc_tycontext V ((id, mk_funspec fsig1 cc1 A1 P1 Q1 NEP1 NEQ1) :: G')) (Vptr b Ptrofs.zero) fsig2 cc2 A2 P2 Q2 ->
fsig1=fsig2 /\ cc1 = cc2 /\ A1=A2 /\ JMeq P1 P2 /\ JMeq Q1 Q2.
Lemma semax_func_cons:
forall
fs id f cc (A: TypeTree) P Q NEP NEQ (V: varspecs) (G G': funspecs) {C: compspecs},
andb (id_in_list id (map (@fst _ _) G))
(andb (negb (id_in_list id (map (@fst ident fundef) fs)))
(semax_body_params_ok f)) = true ->
Forall
(fun it : ident * type =>
complete_type cenv_cs (snd it) =
true) (fn_vars f) ->
var_sizes_ok cenv_cs (f.(fn_vars)) ->
f.(fn_callconv) = cc ->
precondition_closed f P ->
semax_body V G f (id, mk_funspec (fn_funsig f) cc A P Q NEP NEQ) ->
semax_func V G fs G' ->
semax_func V G ((id, Internal f)::fs)
((id, mk_funspec (fn_funsig f) cc A P Q NEP NEQ)  :: G').