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_find_map {A B} m (f : A -> B) k (x : A) : AMap.find k m = Some x -> AMap.find k (AMap.map f m) = Some (f x).