![]() | |
#41
| |||
| |||
|
|
Marshall wrote: On Oct 31, 7:50 pm, David BL <davi... (AT) iinet (DOT) net.au> wrote: Isn't it helpful to see the analogy with a pointer dereference? I'll leave it up to you as to whether you dislike the analogy between node identifiers and pointer values, and the idea that a join can be compared to a pointer dereference. Perhaps you are right and the analogy creates confusion. I think if we are clear about it being an analogy we are on solid ground. But as soon as we start thinking pointers and references are the *same* thing we are in trouble, because now we can't see the differences anymore. I think Date actually nails this issue. He says (roughly) that pointers add complexity but don't add any expressive power. Isn't the other 'point' that 'pointers point somewhere' but values stored in a relation don't - that relational database bases work on associative addressing. In particular, even in a foreign key, the value doesn't point to the referenced primary key; it merely contains the same value as some entry in the referenced table. It may also contain the same value as a large number of other places in the database. |
#42
| |||
| |||
|
|
I am reminded of pAssembler that I used years ago at university. It was called "NIP" which stood for "nothing in particular". My compsci instructor said that several times. |
#43
| |||
| |||
|
|
Actually, Paul had a pretty good take on atomic just now: it means the relational operators can't decompose them. As has been said a bunch of times, the only operation the RM requires on attribute domains is the equality test. |
#44
| |||
| |||
|
|
I guess I equate pointers with edges in a directed graph (where by directed graph I'm referring to the formalised notion of a set of nodes plus a set of directed edges between nodes), and naturally I regard an AST as an acyclic directed graph. |
#45
| |||
| |||
|
|
represent an AST, a foreign key node identifier ends up uniquely referencing precisely one tuple in one relation elsewhere in the DB. |
#46
| |||
| |||
|
|
I mentioned previously that pointers are only meaningful or functional within the context of a specific, typically non-portable address space. Without the address space, pointers might as well be random numbers. So if you are going to pack up some data and move it from, say, one machine to another, you have to go through all sorts of contortions to preserve some semblance of pointer semantics. And as anyone who's dug through the code for Java serialization, this is quite ugly and error prone. Whereas if you want to copy some relations from one place to another no transformations of any kind are necessary. |
|
Which rather highlights how the relational form is a logical form, and not a physical form. |
#47
| |||
| |||
|
|
On Nov 1, 7:23 am, Tegiri Nenashi <TegiriNena... (AT) gmail (DOT) com> wrote: On Oct 29, 7:06 pm, David BL <davi... (AT) iinet (DOT) net.au> wrote: The inappropriateness of the RM for ASTs is highlighted when we interpret tuples as propositions or facts. Consider the following expression (x + 1) * 3 In order to state the fact that this expression consists of the product of subexpressions '(x+1)' and '3', one must clearly assign names to the things about which we want to state facts. No wonder the RM forces us to go on a naming spree. And when you consider the above expression in the language theory you don't assign grammar symbols to each subexpression? In your example they clearly are: number : 1 | 3; expr : number | expr + expr | expr * expr | ( expr ); I don't understand your point. Naming grammar symbols is quite different from naming actual instances of subexpressions. Imagine how many names one would need in a large source code program. |
#48
| |||
| |||
|
|
David BL wrote: In the following I compare different techniques for representing an Abstract Syntax Tree (AST), concluding that RM is poorly suited. ... I could just as well say that your choice of application is poorly suited. From Wikepedia: "In computing, it is used in a parser as an intermediate between a parse tree and a data structure" To me, trying this is reminiscent of EAV attempts, ie., using the RM to give an "intermediate" implementation. Apart from "jobs for the boys", why would one want to? Surely the application here is the manipulation of the parse tree, not the AST. |
#49
| |||
| |||
|
|
Surely the application here is the manipulation of the parse tree, not the AST. |
#50
| |||
| |||
|
|
Marshall wrote: ... Your conception of the RM is too narrow. There is nothing in the RM that precludes nested structures, nor union types. By "union types", I presume you mean "unions of types that a db may use" and also that the RM doesn't preclude *nor define* unions of types except for unions of relation types as long as what some people call an identity function (IIRC) and others call an equality operator is provided, somehow, for the union type. |
![]() |
| Thread Tools | |
| Display Modes | |
| |