Legend:
Library
Module
Module type
Parameter
Class
Class type
Hash tables for hash consing.
Hash consed values are of the following type hash_consed. The field tag contains a unique integer (for values hash consed with the same table). The field hkey contains the hash key of the value (without modulo) for possible use in other hash tables (and internally when hash consing tables are resized). The field node contains the value itself.
Hash consing tables are using weak pointers, so that values that are no more referenced from anywhere else can be erased by the GC.
author Jean-Christophe FILLIATRE
type'a hash_consed = private{
hkey : int;
tag : int;
node : 'a;
}
type'a t
Generic part, using ocaml generic equality and hash function.
hashcons t n hash-cons the value n using table t i.e. returns any existing value in t equal to n, if any; otherwise, allocates a new one hash-consed value of node n and returns it. As a consequence the returned value is physically equal to any equal value already hash-consed using table t.
hashcons t n hash-cons the value n using table t i.e. returns any existing value in t equal to n, if any; otherwise, allocates a new one hash-consed value of node n and returns it. As a consequence the returned value is physically equal to any equal value already hash-consed using table t.
iter f t iterates f over all elements of t.
val stats : 'at-> int * int * int * int * int * int
iter f t iterates f over all elements of t.
Return statistics on the table. The numbers are, in order: table length, number of entries, sum of bucket lengths, smallest bucket length, median bucket length, biggest bucket length.