1 (***************************************************************************)
2 (* Implementation for sets of positive integers implemented as deeply hash-*)
3 (* consed Patricia trees. Provide fast set operations, fast membership as *)
4 (* well as fast min and max elements. Hash consing provides O(1) equality *)
7 (***************************************************************************)
12 val intersect : t -> t -> bool
13 val is_singleton : t -> bool
14 val mem_union : t -> t -> t
17 val uncons : t -> elt*t
18 val from_list : elt list -> t
21 module Int : S with type elt = int =
24 external hash_elt : elt -> int = "%identity"
25 external uid_elt : elt -> int = "%identity"
26 let equal_elt : elt -> elt -> bool = (==);;
28 DEFINE USE_PTSET_INCLUDE
29 INCLUDE "ptset_include.ml"
32 module Make ( H : Hcons.S ) : S with type elt = H.t =
37 let equal_elt = H.equal
38 INCLUDE "ptset_include.ml"
41 (* Have to benchmark wheter this whole include stuff is worth it *)
42 module I : S with type elt = int = Make ( struct type t = int
44 external hash : t -> int = "%identity"
45 external uid : t -> int = "%identity"
46 let equal : t -> t -> bool = (==)
47 external make : t -> int = "%identity"
48 external node : t -> int = "%identity"