Re: Constructors motion
On Sat, Dec 3, 2011 at 9:27 AM, Corliss, George
<george.corliss@xxxxxxxxxxxxx> wrote:
> Yes, decorations are our substitute for exceptions.
>
> So, is (Empty,n/f) a Level 2 implementation of the Level 1 concept "Not an Interval"?
>
> Are decorations (in whatever for we agree on) a Level 1 concept or a Level 2 concept?
>
> John is trying to maintain Level 1 as a mathematical model level? So in (say) beginning graduate level real and complex variables (or topology) classes, how do we treat something named by not existing? 1. By the concept of a domain, we try to avoid dealing with functions not being defined. 2. We don't let it happen. Who would say, "Let x be a real number, except that it isn't?"
>
> Perhaps the Level 1 concept of an interval constructor is "Let x be an interval <blah>." It returns an interval.
But the mathematical result of "undefined" is not an acceptable
computation result. When discussing a mathematical function used
outside its domain one can simply say that the results is undefined.
That suggests that in the computation of a function used outside its
domain _requires_ a result equivalent to "undefined"
Both subject mater domains have the same requirement.
>
> It is at the programming Level 2 that we need to ask, "Yeah, but what if <blah> is not a valid interval?"
As described above, one must raise that issue in both subject matter domains.
>
> Alternatively, suppose we view the constructor as a function whose domain includes strings of characters that represent valid intervals. Doesn't our definition of functions of arguments outside their domain already specify the interval("rubbish") MUST return (Empty,n/f)?
No because one must interpret the conversion of "rubbish" as an error.
In computation, hiding errors is even worse than lying about
inclusion.
>
> If so, I do not think we can completely specify an interval constructor until we have agreed upon decorations. Of John's alternatives,
>
>> I have a query however. When a constructor call "fails", should the call
>> (a) return Empty, as currently written;
>> (b) return a "Not an Interval" value, which must then exist at Level 1; or
>> (c) not return any value, i.e. the function is simply undefined at this input argument?
>
> At the level of mathematics, the only way a function can fail is to be called with an argument outside its domain.
>
> I argue that the answer, absent decorations, must be (a).
Can you explain your reasoning? Your formulation leads me to (b).
> However, once we have decorations, the answer is (b), where the concept "Not an Interval" is represented as (Empty,n/f).
Why does the representation of NaI matter? If we are returning NaI,
who cares how it is implemented?
>
> Hence, the correct answer is "(a) AND (b)".
Disagree. the answers (a) conveys no value to the caller.
Lee Winter
NP Engineering
Nashua, New Hampshire
United States of America