Definition build_map (l:list (A * B)) : map :=
     fold_right
      (fun (ab:A * B) m =>
        insert_fpm EqDec_A
           (fst ab)
           (mk_lifted fullshare top_share_nonunit,snd ab) m)
      empty_map l.

(* Specifications: *)
Lemma build_map_results : forall (l:list (A*B)) a b, NoDup (List.map (@fst _ _) l) -> (In (a,b) l <-> (map_val a (build_map l) = Some b /\ map_share a (build_map l) = Share.top)).
Lemma build_map_join : forall (l1 l2:list (A * B)), NoDup (List.map (@fst _ _) (l1++l2)) -> join (build_map l1) (build_map l2) (build_map (l1++l2)).