Module type Parameters.GENERIC_MONOID
A (possibly non-commutative) monoid structure, used to represent relations.
Assumes that any module G implementing this should verify the axioms of a monoid:
- identity is neutral for compose. For all x,
G.compose x G.identity = G.compose G.identity x = x - compose is associative. For all x y z,
G.compose x (G.compose y z) = G.compose (G.compose x y) z
where = is G.equal
The type of elements of the monoid. Since these are used to represent relation between our generic union-find elements GENERIC_ELT.t, they have two type parameters, so an ('a, 'b) t represents a relation between 'a GENERIC_ELT.t and 'b GENERIC_ELT.t
val pretty : Stdlib.Format.formatter -> ('a, 'b) t -> unitPretty printer for relations
val pretty_with_terms :
(Stdlib.Format.formatter -> 'tl -> unit) ->
'tl ->
(Stdlib.Format.formatter -> 'tr -> unit) ->
'tr ->
Stdlib.Format.formatter ->
('a, 'b) t ->
unitpretty_with_terms pp_x x pp_y y rel pretty-prints the relation rel between terms x and y (respectively printed with pp_x and pp_y).
For placeholder variables, use pretty
val identity : ('a, 'a) tThe identity relation
Monoid composition, written using the functional convention compose f g is f \circ g. Should be associative, and compatible with identity:
- For all x,
G.compose x G.identity = G.compose G.identity x = x - For all x y z,
G.compose x (G.compose y z) = G.compose (G.compose x y) z