let assoc_opt k l = try Some (List.assoc k l) with Not_found -> None