1 (***********************************************************************)
5 (* Kim Nguyen, LRI UMR8623 *)
6 (* Université Paris-Sud & CNRS *)
8 (* Copyright 2010-2012 Université Paris-Sud and Centre National de la *)
9 (* Recherche Scientifique. All rights reserved. This file is *)
10 (* distributed under the terms of the GNU Lesser General Public *)
11 (* License, with the special exception on linking described in file *)
14 (***********************************************************************)
18 module type TableBuilder =
20 (H : Common_sig.HashedType) ->
21 Common_sig.HashSet with type data = H.t
23 module Builder (TB : TableBuilder) (H : Common_sig.HashedType) =
26 type t = { id : Uid.t;
29 let uid_make = ref (Uid.make_maker())
33 let equal t1 t2 = t1 == t2
39 let equal x y = x == y || H.equal x.node y.node
43 let pool = T.create 101
46 uid_make := Uid.make_maker ()
47 let dummy x = { id = Uid.dummy; hash = H.hash x; node = x }
55 let cell = { cell with id = !uid_make(); } in
60 module Make = Builder (Misc.HashSet)
61 module Weak = Builder (Weak.Make)
68 if v < 0 then raise (Invalid_argument "Hcons.PosInt.make")
75 let uid v = Uid.of_int v
77 let equal x y = x == y