package coq-core
Install
Dune Dependency
Authors
Maintainers
Sources
md5=64b49dbc3205477bd7517642c0b9cbb6
sha512=02fb5b4fb575af79e092492cbec6dc0d15a1d74a07f827f657a72d4e6066532630e5a6d15be4acdb73314bd40b9a321f9ea0584e0ccfe51fd3a56353bd30db9b
doc/coq-core.clib/Hashcons/Make/argument-1-X/index.html
Parameter Make.X
Generic hashconsing signature
Given an equivalence relation eq
, a hashconsing function is a function that associates the same canonical element to two elements related by eq
. Usually, the element chosen is canonical w.r.t. physical equality (==)
, so as to reduce memory consumption and enhance efficiency of equality tests.
In order to ensure canonicality, we need a way to remember the element associated to a class of equivalence; this is done using the table type generated by the Make
functor.
Type of hashcons functions for the sub-structures contained in t
. Usually a tuple of functions.
The actual hashconsing function, using its fist argument to recursively hashcons substructures. It should be compatible with eq
, that is eq x (hashcons f x) = true
.
A comparison function. It is allowed to use physical equality on the sub-terms hashconsed by the hashcons
function, but it should be insensible to shallow copy of the compared object.
val hash : t -> int
A hash function passed to the underlying hashtable structure. hash
should be compatible with eq
, i.e. if eq x y = true
then hash x = hash y
.