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 : Sigs.AUX.HashedType) ->
21 Sigs.AUX.HashSet with type data = H.t
23 module Builder (TB : TableBuilder) (H : Sigs.AUX.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 ()
49 let cell = { id = Uid.dummy; hash = H.hash x; node = x } in
54 let cell = { cell with id = !uid_make(); } in
59 module Make = Builder (Utils.HashSet)
60 module Weak = Builder (Weak.Make)
67 if v < 0 then raise (Invalid_argument "Hcons.PosInt.make")
74 let uid v = Uid.of_int v
76 let equal x y = x == y