Add a new option to choose tree model at runtime.
[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 (** {directinclude true} *)
18
19 include module type of Hcons_sig
20
21 (** Output signature of the functor {!Hcons.Make} *)
22
23 module Make (H : Common_sig.HashedType) : S with type data = H.t
24 (** Functor building an implementation of hashconsed values for a given
25     implementation of {!Common_sig.HashedType}. Hashconsed values are
26     persistent: the are kept in memory even if no external reference
27     remain. Calling [init()] explicitely will reclaim the space.
28 *)
29
30 module Weak (H : Common_sig.HashedType) : S with type data = H.t
31 (** Functor building an implementation of hashconsed values for a given
32     implementation of {!Common_sig.HashedType}. Hashconsed values have a
33     weak semantics: they may be reclaimed as soon as no external
34     reference to them exists. The space may still be reclaimed
35     explicitely by calling [init].
36 *)
37
38 module PosInt : Abstract with type data = int and type t = private int
39 (** Compact implementation of hashconsed positive integer that
40     avoids boxing. [PosInt.make v] raises [Invalid_argument] if
41     [ v < 0 ]
42 *)