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-03-04 22:36:31 CET by Kim Nguyen>
20 (** Abstract signature of a module implementing an hashconsed datatype *)
21 module type Abstract =
24 (** The type of the data to be hash-consed *)
27 (** The type of hashconsed data *)
30 (** [make v] internalizes the value [v], making it an hashconsed
35 (** [node h] extract the original data from its hashconsed value
39 (** [hash h] returns a hash of [h], such that for every [h1] and
40 [h2], [equal h1 h2] implies [hash h1 = hash h2].
44 (** [uid h] returns a unique identifier *)
47 (** Equality between hashconsed values. Equivalent to [==] *)
48 val equal : t -> t -> bool
50 (** Initializes the internal storage. Any previously hashconsed
51 element is discarded. *)
52 val init : unit -> unit
54 (** Create a dummy (non-hashconsed) node with a boggus identifer
60 (** Concrete signature of a module implementing an hashconsed datatype *)
64 type t = private { id : Uid.t;
67 include Abstract with type data := data and type t := t