UnionFind.Parameters
Common module types for Imperative
and Functional
parameters. Defines the types of the functor parameters.
Some vocabulary conventions:
'a t
(often a GADT/a type where 'a
is phantom)('a,'b) t
modeling mathematical relation between terms. The set of relations has a group structure. Classical union-find only has a single relation: type ('a, 'b) t = Equiv : ('a,'a) t
)'a t
of values associated with each class (or more precisely, to the representative of each class). Values and relations interact via a group action Value.apply
.Terms are the elements in our union-find structures.
module type SIMPLE_GENERIC_TERM = sig ... end
A type for generic terms stored in our imperative union-find structures.
module type GENERIC_TERM = sig ... end
A type for generic terms stored in our functional union-find structures. This should be a subtype PatriciaTree.HeterogeneousKey
.
Relations between terms. Classical union find has a single equivalence relation, which can be mimicked with type ('a, 'b) t = Equiv : ('a,'a) t
) However, we can have more complex relation (any group structure) fairly easily
module type SIMPLE_GENERIC_GROUP = sig ... end
A (possibly non-commutative) group structure, used to represent relations.
module type GENERIC_GROUP = sig ... end
Same as SIMPLE_GENERIC_GROUP
, with some extra functions used in the functional union-find.
Values associated with each relation class between terms, values and relation interact via a group action
module type SIMPLE_GENERIC_VALUE = sig ... end
The values associated with each equivalence class in the imperative union-find
module type GENERIC_VALUE = sig ... end
The values associated with each equivalence class in the functional union-find
Node representative for imperative union-find. This can be used if terms have builtins pointer to their parents
module type SIMPLE_UF_NODE = sig ... end
Simple union-find node, without values
module type UF_NODE = sig ... end
union-find node with values