Project

General

Profile

Statistics
| Branch: | Revision:

cool / src / lib / HashConsing.mli @ 7c4d2eb4

History | View | Annotate | Download (699 Bytes)

1
type ('a, 'b) hash_consed =
2
    private { node : 'a; hkey : int; tag : int; fml : 'b; mutable neg : ('a, 'b) hash_consed }
3

    
4
module type HashedTyped =
5
  sig
6
    type nde
7
    type fml
8
    val equal : nde -> nde -> bool
9
    val hash : nde -> int
10
    val toFml : nde -> fml
11
    val negNde : nde -> nde
12
  end
13

    
14
module type S =
15
  sig
16
    type t
17
    type nde
18
    type fml
19
    val create : ?size:int -> bool -> t
20
    val hashcons : t -> nde -> (nde, fml) hash_consed
21
    val length : t -> int
22
    val iter : ((nde, fml) hash_consed -> unit) -> t -> unit
23
    val fold : ('a -> (nde, fml) hash_consed -> 'a) -> 'a -> t -> 'a
24
  end
25

    
26
module Make(H : HashedTyped) : (S with type nde = H.nde and type fml = H.fml)