Re: So what's null then if it's not nothing?
Date: 15 Dec 2005 06:43:02 -0800
Message-ID: <1134657782.044908.325470_at_g49g2000cwa.googlegroups.com>
Jon Heggland wrote:
[...]
>
> 1. The "obvious" problems you talk about are definitely not obvious to a
> lot of people.
You mean that there are people, including you, who might think that 'x equals y' even if x and y *do not* have every property in common ? If so, that's a strange notion of equality, and clearly disagreeing on such basic stuff makes any discussion regarding formal systems impossible.
> 2. My interpretation of Codd, right or wrong, seems thus to be the most
> commonly accepted.
Well, being "most commonly accepted" is nothing to be proud of besides it is irrelevant.
>
> > > It may be "just a trick", but so what? SQL commonly considers tables
> > > containing NULLs to be equal in other contexts anyway---for purposes of
> > > union and intersection, for example. NULLs are (seemingly) sometimes
> > > equal and sometimes not; it's no problem to consider them equal for
> > > truth table comparison purposes.
> >
> > That's a possible interpretation (having two different equaity
> > predicates) as I mentioned in my earlier message on 'meta' vs. 'object'
> > language, but completely unnecessary since a simlpler interpretation
> > would suffice especially when backed up by common sense. While one can
> > argue that the rationale for NULL = NULL evaluating to FALSE, say, in
>
> Nitpick: evaluating to UNKNOWN/NULL.
Right, sorry about that.
>
> > the integer domain makes sense because we presumably do not know
> > whether NULL represents the same values, one cannot do so in the
> > domain of truth values where UNKNOWN (aka NULL) represents *the same*
> > degree of truth (if one wants to have n degrees of truth, one uses
> > n-VL). Therefore, sacrificing simplicity and common sense for the
> > sake of 'uniformity' does not apper to be a very clever decision.
>
> Common sense isn't as common as one would like to think. And the
> simplicity argument cuts both ways.
So you claim that UNKNOWN does not represent the same degree of truth ?
So, you reject not only the notion of truth table comparison, but
deny any meaning ascribed to truth values for the sake of 'uniformity'.
Cool.
>
> > Regarding 'uniformity', witness TRUE OR NULL evaluatiing to TRUE, not
> > NULL as a uniformity purist would expect.
>
> Yes, and I do object to that.
And you do not realize that by doing so you destroy entirely what's left of Lukasiewicz's (or Kleene's) logic (after you had removed the notion of logical equivalence) since the AND and OR truth tables are no longer what they used to be ? And it does not bother you that the commonly accepted interpretaion of OR as something being true if at least one operand is true does not work any more ? Most cool.
>
> > > > I gave you examples of simple logical expressions not being equivalent
> > > > in my earlier response. You can easily imagine any SQL using such
> > > > expressions.
> > >
> > > So transformations for optimisation is your only objection?
> >
> > No, and you can easily locate my other objections in the earlier
> > messages.
>
> None practical enough for my taste. But I won't bother you more about it
> if it is so difficult to come up with a concrete example.
Whatever you say.
>
> > > Aren't they then just doing what I am suggesting: using a "trick" to
> > > compare truth tables? What database engines and designers are you
> > > talking about, by the way?
> >
> > Folks who wrote SQL Sever, Oracle, et.
>
> Oracle follows the SQL-99 boolean rules, except that it doesn't allow
> boolean columns. Example:
>
> create or replace function booltest return varchar2 is
> b1 boolean;
> begin
> b1 := NULL;
> if (b1 = b1) = TRUE then return 'T';
> elsif (b1 = b1) = FALSE then return 'F';
> elsif (b1 = b1) = NULL then return 'Really strange';
> elsif (b1 = b1) IS NULL then return 'U';
> else return 'None of the above';
> end if;
> end;
>
> This returns 'U', in accordance with the standard. What does SQL Server
> do?
What I meant was that Oracle people were sensible enough to regard the expressions with the same truth tables, even containing nulls, as equivalent which is evidenced by the optimizer behaviour in spite of the nonsensical interface they present to the end user. They did not have much say in this matter but try and conform to the standard.
> --
> Jon
Received on Thu Dec 15 2005 - 15:43:02 CET