Re: M0030 -- Level 1 constructors
On 2011-12-03 18:01:41 -0500, Michel Hack wrote:
> Different story. At level 1 strings would not be made up of
> characters. But my second point was that text strings are
> NOT level 1 objects, and I just verified that they are not
> mentioned in Motion 2.
I agree with Michel here. I think that text strings are not
Level 1 objects (at least, they were never defined as Level 1
objects). So, IMHO, text2interval(t) should be removed from
this motion. But even if text strings were Level 1 objects,
in the case t does not denote an interval, the constructor
does not make sense from a mathematical point of view. Here
the result Empty was proposed for the only reason that it's
the way to see a NaI; but it is not even the mathematical
empty set.
Note that if nums2interval(l,u) fails, i.e. in the case l > u
or l = +oo or u = -oo, then { x in R | l <= x <= u } is still
mathematically defined and is the empty set. So, the returned
Empty has a mathematical sense. That's why this choice fits
Level 1 very well.
On 2011-12-03 11:41:05 +0000, Corliss, George wrote:
> > E.g. text2interval("rubbish").
>
> Hmmm. Good question.
>
> I THINK that at the LANGUAGE level, I'd like to raise an exception
> so I cannot ignore the error. But that's not THIS standard.
>
> Plan B: "Not an Interval". Empty is a valid interval, so returning
> Empty is a lie. However, I understand your hesitation to introduce
> "Not an Interval" at level 1.
>
> I will listen with interest to the views of others.
I can see 3 solutions:
1. Introduce the notion of "Not an Interval" at Level 1.
It would be an element of the set and could also be used
as an input. It should be seen as an exception, that could
potentially be trapped.
2. Introduce the notion of error at Level 1.
Like (1), but this would not be an element of the set. The way(s)
such an error could be handled should be specified at Level 2,
possibly as implementation-defined (languages have their own way
to deal with such errors). For instance, the empty set (with a
decoration) could be generated.
3. Leave these cases unspecified at Level 1.
I would prefer (2), then (1).
On 2011-12-29 16:25:26 -0500, Lee Winter wrote:
> To the extent that Level 1 is concerned witht he mathematical
> propertiers of the system, math already has a concept of "undefined",
> "error", or "invalid construction". So representing those concepts in
> Level 1 is appropriate. Leaving them out is not appropriate.
Yes, I tend to agree.
> > In the interest of moving forward and making progress, though, and since
> > decorations are still yet to be settled (and controversial), I don't have
> > any problem to say that for *bare intervals* an invalid construction simply
> > returns Empty. This is what Motion 5 does, for example, which says that for
> > bare intervals 1/[0,0] = Empty.
>
> I disagree. Hiding errors or potential errors) is not a venial sin
> (in the von Neuman sense). It is a mortal sin.
I am fine with Empty and don't see it as an error. One just has:
f(X) = { f(x) | x in X and x in D(f) }
At least 1/[0,0] shouldn't be treated differently from sqrt([-0.01,17])
where the -0.01 could have been obtained due to rounding but would
have been 0 with an exact arithmetic. Decorations could be used to
detect potential errors.
--
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon)