package codex

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Relations.EqualitySource

The simplest relation: strict equality y = x between variables

Sourcetype (_, _) t =
  1. | Equal : ('a, 'a) t
    (*

    Simplest possible relation: equality (singleton group)

    *)

Group operation (compose, inverse, identity, equal) and printer

include Union_Find.Parameters.GENERIC_GROUP with type ('a, 'b) t := ('a, 'b) t
include Union_Find.Parameters.GENERIC_MONOID with type ('a, 'b) t := ('a, 'b) t
Sourceval equal : ('a, 'b) t -> ('a, 'b) t -> bool

Equality of relations

Sourceval pretty : Format.formatter -> ('a, 'b) t -> unit

Pretty printer for relations

Sourceval pretty_with_terms : (Format.formatter -> 'tl -> unit) -> 'tl -> (Format.formatter -> 'tr -> unit) -> 'tr -> Format.formatter -> ('a, 'b) t -> unit

pretty_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

Sourceval identity : ('a, 'a) t

The identity relation

Sourceval compose : ('b, 'c) t -> ('a, 'b) t -> ('a, 'c) t

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
Sourceval inverse : ('a, 'b) t -> ('b, 'a) t

Group inversion, should verify for all x: G.compose x (G.inverse x) = G.compose (G.inverse x) x = G.identity

Sourcemodule Action (B : sig ... end) : GROUP_ACTION with type bitvector = B.bitvector and type integer = B.integer and type boolean = B.boolean and type enum = B.enum and type ('a, 'b) relation = ('a, 'b) t