[std-interval] Mathematical relations and default initialization

George Corliss George.Corliss at marquette.edu
Thu Sep 14 09:53:19 PDT 2006


Friends,

On 9/14/06 3:21 AM, "Frédéric Goualard" <Frederic.Goualard at univ-nantes.fr>
wrote:

> * Default initialization
> I see on page 15 that the default constructor creates an empty interval.
>  At some point in the discussion, Sylvain gave 6 possible ways of
> implementing this constructor:
> 
> 1- no default constructor at all
> 2- [0,0]
> 3- empty
> 4- whole
> 5- uninitialized tag
> 6- see below (something a la "singular iterator")
> 
> Possibility 4 was brushed away from the start, and the remaining
> possibilities heavily debated. In my opinion, it makes sense to have the
> default constructor return "whole" since interval arithmetic is often
> used in processes that try to gain some information on the possible
> value of a variable (that is, we start from a wide interval and narrow
> it down to some reasonably small one).

My first choice is #5, assuming that tags are permitted.

A close second is #4. If we read "[a, b]" as "If an answer exists, it
satisfies a <= x <= b," then #4 does not lie, while #3 often does lie.  If
there is a number, but we have no constraints on its value, it must belong
to R*.

The argument for #3, as I understand it, is that <empty> propagates through
most operations, so that if a coder unintentionally computes with an
uninitialized variable, the eventual result is likely to be <empty>, or some
other obviously incorrect value, and the error is more likely to be caught.
I am sympathetic to that argument, too.

There is no perfect answer.  The danger is that we unintentionally use an
uninitialized variable as if it were initialized.  The trouble comes about
because using two bit patterns, usually interpreted as hi and lo, does not
have enough expressive power.  Raising an exception is one means of adding
expressive power, but there seems to be agreement that intervals should
raise exceptions rarely, if ever.

To express "uninitialized" and several other states an interval object might
have, I favor tags, a concept which has not proven itself in practice.

I suggest the standard should PERMIT a tagged implementation.  I believe the
current proposal does.  Page 9, paragraph 3 says in interval is specified by
two values of type T, but I find on where the proposal forbids the memory
footprint being more.

For the mathematical result to be returned by a default constructor, I favor
#4, <whole> because I value containment above ease of debugging.

Dr. George Corliss
Electrical and Computer Engineering
Marquette University
P.O. Box 1881
1515 W. Wisconsin Ave.
Milwaukee, WI 53201-1881
George.Corliss at Marquette.edu
414-288-6599 (office); 288-4400 (GasDay);
    288-6280 (Dept.); 288-5579 (fax)
Office: Haggerty Engineering 296
Www.eng.mu.edu/corlissg





More information about the Std-interval mailing list