Module Logtk.Comparison
Partial Ordering values
type t=|Lt|Eq|Gt|Incomparablepartial order
type comparison= t
include Interfaces.PRINT with type t := t
val combine : t -> t -> tcombine two partial comparisons, that are assumed to be compatible, ie they do not order differently if Incomparable is not one of the values.
- raises Invalid_argument
if the comparisons are inconsistent.
val to_total : t -> intConversion to a total ordering. Incomparable is translated to 0 (equal).
val of_total : int -> tConversion from a total order
val lexico : t -> t -> tLexicographic combination (the second is used only if the first is
Incomparable
type 'a comparator= 'a -> 'a -> t
val (@>>) : 'a comparator -> 'a comparator -> 'a comparatorCombination of comparators that work on the same values. Its behavior is the following:
(f1 @>> f2) x yis the same asf1 x yiff1 x yis notEq; otherwise it is the same asf2 x y
type ('a, 'b) combinationLexicographic combination of comparators. It is, roughly, equivalent to
'a -> 'a -> 'b
val (>>>) : 'a comparator -> ('b, 'c) combination -> ('a, 'b -> 'b -> 'c) combinationLexicographic combination starting with the given function
val last : 'a comparator -> ('a, t) combinationLast comparator
val call : ('a, 'b) combination -> 'a -> 'a -> 'bCall a lexicographic combination on arguments
val dominates : ('a -> 'b -> t) -> 'a list -> 'b list -> booldominates f l1 l2returnstrueiff for all elementyofl2, there is somexinl1withf x y = Gt
module type PARTIAL_ORD = sig ... end