Definition hackfun phi0 phi :=
level phi0 = level phi /\ ghost_of phi0 = ghost_of phi /\
forall loc, (identity (phi0 @ loc) <-> identity (phi @ loc)) /\
(~identity (phi0 @ loc) -> (phi0 @ loc = phi @ loc)).

(* Specifications: *)
Lemma alloc_Gfun_inflate:
forall n rho i f fs gv vl gev m0 m G0 G,
Genv.alloc_global gev m0 (i, Gfun f) = Some m ->
(forall phi : rmap,
hackfun (inflate_initial_mem m0 (initial_core gev (G0 ++ (i, fs) :: G) n))
phi ->
(globvars2pred gv vl rho) phi) ->
Genv.find_symbol gev i = Some (nextblock m0) ->
~ In i (map fst vl) ->
forall phi : rmap,
hackfun (inflate_initial_mem m (initial_core gev (G0 ++ (i, fs) :: G) n)) phi ->
(globvars2pred gv vl rho) phi.
Lemma resource_identity_dec:
forall (r: resource), {identity r}+{~identity r}.
Lemma hackfun_sep:
forall w1 w2 w w', hackfun w w' -> join w1 w2 w ->
exists w1', exists w2', join w1' w2' w' /\ hackfun w1 w1' /\ hackfun w2 w2'.
Lemma init_datalist_hack:
forall b sh rho dl phi0 z,
(init_data_list2pred dl sh (Vptr b z) rho) phi0 ->
forall phi,
hackfun phi0 phi ->
readable_share sh ->
(init_data_list2pred dl sh (Vptr b z) rho) phi.
Lemma another_hackfun_lemma:
forall n i v gev m G phi m0,
hackfun (inflate_initial_mem m (initial_core gev G n)) phi ->
Genv.alloc_global gev m0 (i, Gvar v) = Some m ->
hackfun (inflate_initial_mem m0 (initial_core gev G n))
(upto_block (nextblock m0) phi).
Lemma hackfun_beyond_block:
forall b w w', hackfun w w' -> hackfun (beyond_block b w) (beyond_block b w').
Lemma Pos_to_nat_eq_S:
forall b, Pos.to_nat b = S (nat_of_Z (Z.pos b) - 1).
Lemma alloc_global_inflate_initial_eq:
forall gev m0 i f m G n loc,
Genv.alloc_global gev m0 (i, Gfun f) = Some m ->
~ identity (inflate_initial_mem m0 (initial_core gev G n) @ loc) ->
inflate_initial_mem m0 (initial_core gev G n) @ loc =
inflate_initial_mem m (initial_core gev G n) @ loc.