Re: Modeling question...

From: David BL <>
Date: Fri, 24 Oct 2008 03:13:21 -0700 (PDT)
Message-ID: <>

On Oct 24, 4:16 pm, "Walter Mitty" <> wrote:
> "David BL" <> wrote in message
> >Ok, I’ll bite…
> >No doubt any data can be made to “fit” into the relational model.
> >The more important question is whether it happens /naturally/. The
> I don't understand the word "naturally" in this context. Isn't all modeling
> artificial, rather than natural?

I'm suggesting that in certain situations the RM is cumbersome, making it inappropriate or inapplicable. This is specifically with regard to /recursive data types/.

For example, recursive data types are appropriate for representing wffs in most formal languages. They are also relevant in compound documents. Eg

struct Chapter

    String title;
    Vector<Paragraph> paragraphs;
    Vector<Chapter> subchapters;

There are two ways that the RM can be used to represent recursive data types:

  1. Using recursive RVAs; or
  2. By introducing abstract identifiers for all the nodes, and appropriate integrity constraints

I find the first quite reasonable, but I'm suspicious of actually calling such an approach "relational".

In the second case lots of integrity constraints are needed because the RM is too flexible! It needs to be heavily constrained to only represent tree structures. The integrity constraints quickly get horribly messy - particularly for a reasonably complex grammar, and I believe it's possible to interpret it as a manually written axiomatization of pointer semantics (the ability to "dereference" an abstract identifier as though it points at one and only one child node in the tree). If you compare the RM to the grammar you will find the former to be /much more complex/.

The following is the example I used when I talked about this 12 months ago:

Using Prolog notation, consider the following relations which allow for representing an expression such as (x+1)*3:

    var(N,S) :- node N is a variable named S     number(N,I) :- node N is a number with value I     add(N,N1,N2) :- node N is the addition of nodes N1,N2     mult(N,N1,N2) :- node N is the product of nodes N1,N2

Define a view called nodes(N) which is a union of projections as follows:

    nodes(N) :- var(N,_).
    nodes(N) :- number(N,_).
    nodes(N) :- add(N,_,_).
    nodes(N) :- mult(N,_,_).

The following are the integrity constraints (each query must be empty):

    var(N,S1), var(N,S2), S1 <> S2?
    number(N,I1), number(N,I2), I1 <> I2?     add(N,N1,_), add(N,N2,_), N1 <> N2?

    add(N,_,N1), add(N,_,N2), N1 <> N2?
    mult(N,N1,_), mult(N,N2,_), N1 <> N2?
    mult(N,_,N1), mult(N,_,N2), N1 <> N2?
    var(N,_),  number(N,_)?
    var(N,_),  add(N,_,_)?
    var(N,_),  mult(N,_,_)?

    number(N,_), add(N,_,_)?
    number(N,_), mult(N,_,_)?
    add(N,_,_), mult(N,_,_)?
    add(_,N,_), not nodes(N)?
    add(_,_,N), not nodes(N)?

    mult(_,N,_), not nodes(N)?
    mult(_,_,N), not nodes(N)? Received on Fri Oct 24 2008 - 12:13:21 CEST

Original text of this message