- Functional sets - several different implementations of the set data
structure. Some of them seem to be more efficient than the Set module included in
the OCaml standard library.
- Functional linear sets - several implementation of
the ordered set data structure (similar to arrays, but functional).
- Functional associative tables - several different implementation
of associative tables (similar to hash tables and associative lists).
- List permutations
- CVSWEB access
to MetaPRL utilities directory
- Set_sig.SetSig signature is similar to Set.S from the OCaml standard library
and defines a functional data structure for set.
- Red_black_set module implements Set_sig.SetSig using red-black trees. For MetaPRL purposes
this implementation turned out to be the most efficient.
- Fun_splay_set module implements Set_sig.SetSig using splay trees. In Fun_splay_set module
the splay operations are performed functionally (i.e. we create a new copy instead of modifying
in-place) and only after all splay operations are performed, the root of the tree is modified
in-place to point to the new structure.
- Splay_set module implements Set_sig.SetSig using splay trees. All splay operations are done
in-place, but interface is still functional. Surprisingly it turned out that for MetaPRL purposes
this approach is less efficient than Fun_splay_set.
- Hash_set implements Set_sig.SetSig using hash tables. In this implementation most operations
are delayed and are done lazily.
- Small_set module converts some existing implementation of Set_sig.SetSig into a new
implementation where small sets are represented using lists and large sets - using original
implementation.
- Debug_string_sets module is useful when you are writing a new implementation of a
Set_sig.SetSig and want to use it in a program that extensively uses string sets.
Debug_string_sets takes two implementations of Set_sig.SetSig with type elt = string
(the idea is to use the reference implementation and the newly written implementation being debugged)
and creates a new one when all operations are duplicated in both of the original modules
and the results are compared. If two implementations give different answers, the error is reported.
Back to top.
- Set_sig.LinearSetSig defines a data structure of enumerated sequences of objects (similar to arrays, but read-only)
- Array_linear_set provides an implementation of Set_sig.LinearSetSig based on arrays.
- Splay_linear_set provides an implementation of Set_sig.LinearSetSig based on splay trees.
Back to top.
- Set_sig.TableSig defines a data structure of functional associative tables (similar to associative lists or functional equivalent of hash tables).
- Red_black_table module implements Set_sig.TableSig using red-black trees. For MetaPRL purposes
this implementation turned out to be the most efficient.
- Splay_table module implements Set_sig.TableSig using splay trees.
Similarly to Fun_splay_set module, in Splay_table
the splay operations are performed functionally (i.e. we create a new copy instead of modifying
in-place) and only after all splay operations are performed, the root of the tree is modified
in-place to point to the new structure.
Back to top.
- Permutations module defines a data structure for permutations and functions to compute permuted lists to permutations
and to permute the lists using the permutations.
Back to top.