textToIntevsal(s) and exceptions
I have a question while testing Marco's reference implementation.
There are three exceptions related to textToInterval(s) :
InvalidOperand when s doesn't represent Level 2 datum
UndefinedOperation when Level 1 value doesn't exist
PossiblyUndefinedOperation when implementation can't determine whether a Level 1 value exists.
Which exception shall be signalled in the cases below:
a) s is a null pointer;
b) s has bad syntax like
s="[1,,2]";
c) s has correct syntax but violates some semantic rule
s="[-inf,-inf]";
d) s has correct syntax and passes semantic rules, but condition l <= u surely fails
s="[2,1]";
e) s has correct syntax and, but condition l <= u possibly fails
s="[1.000000000000000000001,0x1.00000000000001p0]".
I think that:
(a) and (b) signal InvalidOperand
(d) signals UndefinedOperand
(e) may signal PossiblyUndefinedOperand
but I am not sure about (c).
The question is not only
What does the current text of the standard prescribe ?
but also
What does a programmer expect ?
-Dima