package rocq-runtime
Install
Dune Dependency
Authors
Maintainers
Sources
md5=8d522602d23e7a665631826dab9aa92b
sha512=f4f76a6a178e421c99ee7a331a2fd97a06e9c5d0168d7e60c44e3820d8e1a124370ea104ad90c7f87a9a1e9d87b2d0d7d2d387c998feeaed4a75ed04e176a4be
doc/rocq-runtime.clib/Hashcons/module-type-HashconsedType/index.html
Module type Hashcons.HashconsedType
Source
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 objects to hashcons.
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.