Definition resource_fmap (f:(pred rmap)->(pred rmap)) (x:resource) : resource :=
    match x with
    | NO => NO
    | YES sh k p => YES sh k (preds_fmap f p)
    | PURE k p => PURE k (preds_fmap f p)
    end.

(* Specifications: *)
Lemma valid_res_map : forall f m, valid m -> valid (resource_fmap f oo m).
Lemma resource_fmap_id : resource_fmap (id (pred rmap)) = id resource.
Lemma resource_fmap_comp : forall f g, resource_fmap g oo resource_fmap f = resource_fmap (g oo f).