Module Logtk.Comparison
Partial Ordering values
type t
=
|
Lt
|
Eq
|
Gt
|
Incomparable
partial order
type comparison
= t
include Interfaces.PRINT with type t := t
val combine : t -> t -> t
combine 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 -> int
Conversion to a total ordering. Incomparable is translated to 0 (equal).
val of_total : int -> t
Conversion from a total order
val lexico : t -> t -> t
Lexicographic combination (the second is used only if the first is
Incomparable
type 'a comparator
= 'a -> 'a -> t
val (@>>) : 'a comparator -> 'a comparator -> 'a comparator
Combination of comparators that work on the same values. Its behavior is the following:
(f1 @>> f2) x y
is the same asf1 x y
iff1 x y
is notEq
; otherwise it is the same asf2 x y
type ('a, 'b) combination
Lexicographic combination of comparators. It is, roughly, equivalent to
'a -> 'a -> 'b
val (>>>) : 'a comparator -> ('b, 'c) combination -> ('a, 'b -> 'b -> 'c) combination
Lexicographic combination starting with the given function
val last : 'a comparator -> ('a, t) combination
Last comparator
val call : ('a, 'b) combination -> 'a -> 'a -> 'b
Call a lexicographic combination on arguments
val dominates : ('a -> 'b -> t) -> 'a list -> 'b list -> bool
dominates f l1 l2
returnstrue
iff for all elementy
ofl2
, there is somex
inl1
withf x y = Gt
module type PARTIAL_ORD = sig ... end