Programming Notes

A pat_trie is a node-based binary tree structure mapping keys of type pat_prefix to values, with one key per node. The set of keys is prefix-free, i.e. no key in the set is a prefix of another.

The library exposes three kinds of objects:

Bit-strings are big-endian in 0.20: the most significant bit in a string comes first. This implies that fixed-length keys are sorted in order of their (unsigned) numeric value. The unit in bitstrings is a compile-time constant in patricia.c (PAT_ATOM_NB = 32 bits by default).

The file js/pat.js defines a Patti object which can handle bit-strings at most 32 bits long. It has an intmap interface (geti, puti, etc.) to map 32-bit ints to values. Since Patti bitstrings are big-endian too, intmaps sort their keys (in ascending order).