Definition res_option (r:resource) : option (rshare * kind) :=
    match r with
      | NO _ _ => None
      | YES sh rsh k _ => Some (readable_part rsh,k)
      | PURE k _ => None
    end.

(* Specifications: *)
Lemma res_option_rewrite: res_option = SM.res_option (pred rmap) oo resource2res.