This is the Coq development accompanying the paper Efficient Extensional Binary Trees by Andrew W. Appel and Xavier Leroy, 2021-2022.
- Canonical.v: the new, extensional implementation of binary tries, using a canonical first-order representation.
- Original.v: the simple, non-extensional implementation of binary tries used in CompCert 3.9 and earlier.
- Node01.v: a minor variant of the Original implementation, slightly more compact but still not extensional, used mostly for benchmarking.
- Sigma.v: an extensional but not very efficient implementation of binary tries obtained by wrapping the Original implementation in a sigma-type.
- GADT.v: another extensional but not very efficient implementation of binary tries that uses GADTs and dependent types.
- Patricia.v: binary Patricia trees from section 12.3 of Functional algorithms, verified! by T. Nipkow et al. About as efficient as the Canonical implementation but not extensional.
- CharTrie.v: a trie data structure with sparse, 256-degree nodes that branch on the next character of the string.
Do make coqbench
to measure the execution speed within Coq.
Do make ocamlbench
to measure execution speed after extraction to OCaml.
See the paper for a description and analysis of the benchmarks.