Section AMap2PMap.
(*Need to build a permission map from a finite map*)
(*The pmap is used in the compcert memory. *)
Context {lock_info: Type}.
Variable am: AMap.t lock_info.
Definition A2PMap (*: Map.PMap*) :=
fold_left
(fun (pmap:access_map) (a:address * lock_info)=>
match a with
| ((b, ofs), _) => setPermBlock (Some Memtype.Writable) b ofs pmap LKSIZE_nat
end)
(AMap.elements am)
(PMap.init (fun _ => None)).
End AMap2PMap.
Instance EqDec_AMap_key : EqDec AMap.key.

Lemma AMap_Raw_map_app {A} (f : A -> A) l1 l2 :
AMap.Raw.map (option_map f) (app l1 l2) =
app (AMap.Raw.map (option_map f) l1)
(AMap.Raw.map (option_map f) l2).