(*setPermBlock with a function*)
  Fixpoint setPermBlockFunc (fp : Z -> option permission) (b : block)
           (ofs : Z) (pmap : access_map) (length: nat): access_map :=
    match length with
      0 => pmap
    | S len =>
      setPerm (fp (ofs + (Z_of_nat len))%Z) b (ofs + (Z_of_nat len))%Z (setPermBlockFunc fp b ofs pmap len)
    end.

(* Specifications: *)
Lemma setPermBlockFunc_same: forall fp b ofs ofs' pmap sz (Hofs: (ofs <= ofs' < ofs + (Z.of_nat sz))%Z), (Maps.PMap.get b (setPermBlockFunc fp b ofs pmap sz)) ofs' = fp ofs'.
Lemma setPermBlockFunc_other_1: forall fp b ofs ofs' pmap sz (Hofs: (ofs' < ofs)%Z \/ (ofs' >= ofs + (Z.of_nat sz))%Z), (Maps.PMap.get b (setPermBlock fp b ofs pmap sz)) ofs' = Maps.PMap.get b pmap ofs'.
Lemma setPermBlockFunc_other_2: forall fp b b' ofs ofs' pmap sz, b <> b' -> (Maps.PMap.get b' (setPermBlock fp b ofs pmap sz)) ofs' = Maps.PMap.get b' pmap ofs'.
Lemma computeMap_1 : forall (pmap : access_map) (dmap : delta_map) b ofs df (p : option permission), Maps.PTree.get b dmap = Some df -> df ofs = Some p -> Maps.PMap.get b (computeMap pmap dmap) ofs = p.
Lemma computeMap_2 : forall (pmap : access_map) (dmap : delta_map) b ofs df, Maps.PTree.get b dmap = Some df -> df ofs = None -> Maps.PMap.get b (computeMap pmap dmap) ofs = Maps.PMap.get b pmap ofs.
Lemma computeMap_3 : forall (pmap : access_map) (dmap : delta_map) b ofs, Maps.PTree.get b dmap = None -> Maps.PMap.get b (computeMap pmap dmap) ofs = Maps.PMap.get b pmap ofs.