# Re: NULLs: theoretical problems?

Date: Sun, 26 Aug 2007 08:03:05 -0000

Message-ID: <1188115385.374574.148520_at_50g2000hsm.googlegroups.com>

On 25 aug, 16:32, "V.J. Kumar" <vjkm..._at_gmail.com> wrote:

*> Jan Hidders <hidd..._at_gmail.com> wrote innews:1188040682.225629.211180_at_q3g2000prf.googlegroups.com:
**>
**>
**>
*

> > On 25 aug, 02:09, "V.J. Kumar" <vjkm..._at_gmail.com> wrote:

*> >> Jan Hidders <hidd..._at_gmail.com> wrote
**> >> innews:1187998994.047351.228760_at_q4g2000prc.googlegroups.com:
**>
**> >> > On 25 aug, 01:35, "V.J. Kumar" <vjkm..._at_gmail.com> wrote:
**> >> >> Are you saying that 'DEF t.a : (t.a = 5 OR TRUE)' evaluates to
**> >> >> 'false' ?
**>
**> >> > It evaluates to 'false' if t.a is undefined, and to 'true' if it is
**> >> > defined.
**>
**> >> >> Please give us the DEF operator interpretation rules. Without the
**> >> >> rules the discussion quickly becomes rather meaningless, really !
**>
**> >> > I've already done that twice. So for the third time: The formula
**> >> > "DEF c : f(c)" evaluates to true if c is defined and f(c) evaluates
**> >> > to true, and to false in all other cases.
**>
**> >> Very well. Now that we have the rules, let's consider some aspects
**> >> of the DEF logic that I've already mentioned but do not mind
**> >> repeating my words again:
**>
**> >> 1. The classical logic 'x or true=true' does not hold if x is
**> >> undefined.
**>
**> > In the allowed formulas x cannot be undefined. So the logic doesn't
**> > say anything about whether it holds or not holds.
**>
**> >> 2. The classical logic 'x or not x = true' does not hold if x is
**> >> undefined.
**>
**> > Also here, in the allowed formulas x cannot be undefined.
**>
**> >> Parenthetically, I find your complaint about the same
**> >> phenomenon in the SQL three-valued logic, well, mysterious taking
**> >> into account the fact that the DEF logic has the same defect !
**>
**> > It doesn't. In the allowed formulas it holds.
**>
**> >> Apparently,
**> >> the DEF logic behaves the same way as the SQL three-valued logic does
**> >> in all the cases except (1).
**>
**> > There are other cases as well. All rules from 2VL logic apply in the
**> > allowed formulas so everywhere that 2VL differs from 3VL there def
**> > logic will also differ from 3VL.
**>
**> What's this "allowed" beast ?
*

Some suitable syntactical restriction that for example disallows the formula 'f(x)' if x represents a nullable column, and forces you to write 'DEF x : f(x)'. Defining it exactly is left to the reader as an exercise but it it similar to, say, a syntactical restriction that ensures domain independence.

> Clearly, 'def(x):(x or not x') is allowed [...]

... and is indeed equivalent with 'def(x):true'.

> Likewise, 'def(x):(x or true)'

... and is indeed equivalent with 'def(x):true'. Which nicely illustrates that the usual 2VL laws still apply.

- Jan Hidders