Module Relation


module Relation: sig .. end

Operations on relations of relational types.




Test functions on relations.


val is_rewrite : Parsetree.relation -> bool
val is_not_rewrite : Parsetree.relation -> bool
val is_commutative : Parsetree.relation -> bool
val is_associative : Parsetree.relation -> bool
val is_involutive : Parsetree.relation -> bool
val is_absorbing : Parsetree.relation -> bool
val is_neutral : Parsetree.relation -> bool
val is_idempotent : Parsetree.relation -> bool
val is_inverse : Parsetree.relation -> bool
val is_distributive : Parsetree.relation -> bool
val is_nilpotent : Parsetree.relation -> bool

Test functions on lists of relations.


val has_commutative : Parsetree.relations -> bool
val has_associative : Parsetree.relations -> bool
val has_idempotent : Parsetree.relations -> bool
val has_absorbing : Parsetree.relations -> bool
val has_absorbent : Parsetree.relations -> bool
val has_neutral : Parsetree.relations -> bool
val has_nilpotent : Parsetree.relations -> bool
val has_idempotent_and_nilpotent : Parsetree.relations -> bool
val get_relation_list : Parsetree.relations -> Parsetree.relation list

Access function on lists of relations.


val find_relation : (Parsetree.relation -> bool) -> Parsetree.relation list -> Parsetree.relation

Selection functions on lists of relations.


val rewrite : Parsetree.relations -> (Parsetree.pattern * Parsetree.expression) list
val commutative : Parsetree.relations -> Longident.t option
val associative : Parsetree.relations -> Parsetree.relation_side option
val absorbent : Parsetree.relations -> (Parsetree.relation_side * Parsetree.generator) option
val absorbing : Parsetree.relations -> (Parsetree.relation_side * Parsetree.generator) option
val neutral : Parsetree.relations -> (Parsetree.relation_side * Parsetree.generator) option
Returns the first neutral element (Left, Right, or Both) for the generator.
val neutral_left : Parsetree.relations -> (Parsetree.relation_side * Parsetree.generator) option
Returns a left neutral element for the generator if any.
val neutral_right : Parsetree.relations -> (Parsetree.relation_side * Parsetree.generator) option
Returns a right neutral element for the generator if any.
val neutral_both : Parsetree.relations -> (Parsetree.relation_side * Parsetree.generator) option
Returns the neutral element (simultaneously Left and Right, or Both) for the generator.
val nilpotent : Parsetree.relations -> (Parsetree.relation_side * Parsetree.generator) option
val idempotent : Parsetree.relations -> Parsetree.relation_side option
val inverse : Parsetree.relations ->
(Parsetree.relation_side * Parsetree.generator * Parsetree.generator option)
option
val distributive : Parsetree.relations ->
(Parsetree.relation_side * Parsetree.generator * Parsetree.generator option *
Parsetree.distributivity_direction)
list

Test functions on generators and lists of relations.


val is_neutral_generator : Parsetree.generator -> Parsetree.relations -> bool

Comparison functions.


val precedence : Parsetree.relation -> int
val compare_side : Parsetree.relation_side -> Parsetree.relation_side -> int
val eq_side : Parsetree.relation_side -> Parsetree.relation_side -> bool
val compare_generator : Parsetree.generator -> Parsetree.generator -> int
val eq_generator : Parsetree.generator -> Parsetree.generator -> bool
Compare generators.
val compare_relation : (Parsetree.relation -> int) ->
Parsetree.relation -> Parsetree.relation -> int
Comparison function on relations based on precedence. Note that two rewrite rules, two structure items, two commutative, or two associative relations are always considered equal.
val sort_rels : (Parsetree.relation -> int) ->
Parsetree.relation list -> Parsetree.relation list
val sort_relations : (Parsetree.relation -> int) -> Parsetree.relations -> Parsetree.relations
module RelOrd: Set.OrderedType  with type t = relation
module RelMap: Map.S  with type key = relation
module RelSet: Myset.S  with type elt = relation