X-Git-Url: http://git.nguyen.vg/gitweb/?p=tatoo.git;a=blobdiff_plain;f=src%2Fhcons.ml;h=c95045889e6f339ecf93064a63acba92f23f74b4;hp=6a40b06b1dd326c2b02bef712e87be51ad141fd7;hb=aade6d9ba2e2b65e021de8a1c3a2d3874aa5742e;hpb=6b66008811639324be623a42037b60e02056772c diff --git a/src/hcons.ml b/src/hcons.ml index 6a40b06..c950458 100644 --- a/src/hcons.ml +++ b/src/hcons.ml @@ -13,18 +13,14 @@ (* *) (***********************************************************************) -(* - Time-stamp: -*) - -include Sigs.HCONS +include Hcons_sig module type TableBuilder = functor - (H : Sigs.AUX.HashedType) -> - Sigs.AUX.HashSet with type data = H.t + (H : Common_sig.HashedType) -> + Common_sig.HashSet with type data = H.t -module Builder (TB : TableBuilder) (H : Sigs.AUX.HashedType) = +module Builder (TB : TableBuilder) (H : Common_sig.HashedType) = struct type data = H.t type t = { id : Uid.t; @@ -48,9 +44,10 @@ struct let init () = T.clear pool; uid_make := Uid.make_maker () + let dummy x = { id = Uid.dummy; hash = H.hash x; node = x } let make x = - let cell = { id = Uid.dummy; hash = H.hash x; node = x } in + let cell = dummy x in try T.find pool cell with @@ -60,7 +57,7 @@ struct cell end -module Make = Builder (Utils.HashSet) +module Make = Builder (Misc.HashSet) module Weak = Builder (Weak.Make) module PosInt = @@ -76,7 +73,7 @@ struct let hash v = v let uid v = Uid.of_int v - + let dummy _ = ~-1 let equal x y = x == y let init () = ()