3e80a036c886e6034a70cb8142882ac71bbf33a3
[tatoo.git] / src / hcons.mli
1 (***********************************************************************)
2 (*                                                                     *)
3 (*                               TAToo                                 *)
4 (*                                                                     *)
5 (*                     Kim Nguyen, LRI UMR8623                         *)
6 (*                   Université Paris-Sud & CNRS                       *)
7 (*                                                                     *)
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   *)
12 (*  ../LICENSE.                                                        *)
13 (*                                                                     *)
14 (***********************************************************************)
15
16 (** Implementation of generic hashconsing. *)
17
18 include module type of Hcons_sig
19
20 (** Output signature of the functor {!Hcons.Make} *)
21
22 module Make (H : Common_sig.HashedType) : S with type data = H.t
23 (** Functor building an implementation of hashconsed values for a given
24     implementation of {!Common_sig.HashedType}. Hashconsed values are
25     persistent: the are kept in memory even if no external reference
26     remain. Calling [init()] explicitely will reclaim the space.
27 *)
28
29 module Weak (H : Common_sig.HashedType) : S with type data = H.t
30 (** Functor building an implementation of hashconsed values for a given
31     implementation of {!Common_sig.HashedType}. Hashconsed values have a
32     weak semantics: they may be reclaimed as soon as no external
33     reference to them exists. The space may still be reclaimed
34     explicitely by calling [init].
35 *)
36
37 module PosInt : Abstract with type data = int and type t = int
38 (** Compact implementation of hashconsed positive integer that
39     avoids boxing. [PosInt.make v] raises [Invalid_argument] if
40     [ v < 0 ]
41 *)