Thread Links Date Links
Thread Prev Thread Next Thread Index Date Prev Date Next Date Index

Re: Motion 46: finalise interval literals, amendments



Vincent

On 28 Jun 2013, at 10:32, Vincent Lefevre wrote:
>>> (3) Should nums2interval() use (as it does currently) the Siegfried
>>> Rump scheme where nums2interval(oo,oo) gives [HUGEPOS,oo]?
> 
> NO!
> (Jürgen wrote:)
>> I dare to say yes although the consequences will be
>> -- constructor([oo,oo] =[realmax,oo]
>> or constructor ([oo,oo]) is invalid
>>  -- nums2intval [oo] = union of {[a,oo] :a > realmax}
>> 
>> either there is a difference between constructor and num2intval
>> or [oo] is a valid interval hence motion 3 is violated.
>> ==> I change my yes into NO

I don't get this: nums2interval is one of the 2 constructors.

> What's the difference between "nums2interval" and "constructor"?
> 
> Note that nums2interval(+oo,+oo) should never occur in practice,
> as RNDD(any real number) < +oo. Or does anyone have an example?

Siegfried had several stories from his own experience where users came to grief on this. I think this was one scenario:
- The interval package was such that nums2interval(oo,oo) (no brackets, Jürgen!) returned Empty.
- User was constructing interval xx = [a,b] as Union of nums2interval(a,a) and nums2interval(b,b). (I forget why, maybe that's how it had to be done in that package.)
- This done for a sequence of b's getting bigger.
- Eventually b overflowed and you had xx = Union([a,a],Empty) = [a,a] which is a containment failure.

Certainly this sort of thing can occur in practice. The interface between the floating-point and interval worlds has unavoidable hazards, and Siegfried wanted to minimise these hazards by adding this special case.

John Pryce