Re: So what's null then if it's not nothing?

From: Jon Heggland <heggland_at_idi.ntnu.no>
Date: Fri, 16 Dec 2005 16:38:16 +0100
Message-ID: <MPG.1e0cfdd066e598d6989751_at_news.ntnu.no>


In article <1134692154.971636.72460_at_g14g2000cwa.googlegroups.com>, boston103_at_hotmail.com says...
>
> > > One can infer the 'variable' meaning from "The fact that the letters m,
> > > n do not "look like" any of the integers does not prevent them from
> > > actually having integer values in an expression such as m + n, m - n,
> > > or an assertion that m * m = m.", but it would be a strange
> > > interpretation.
> >
> > Hardly. The analogy must be that 'unknown' can actually *have* a truth
> > value (true or false), which implies that it cannot actually *be* a
> > truth value.
>
> It is a truth value by virtue of its being used in Codd's truth tables.
> Such use simply does not admit any other interpretation unless of
> course you want to redefine the very notion of truth table.

Well, perhaps Codd wasn't as crystal clear on that as you are. How do you interpret his integer analogy, then?

> I suppose we can assume that 'w'/NULL/UNKNOWN are synonyms since it
> does not change anything as long as one understands the context in
> which the string of characters is used. NULL/UNKNOWN/w is clearly a
> member of the extended integer domain. How would you define the usual
> operations over such domain if NULL were not a member ?

How does SQL do it? Personally, I say that NULL is not a value. The integer operations are perfectly normal, and I don't even redefine equality; however, if you do operations on variables that have no value (are NULL), you just get NULL.

> A function is defined as a mapping matching each element of some set
> with a unique element of another, possibly the same, set. As long
> as one defines integer operations with NULL participation, one
> implicitely extends the original integer domain with the new element
> (NULL). Are you suggesting to abandon the fundamental notion of
> function as a mapping between sets (or alternatively, a relation
> between two sets) and create a new 'math' just to accomodate NULL ?

Not at all. Just to keep the functions and the domains exactly as they are, and introduce a rule that if a NULL shows up anywhere, an exception is thrown and a NULL is returned.

> > > Further, instead of having a three-valued logic, you've created a
> > > four valued logic with some strange rules for its usual connectives
> > > (How can one interpret the rule that TRUE OR 'YOUR_NULL' is no longer
> > > true ?
> >
> > Just like you interpret that 0 * NULL is not 0.
>
> I do not. I think such interpretation is nonsensical although formally
> admissible. TRUE OR NULL evaluating to NULL is even more insane.

I think it is nonsense, too. But *given* that traditional strangeness, I think TRUE OR NULL being NULL is consistent.

> As I said earlier, you cannot define any operation using NULL (or any
> other entity) without NULL( or any other entity) being a member of
> some set. Unless of course, you want to create a new 'math' where the
> notion of function is something entirely different from the thing used
> in the traditional math.

Perhaps; my mind thinks in computer programming functions. You argue with theoretical purity, which I normally sympathise with, but I can't really see the practical problems here.

Also, my main argument is just what Codd meant, and you are very far from convincing me that he didn't mean just what SQL-99 says. Of course, the only thing that is likely to convince me otherwise, is Codd himself clarifying his ideas in some other article.

> > Alternatively, I can compare them using IS NULL.
>
> I thought we've already been through that.

So did I, and I though we agreed on it. It seems we have very much trouble understanding one another.

> > Like I said, what you just described as sensible: That you can consider
> > truth tables equal even when they contain NULLs.
>
> So on one hand, you state that NULL is not equal NULL in the context
> of truth values, on the other hand you state that some truth tables
> containing NULL(s) are equal (" have every property in common"). How
> do you manage to reconcile these two assertions ?

By being used to SQL. :) Such apparent contradictions crop up everywhere in that language; cf. my set operator example. Furthermore, I am apparently as sensible as the Oracle and SQL Server designers you praised earlier.

I'll say it again: I'm not saying that SQL and SQL-99 are paragons of logic and language design, just that they sort of work---so the alleged killing of logic may perhaps not be all that serious after all.

> The function you so adamantly desire is already there. It's called
> Kleene's biconditional. You do not need to give up on the simple
> notion of equality in the context of truth values, you do not need to
> talk about 'meta' stuff, you do not need to create a new math where
> NULL is not a member of any set. All you need to do is just to define
> another logical connective.

Still, the simple notion of equality has been given up in all other domains if you consider NULLs values. Why not instead twist the definitions slightly so that NULL is not a value, but the name for a special state for a variable? If I had my way, "NULL" wouldn't be a valid expression. We would just have IS_NULL() and SET_NULL(), and NULL as such couldn't possibly show up in a truth table or literal expression.

-- 
Jon
Received on Fri Dec 16 2005 - 16:38:16 CET

Original text of this message