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

From: Jon Heggland <heggland_at_idi.ntnu.no>
Date: Sat, 3 Dec 2005 11:42:06 +0100
Message-ID: <MPG.1dfb944052048481989725_at_news.ntnu.no>


In article <1133546193.414342.230440_at_f14g2000cwb.googlegroups.com>, boston103_at_hotmail.com says...
>
> My interpretation of his words is that he clearly realizes that the
> example is *not* a tautology in the 3vl, but it would have been in the
> 2vl, therefore, he wants to have a mechanism that would interpret a
> 3vl expression, in some cases, so that it would be a tautology in the
> 2vl knowing well that there cannot be a general tautology detection
> approach either in the 2vl or in the 3vl.

Then our interpretations differ. And you don't agree with Clement-  that it would be a "curious mixture" "suggesting that a RDBMS should use two-valued logic to detect tautologies, and three-valued logic for everything else."?

> > I rather obviously meant the zero to denote the very same logical
> > constant in both statements.
>
> You did not specify the meaning explicitely and I cannot rely on the
> standard interpretation in this sort of discussion.

Ah, but wouldn't it be convenient if you could? :) Or at least the "standard interpretation" that something is equal and equivalent to itself.

> > Based on his article, it is *not* blindingly obvious (to me) that Codd
> > means null=null should ever evaluate to anything but unknown. That is
> > the core of my argument, and probably the reason why this discussion has
> > gone on for so long.
>
> I cannot undestand how you came to this strange conclusion. Please
> provide facts for the conclusion that Codd thought that NULL=NULL
> always eavluates to UNKNOWN.

"Here, we shall concern ourselves with only the =3Fvalue at present unknown=3F type of null and denote it by w"

"[W]hat is the truth value of x = y if x or y or both are null? An appropriate result in each of these cases is the unknown truth value, rather than true or false."

"We use the same symbol =3Fw=3F to denote the unknown truth value, because truth values can be stored in databases and we want the treatment of all unknown or null values to be uniform."

What does he mean by "uniform treatment", if unknown/null/w is treated *differently* as a truth value and as any other kind of "value"?

Now *you* provide facts for the conclusion that Codd thought that NULL=NULL sometimes evaluates to TRUE.

> > If it were common to mix integer arithmetic and boolean logic in the
> > same formulae, yes! Fortunately, it is not---but such a mix of null as
> > 3VL truth value and as missing value marker does indeed occur in SQL,
> > and in Codd's article.
>
> But in SQL, one never uses any logical constant explicitely {UNKNOWN,
> TRUE, FALSE} appear only in descriptions of how this or that should
> function.

So the boolean datatype, boolean columns and expressions are *still* not part of the standard? I thought they were supposed to be part of SQL2 (or whatever it's called now). Codd, at least, wanted truth values to be stored in databases, cf. the quote above.

> I meant that, if you need to deal only with values of some domain
> (strings), not with unknown/missing markers thereof, there is no
> problem. Clearly, if one needs to name two different
> things/object/ideas in the same context/domain one would use two
> different labels.

And if you use NULL for the unknown truth value, how do you designate a missing one?

> The logic vocabulary exists in its own context and I personally do not
> see any problem in separating logic constants from any other domain
> labels. Are you as much confused when using the label 'a' as an
> English article, the first letter of alphabet, or a variable, or
> something else ?

See above. Alternatively, consider it a matter of taste. Why make things more messy than necessary by overloading symbols just for the hell of it? What makes NULL a better symbol than UNKNOWN for the truth value?

> > > > I'll ask you yet again: Do you claim that when null is encountered as a
> > > > 3VL boolean (lukasiewiczian?), Codd (or SQL) says null = null should
> > > > yield true?
> > >
> > > As a logical constant, yes, as an unknown/missing value, no.
> >
> > Can you back this up with quotes from the article, or the SQL standard?
>
> The standard, or the article, does not discuss elementary notions of
> logic. maybe they should, I do not know.

Then what do you base your assertion on?

> > I assume the 3VL meaning for the symbols; not that it matters much. You
> > say Codd's rule that null=null is unknown has an exception for the case
> > when null is a 3VL value.
>
> It's not an exception.

Codd says: "[W]hat is the truth value of x = y if x or y or both are null? An appropriate result in each of these cases is the unknown truth value, rather than true or false." This is his rule, whereas ...

> I'll try again one last time. NULL in the
> context of some domain of values, integers, characters, whatever,

(Truth values is also a domain.)

> means an unknown/missing value (as defined by Codd and the SQL
> standard). NULL in the context of the 3vl is just another logical
> *constant* which has got nothing to do whatsoever with the meanning of
> NULL as a missing/unknown value.

... this is a different rule. Codd does *not* say this, and neither does the SQL standard, by your own admission.

> Substitute whatever string of
> characters you like most for NULL as a logical constant, and nothing
> will change.

On the contrary. If Codd had used U instead of null/w for the truth value unknown, we wouldn't be having this argument.

-- 
Jon
Received on Sat Dec 03 2005 - 11:42:06 CET

Original text of this message