Intervals_intf.FieldType
An ordered field type is an ordered ring type equipped with a multiplicative inverse.
include RingType
include OrderedType
val pp_finite : finite Fmt.t
Pretty-printer for finite values.
val pp : t Fmt.t
Pretty-printer for extended values.
The comparison function on extended values is an extension of the regular order on finite values.
val minfty : t
minfty
is an extended value -\infty
such that for any extended value x
, -\infty \le x
.
Finite values are included in t
. We will identify a finite value in finite
and its representation in t
.
val pinfty : t
pinfty
is an extended value +\infty
such that for any extended value x
, x \le +\infty
.
Each element of the ordered type t
has a successor. The successor of an element is always greater than the element itself:
\forall x, x \le \mathrm{succ}(x)
We say that x
is a finite upper bound if it is strictly smaller than its successor, i.e. if x < \mathrm{succ}(x)
, and we require that all finite values are finite upper bounds (however there may be finite upper bounds that are not finite values).
succ
must be the inverse of pred
below.
Each element of the ordered type t
has a predecessor. The predecessor of an element is always smaller than the element itself:
\forall x, \mathrm{pred}(x) \le x
We say that x
is a finite lower bound if it is strictly greater than its predecessor, i.e. if \mathrm{pred}(x) < x
, and we require that all finite values are finite lower bounds (however there may be finite lower bounds that are not finite values).
pred
must be the inverse of succ
above.
add
will only be called with values that are compatible with its monotonicity: its argument can never be two bounds of different kinds (upper or lower).
val zero : t
Neutral element for addition.
mul
will be only be called with values that are compatible with its monotonicity: its arguments can be two bounds with the same sign and kind (upper or lower), or two bounds with opposite signs and opposite kinds (upper or lower), but never two bounds with the same sign and opposite kinds or opposite signs and the same kind.
It is recommended to program defensively and raise an assertion failure if mul
is ever called with two bounds of the same sign and opposite kinds or opposite signs and the same kind.