# Re: NULLs: theoretical problems?

Date: Fri, 24 Aug 2007 08:43:45 -0000

Message-ID: <1187945025.085666.159800_at_m37g2000prh.googlegroups.com>

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

*> Jan Hidders wrote:
**> > V.J. Kumar wrote:
**> > > Jan Hidders wrote:
**>
*

> > > > I mean that if you take a select-from-where query with a formula f in

*> > > > in the where clause containing the DEF construct then replacing f with
**> > > > f' where all the DEF constructs are removed (i.e. we replace "DEF x :
**> > > > g" with "g" until there are no more such expressions) sometimes
**> > > > changes the meaning of the query.
**>
**> > > Let's take a look at it. Could you give a query example and you
**> > > interpretration of the DEF construct therein ?| ?
**>
**> > SELECT * FROM t WHERE DEF t.a : (t.a = 5 OR TRUE);
**>
**> > is not equivalent with
**>
**> > SELECT * FROM t WHERE t.a = 5 OR TRUE;
**>
**> > I'm not sure why you want me to explain the meaning of the DEF
**> > construct again, because you already seemed to understand it, but for
**> > completeness: the formula "DEF c : f" holds iff the value of column c
**> > is defined and the formula f holds.
**> And previously you wrote:
**> > meaning of "DEF t.a : f(t.a)" would be that t.a is defined and the
**> > formula f(t.a) holds. It would be required for nullable attributes,
**> > but not for not nullable attributes. So if t.a is nullable, and s.b
**> > not, then you would have to write "DEFI t.a : t.a = s.b". The need for
**> > this can be relatively straightforwardly checked by the DBMS
**>
**> So it's required to "write DEF" for all nullable attributes
*

Exactly.

*> and a
**> formula is true only if the nullable attributes are defined.
*

That case is avoided because the formula only has to be evaluated if all nullable attributes in it are in fact defined.

*> How
*

> is this different from dropping the requirement to "write DEF" and

*> simply defining that a formula is false if any of it's variables
**> is undefined?
*

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. 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?

- Jan Hidders