This library provides two hashtable structures. They use either Radix trees
and positive integers, or persistent arrays Coq.PArray
and machine integers.
Their purpose is to be efficient when evaluating the code with Coq's virtual
machine vm_compute
.
src
- Source code for hash tablessrc/Table.v
- Hashtable with PArraysrc/Radix.v
- Hashtable with Radix treesrc/Hashtable.v
- Glue code for Hashtable with int keyssrc/HashtablePositive.v
- Glue code for Hashtable with Positive keyssrc/Int_utils.v
- Lemma and function on int likefold_int
tests
- Test codetests/fibo.v
- Hashtable int test on Fibonacci functiontest/pascal.v
- HashTable int test on Pascal functiontest/syracuse.v
- HashTable int test on Syracuse functiontest/syracuse_pos.v
- HashTable positive test on Syracuse verification function
The main
branch is currently developed using Coq version 8.17.1.
coq_makefile -f _CoqProject -o Makefile
make
Full documentation: diqt
Function (A: Keys, B: Value):
create: Set -> int -> t B
add: t B -> A -> B -> t B
find: t B -> A -> option B
find_all: t B -> A -> list B
mem: t B -> A -> bool
remove: t B -> A -> t B
replace: t B -> A -> B -> t B
Hashtable Int
keys functor
Module Type HashI.
Parameter A: Set.
Parameter eq: A -> A -> bool.
Parameter eq_spec: forall x y: A, reflect (x = y) (eq x y).
Parameter hash: A -> int.
End HashI.
HashTable Positive
keys functor
Module Type HashP.
Parameter A: Set.
Parameter eq: A -> A -> bool.
Parameter eq_spec: forall x y: A, reflect (x = y) (eq x y).
Parameter hash: A -> positive.
End HashP.