Re: NULLs: theoretical problems?

From: V.J. Kumar <vjkmail_at_gmail.com>
Date: Fri, 24 Aug 2007 16:55:36 +0200 (CEST)
Message-ID: <Xns99966F274A19Dvdghher_at_194.177.96.26>


Jan Hidders <hidders_at_gmail.com> wrote in news:1187945025.085666.159800_at_m37g2000prh.googlegroups.com:

> On 24 aug, 06:03, Keith H Duggar <dug..._at_alum.mit.edu> wrote:
>> Jan Hidders wrote:  

> Then some of the basic laws of propositional logic would no longer
> hold. For example "P OR NOT(P)" would not be always equivalent ot
> "TRUE" since the first might contain a nullable attrbute and therefore
> be sometimes false under your interpretation, and the second of course
> never is.

It is true that 'x or not x = true' no longer holds in the SQL threevalued  logic. It seems however that the 'def' cure to salvage the classical logic 'x or not x = true' is worse than the disease really ! Consider the following:

Assume age is undefined for all rows.

select * from person where def(age):(age>10) -- no rows are selected select * from person where def(age):not(age <=10) -- all rows are selected despite the fact that '(age>10)' and 'not(age<=10)' describe, classically, the same set of persons !

The SQL three-valued logic is more 'honest' here because it just does not know what to do and won't select any rows in both cases.

The above is based on my interpretation of 'def'. If we assume Jon's interpretation, then def(x) AND (x or not x) always evaluates to false and the 'x or not x = true' does not hold in the def-logic either.

> Or what would be the result of NOT(NOT(P)) if P contains an
> undefined variable? False? But the result of NOT(P) is also false. So
> NOT(false) = false?

In the SQL three-valued logic, not(not(p)) when p is unknown is unknown. The result of not(p) is also unknown.
>
> -- Jan Hidders
>

>
Received on Fri Aug 24 2007 - 16:55:36 CEST

Original text of this message