Hello! I am happy to announce segmap. This OCaml library implements segment maps, a purely functional data structure that represents an increasing function of the natural numbers into the natural numbers. This data structure offers efficient support for many operations, including lookup, reverse lookup, horizontal and vertical displacements, insertion at the front end, composition, meet, and join. This data structure may be useful in proof assistants, compilers, and symbolic computation systems where variables are encoded as de Bruijn indices or co-de Bruijn indices.
The data structure is described in this paper, and the documentation of the library is available online.
opam update
opam install segmap
Happy hacking,
FP.