Definition makeCurMax_map (mem_access:PMap.t (Z -> perm_kind -> option permission)):
PMap.t (Z -> perm_kind -> option permission):=
PMap.map (fun f => fun z k => f z Max) mem_access.
Definition makeCurMax (m:mem): mem.
apply (Mem.mkmem (Mem.mem_contents m)
(makeCurMax_map (Mem.mem_access m))
(Mem.nextblock m)).
- intros. unfold makeCurMax_map; simpl. rewrite PMap.gmap.
apply po_refl.
- intros. unfold makeCurMax_map; simpl. rewrite PMap.gmap.
apply Mem.nextblock_noaccess; assumption.
- intros; apply Mem.contents_default.
Defined.

Lemma makeCurMax_correct :
forall m b ofs k,
permission_at m b ofs Max = permission_at (makeCurMax m) b ofs k.