Definition maxF (f : Z -> perm_kind -> option permission) :=
fun ofs k => match k with
| Max => Some Freeable
| Cur => f ofs k
end.
Definition allF (f : Z -> perm_kind -> option permission) :=
fun (_ : Z) (_ : perm_kind) => Some Freeable.
Fixpoint PList (f : (Z -> perm_kind -> option permission) ->
Z -> perm_kind -> option permission)
l m : list (positive * (Z -> perm_kind -> option permission)) :=
match l with
| nil => nil
| x :: l =>
(Pos.of_nat x, f (PMap.get (Pos.of_nat x) m)) :: (PList f l m)
end.

(* Specifications: *)
Lemma PList_app :
forall l m x f,
(PList f l m) ++ ((Pos.of_nat x,
f (PMap.get (Pos.of_nat x) m)) :: nil) =
PList f (l ++ (x :: nil)) m.
Lemma PList_cons :
forall f l m x,
(Pos.of_nat x, f (PMap.get (Pos.of_nat x) m)) :: (PList f l m) =
PList f (x :: l) m.
Lemma PList_correct :
forall f l m k v
(HInl: List.In k l)
(HInMap: List.In (Pos.of_nat k, v) (PTree.elements m.2)),
List.In (Pos.of_nat k, f v) (PList f l m).
Lemma PList_mkBlock_complete :
forall f k v m n
(Hk: k > 0)
(HIn1: List.In (Pos.of_nat k, v) (PList f (mkBlockList n) m)),
List.In k (mkBlockList n).
Lemma PList_mkBlock_det :
forall n f k v v' m
(HIn1: List.In (Pos.of_nat k, v) (PList f (mkBlockList n) m))
(HIn2: List.In (Pos.of_nat k, v') (PList f (mkBlockList n) m)),
v = v'.