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 (***********************************************************************)
16 (** Abstract signature of a module implementing an hashconsed datatype *)
17 module type Abstract =
20 (** The type of the data to be hash-consed *)
23 (** The type of hashconsed data *)
26 (** [make v] internalizes the value [v], making it an hashconsed
31 (** [node h] extract the original data from its hashconsed value
35 (** [hash h] returns a hash of [h], such that for every [h1] and
36 [h2], [equal h1 h2] implies [hash h1 = hash h2].
40 (** [uid h] returns a unique identifier *)
43 (** Equality between hashconsed values. Equivalent to [==] *)
44 val equal : t -> t -> bool
46 (** Initializes the internal storage. Any previously hashconsed
47 element is discarded. *)
48 val init : unit -> unit
50 (** Create a dummy (non-hashconsed) node with a boggus identifer
56 (** Concrete signature of a module implementing an hashconsed datatype *)
60 type t = private { id : Uid.t;
63 include Abstract with type data := data and type t := t