Re: Notions of Type

From: paul c <toledobythesea_at_oohay.ac>
Date: Thu, 17 Aug 2006 01:12:16 GMT
Message-ID: <QnPEg.410590$iF6.320822_at_pd7tw2no>


Bob Badour wrote:
> Keith H Duggar wrote:
>

>> Bob Badour wrote:
>>
>>> JOG wrote:
>>>

...
> My only objection to "type = algebraic structure" is the requirement for
> closure within a single type. For any type, we can define the algebra as
> the type and the subset of the type's operations that exhibit closure.
> In my view, the type includes the entire set of operations defined on
> the values of the type including those not exhibiting closure.
>
> For instance, an operation might have a single character string operand
> with non-negative integers as result as is the case with the length
> operation. That operation is certainly part of the character string type
> and arguably part of the non-negative integer type. It is not part of
> any algebraic structure. Or do I misunderstand something?
>
> Square root is part of the algebra for non-negative reals and for
> perfect squares but not for integers. It is, however, a valid operation
> on integers resulting in values of a different type.
>
> Division is not part of the algebra for any type that includes zero as
> one of its values. Or is it?
>
> Other than possibly the _Principle of Cautious Design_, I can think of
> no immediate objection to a type where the set of operations in the
> algebra is empty. On the other hand, it might be difficult to devise
> such a type that has any use.

What a refreshing change of topic, back to basics (instead of anti-existentialist mumbo-jumbo and extravagant philosophy as well as big words that don't seem necessary to learn the cdt topic) is okay with me. Not being a mathematician or engineer or for that matter not being much of anything, in my old assembler days I unconsciously eliminated all domains that included zero. This was partly because I didn't know how to get the OS to trap divide-by-zero (in some cases, even the OS didn't know how to do that!) - I just made sure all numbers had a very small fractional part. For reading anything tabular, I prefer blanks over zeroes any day.

Most of that programming had to do with market research and I can't remember a customer ever complaining. (What they did complain about was being told their market share was declining while their business was increasing - president of Loblaws regularly refused to pay for reports unless we bumped his share! Similar attitude from big-name accountants who got rid of the rounding errors in their books by zeroing all penny amounts.)

I haven't met a user yet who didn't understand at some level that the use of any computer software involves some mental suspension of reality.   They typically put up with consultants who stated otherwise out of fear of the boss or the consultant's shareholder uncle. In the mundane biz world that pays for most of the db hokum, there are a few times when high precision matters but I'd say it's economical to handle those specially.

As for the 'empty algebra', I think in an ideal world this appl'n pgmr would prefer a string domain that didn't even support length and was limited to only 'member of' and 'equals' operators. That's assuming complete disjunction and negation aren't supported, which for a mundane appl'n they don't need to be. (I seem to remember some people here think an equality test is part of the RM, so please don't bother flaming   me with objections to the above, on this point I'd had to say I'm a fairly quiet ignorami whose mind is pretty much made up.)

p Received on Thu Aug 17 2006 - 03:12:16 CEST

Original text of this message