package coq-core

  1. Overview
  2. Docs
The Coq Proof Assistant -- Core Binaries and Tools

Install

Dune Dependency

Authors

Maintainers

Sources

coq-8.19.1.tar.gz
md5=13d2793fc6413aac5168822313e4864e
sha512=ec8379df34ba6e72bcf0218c66fef248b0e4c5c436fb3f2d7dd83a2c5f349dd0874a67484fcf9c0df3e5d5937d7ae2b2a79274725595b4b0065a381f70769b42

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 t

Type of objects to hashcons.

type u

Type of hashcons functions for the sub-structures contained in t. Usually a tuple of functions.

val hashcons : u -> t -> t

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.

val eq : t -> t -> bool

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.

OCaml

Innovation. Community. Security.