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 (***********************************************************************)
17 Time-stamp: <Last modified on 2013-02-06 18:43:46 CET by Kim Nguyen>
22 module type TableBuilder =
24 (H : Sigs.AUX.HashedType) ->
25 Sigs.AUX.HashSet with type data = H.t
27 module Builder (TB : TableBuilder) (H : Sigs.AUX.HashedType) =
30 type t = { id : Uid.t;
33 let uid_make = ref (Uid.make_maker())
37 let equal t1 t2 = t1 == t2
43 let equal x y = x == y || H.equal x.node y.node
47 let pool = T.create 101
50 uid_make := Uid.make_maker ()
51 let dummy x = { id = Uid.dummy; hash = H.hash x; node = x }
54 let cell = { id = Uid.dummy; hash = H.hash x; node = x } in
59 let cell = { cell with id = !uid_make(); } in
64 module Make = Builder (Misc.HashSet)
65 module Weak = Builder (Weak.Make)
72 if v < 0 then raise (Invalid_argument "Hcons.PosInt.make")
79 let uid v = Uid.of_int v
81 let equal x y = x == y