[std-interval] Revised document available

Guillaume Melquiond guillaume.melquiond at ens-lyon.fr
Thu Sep 21 15:20:55 PDT 2006


Le jeudi 21 septembre 2006 à 12:46 +0100, Dr John Pryce a écrit :

> >No, I think you are putting too much meaning in the wording of 26.6#3.
> 
> I disagree.

[...]

> No. The basic definition forbids it. Suppose m is 2 and r is type T 
> machine precision, EPS. Then 2-EPS and 2+EPS are not type T machine 
> numbers. So the words of the text forbid [2-EPS, 2+EPS] to be a member of I_T.

Okay, I get it now.

[...]

> Thus, we are completely silent about data representation. I 
> personally would favour something close to this. If we stick with 
> closed intervals for the moment, reworded text could be on these lines:
> 
> >A nonempty closed interval in R is a set of the form
> >       {x in R | a <= x <= b}
> >where the endpoints a, b are R union {-oo, +oo} with a <= b. This 
> >set is denoted [a,b] if a and b are finite. If an endpoint is 
> >infinite, the corresponding square bracket is replaced by a round 
> >bracket to show that the endpoint is not a member of the interval.
> >The whole line is a closed interval, since it equals (-oo, +oo).
> >
> >This standard supports one abstract model:
> >- The whole line is the reals R.
> >- The set I comprises all nonempty closed intervals in R, together with the
> >   empty set.
> >[ ...one should give an abstract definition of operations here. ]
> >For each supported type T, the implementation-dependent set I_T, of 
> >intervals supported by the interval<T> instantiation, must be a 
> >subset of I that includes the empty set and the whole line. I_T must 
> >be defined in the implementation's user documentation.
> 
> This wording leaves data representation opaque. It only needs small 
> changes to accommodate non-closed intervals should this be desirable.

This may be a bit verbose. I wonder if we really have to say that much
in the "standard" part of proposal (it could be fine for the "rationale"
part though). Could we not get the same effect by simply saying
something along the lines of the following in place of 26.6#3?

        Intervals are connected subsets of the set of real numbers.
        Which subsets are representable by \texttt{interval<T>} is
        implementation- defined. An implementation shall support at
        least the empty set $\emptyset$, the whole set of real numbers
        $\mathbb{R}$, and any singleton interval $\{x\}$ for $x$ a real
        number representable by a floating-point number of type
        \texttt{T}.

So it leaves to the implementation any consideration about closed/open
intervals. As only singleton intervals are mandated, a midpoint-radius
representation will not be prevented. It might even accommodate a cset
interpretation if we are careful enough with the first sentence. I don't
think operations have to be defined here, as they are (almost all)
defined by expressions on sets.

Best regards,

Guillaume



More information about the Std-interval mailing list