Re: Modeling question...

From: JOG <jog_at_cs.nott.ac.uk>
Date: Sun, 26 Oct 2008 18:16:00 -0700 (PDT)
Message-ID: <72c55183-8031-4644-aeb4-0453f31587d1_at_v53g2000hsa.googlegroups.com>


On Oct 24, 10:13 am, David BL <davi..._at_iinet.net.au> wrote:
> On Oct 24, 4:16 pm, "Walter Mitty" <wami..._at_verizon.net> wrote:
>
> > "David BL" <davi..._at_iinet.net.au> wrote in message
>
> >news:de0dc1e9-1953-49d9-ae84-00cab59d1195_at_z6g2000pre.googlegroups.com...
>
> > >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:

I think this is the wrong way of looking at it. The OO (for want of a better word) and RM approaches are two different ways of modelling statements of fact from the world. And yet you seem to be stating the problem as how to try and model a struct/object in RM? (That would be like complaining that after you've put all your milk into a fridge, you're having trouble pouring the fridge onto your cereal!)

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

What do you do in real life to identify a chapter? You refer to it by name or number - and the same for subchapters too right? And if two subchapters have the same local identifier (e.g. 'introduction') well you use a composite identifer such as "the 'introduction' of the third chapter". And if you can refer to a chapter when communicating with someone else, then you have necessarily stated something about it in the form of a proposition - and if it can be stated as a proposition...it can be encoded as a tuple in RM.

And as far as constraints are concerned, what more do you need apart from a subchapter can only have one containing chapter? I don't see the issue with this example. Regards, J.

>
> 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 Mon Oct 27 2008 - 02:16:00 CET

Original text of this message