Re: Motion P1788/M007.01_NaI: Discussion period begins
Michel Hack schrieb:
On 2009-08-06 17:47:18 +0200, J. Wolff v. Gudenberg wrote:
I try to avoid different uses of NaI. I think the only usage of NaI
should be "illegal construction". The examples given by Vincent are
for NaN not for NaI where we (will) have sqrt(-1) = emptyset
The "illegal construction" NaI is indeed the most important and general
one. I believe however that there should also be one for "domain error".
That is because in *some* uses of Interval Arithmetic, handling points
outside a function's domain as if they did not exist is not desirable,
whereas in other uses it is precisely the right thing to do. The Vienna
proposal tries to deal with this by recording domain errors in a sticky
flag and producing results according to the rule that points outside a
function's domain don't contribute to the result set -- but that may lead
to a lot of unnecessary calculations when NaI propagation would suffice.
Unfortunately, domain mismatches cannot be accounted for by NaI, since
the flag should also be raised when evaluating sqrt([-1,1]) = [0,1].
Nate Hayes has repeatedly suggested a "two opcodes" approach to this, i.e.
support two versions of primitives and library functions, and I agree.
Yes, this is sensible; Then the user could specify program regions where
one or the other interpretation is to be used.
Whether the two versions should be bound to a single name (the selection
being made by an explicit or implicit-via-mode argument), or whether two
names should be exposed (as Vienna does for "forwards" and "backwards"
modes), is a separate question still to be discussed.
Arnold Neumaier