Definition squash (n_rm:nat * rmap') : rmap :=
match n_rm with (n,rm) => K.squash (n, rmap'2pre_rmap rm) end.
Definition unsquash (phi:rmap) : (nat * rmap') :=
match K.unsquash phi with (n,rm) => (n, pre_rmap2rmap' rm) end.
Definition rmap_level (phi:rmap) : nat := fst (unsquash phi).
Definition resource_at (phi:rmap) : address -> resource := fst (snd (unsquash phi)).
Infix "@" := resource_at (at level 50, no associativity).
Definition ghost_of (phi:rmap) : ghost := snd (snd (unsquash phi)).

Lemma pred_ext': forall {A} `{agA: ageable A} P Q,
(forall x, app_pred P x <-> app_pred Q x) -> P = Q.