Re: Undefined behaviour (Was: Definition of intervals as subsets...)
Dear Michel, et. al.,
Gabriel Dos Reis wrote:
I would think 'implementation defined' is better than 'undefined
behaviour'. The difference is that the implementation is required
to document the behaviour.
Agreed, in cases where (a) the subject matter is peripheral to the
standard as a whole and (b) there are different reasonable ways to
handle the cases. Treatment of non-standard intervals is the prime
example.
I would not share the view that non-standard intervals are peripheral to the standard. It is also worth noting that standardizing on the Kaucher intervals would actually reduce the overall amount of required "implementation defined" or "undefined
behaviors." It can do this in a way that comes at little or no cost, even for software implementations such as a C++ class library.
For example, the Kaucher interval addition
[a,b]+[c,d]=[a+c,b+d]
is the same as the classical formula except it relaxes the constraint a <= b and c <=d, i.e.,
[5,2]+[3,9]=[8,11]
is the correct modal result. So a C++ class library does not need to perform error checking on the user input, and the standard would not need to specify any "implementation defined" or "undefined behavior."
Users who do not wish to take advantage of the features provided by the Kaucher arithmetic can simply input intervals [a,b] such that a <= b to all arithmetic operations and obtain the usual classical results. So it does not interfere with existing
implementations based entirely on classical interval arithmetic.
Sincerley,
Nate Hayes
Sunfish Studio, LLC