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)).

Lemma resource_identity_dec:
forall (r: resource), {identity r}+{~identity r}.