Module AMap:= Make AddressOrdered.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)).

Lemma AMap_map {A B} (f : A -> B) m : map snd (AMap.elements (AMap.map f m)) = map f (map snd (AMap.elements m)).