![]() | |
#1
| |||
| |||
|
#2
| |||||||||||||||||||||||
| |||||||||||||||||||||||
|
|
On page 116 of An Introduction to Database Systems (8th edition) Chris Date provides the following example: TYPE POINT POSSREP CARTESIAN { X RATIONAL, Y RATIONAL } POSSREP POLAR { R RATIONAL, THETA RATIONAL }; A footnote on that page states "Tutorial D uses the more accurate RATIONAL over the more familiar REAL". I find this quite confusing, hence the following questions: 1) In the opening paragraphs of section 5.3 which is where POSSREPs are described, the word 'representation' is often qualified by 'physical'. Is it correct to assume that a POSSREP is indeed a physical representation (and has nothing to do with declaring "logical representations" which is a term I've seen mentioned a few times on this news group)? |
|
2) Is it reasonable for me to assume a physical representation of type T means some unambiguously defined method for encoding values of type T on some physical medium? |
|
3) Is it correct that a POSSREP typically doesn't unambiguously define a method for encoding values of type T on some physical medium? |
|
4) Consider a POINT value is encoded in computer memory using a '\0' terminated ASCII string such as "(1.34,-6.2)", and must be parsed according to some well defined grammar in order to retrieve the x,y coordinates. Does this qualify as a CARTESIAN representation? |
|
5) Is it correct to say that in Tutorial D types are sometimes defined in terms of possreps? |
|
6) Date states that types are by definition abstract (i.e. type means Abstract Data Type). Can I assume by abstract he is referring to pure mathematical abstractions which are completely divorced from real world objects? If that is the case, is it not strange to define the abstract (like POINT) in terms of possible physical representations (like CARTESIAN or POLAR)? |
|
7) Is it true that the DDL doesn't separate out the abstractions from the physical representations, and therefore it is not possible to read the abstractions without being exposed to physical representation details? Is it true that software developers cannot extend or modify the physical representations without updating the definitions of the abstractions? |
|
8) In that same footnote mentioned above it is stated RATIONAL might be a built-in type with more than one declared possible representation. Can I assume RATIONAL is necessarily a type, and not a possrep? Are possreps allowed to reference other possreps? I would actually have thought it only makes sense to define a possrep in terms of other possreps. E.g. in an implementation language like C we may write struct Cartesian { float x,y; }; |
|
In this case, on a given platform, a particular representation of a geometrical point is unambiguously defined in terms of particular representations of numbers. If RATIONAL is a type what does it mean to define a physical representation CARTESIAN in terms of a pure abstraction RATIONAL? Does this mean Date thinks of POSSREPS as abstractions? |
|
9) Is it correct to assume that in this usage of RATIONAL it is not meant to be associated with a TYPE/POSSREP which has the purpose of representing rationals exactly using a pair of "big integers" as long as memory is not exhausted, since such a type would not normally support the operators such as SQRT, SIN, COS and ARCTAN which appear on pages 117,118 and typically return irrationals? |
|
10) Is Date probably thinking that a floating point representation is in practise used for RATIONAL? |
|
11) Does the footnote imply Date assumes that floating point numbers should be regarded as representing certain rationals exactly and only thinks of the operators as approximate? |
|
12) Am I correct in thinking that Date should instead think of floats as an approximate representation of the reals? My reasons for thinking this are: |
|
a) since only certain rationals can be represented exactly, we are forced to represent most numbers only approximately. |
|
b) given that the operations are typically approximate, the results of calculation are typically approximate. Therefore the floats themselves are an approximation. |
|
c) the abstract operators such as exp,log,sqrt,sin,cos,tan are unary operators on the reals, so it makes little sense to implement them for floating point numbers and yet regard floats as approximations to rationals. |
|
13) Is it appropriate for assumptions about types employed in POSSREP declarations to be visible in the signatures of the operators at the logical level of discourse? For example, that the return type of THE_X is RATIONAL: OPERATOR THE_X ( P POINT ) RETURNS RATIONAL; |
|
14) Is there a requirement that each possrep be complete (meaning it can represent all possible values of the given type)? I note that on page 606 it states "Part of the definition of any given type is a specification of the set of all legal values of that type". Is it assumed this specification normally comes implicitly from one or more possreps, and is this a reason that on page 115 it is stated "... we do require that values of type T have at least one possible representation"? |
|
15) Does Date assume that the set of legal values of type POINT is well defined? What does that mean if floats are used, thought of as representing certain rationals exactly but exact conversions between the two representations don't generally exist? |
|
16) Does Date outlaw types which are uncountably infinite (because there is no representation with a finite encoding for every value)? |
|
17) Why are only some operators called "selectors"? I would have thought this distinction only arises from physical implementation concerns. Is it not true that at an abstract level any operator that returns values of type T can be regarded as a means of selecting values of type T? |
|
18) On page 606 it is stated "The physical representation of such values is always hidden from the user" and in the same paragraph "each type has at least one possible representation that is explicitly exposed to the user". How does one reconcile these apparently contradictory statements? What is Date saying exactly? |
|
19) Can the definition of nonscalar be formalised? What is meant precisely by "user visible, directly accessible components"? Why isn't a POINT a nonscalar given that user access is provided to X,Y,R,THETA through operators such as THE_X? On the topic of physical representations Date states "... they can certainly have components - but ... any such components will be hidden from the user". What does he mean by hidden? Since tuple and relation types have physical representations why doesn't Date's latter statement apply to them as well? |
#3
| |||||||||||||||||
| |||||||||||||||||
|
|
On 2011-05-26, David BL <davi... (AT) iinet (DOT) net.au> wrote: On page 116 of An Introduction to Database Systems (8th edition) Chris Date provides the following example: TYPE POINT POSSREP CARTESIAN { X RATIONAL, Y RATIONAL } POSSREP POLAR { R RATIONAL, THETA RATIONAL }; A footnote on that page states "Tutorial D uses the more accurate RATIONAL over the more familiar REAL". I find this quite confusing, hence the following questions: 1) In the opening paragraphs of section 5.3 which is where POSSREPs are described, the word 'representation' is often qualified by 'physical'. Is it correct to assume that a POSSREP is indeed a physical representation (and has nothing to do with declaring "logical representations" which is a term I've seen mentioned a few times on this news group)? No. A possible representation is a possible representation. Some of them may be capable of a physical implementation. |
|
3) Is it correct that a POSSREP typically doesn't unambiguously define a method for encoding values of type T on some physical medium? A POSSREP may or may not unambiguously define (either directly or indirectly) a method for encoding values of type T on some physical medium. |
|
4) Consider a POINT value is encoded in computer memory using a '\0' terminated ASCII string such as "(1.34,-6.2)", and must be parsed according to some well defined grammar in order to retrieve the x,y coordinates. Does this qualify as a CARTESIAN representation? It is a possible representation of a POINT value which does correspond to the mathematical term "Cartesian". However, CARTESIAN in the type definition you quote is merely an arbitrary name for the POSSREP. It just happens to have been chosen to remind us of the mathematical term. Since your question refers to the name rather than the mathematical term, it is meaningless. |
|
6) Date states that types are by definition abstract (i.e. type means Abstract Data Type). Can I assume by abstract he is referring to pure mathematical abstractions which are completely divorced from real world objects? If that is the case, is it not strange to define the abstract (like POINT) in terms of possible physical representations (like CARTESIAN or POLAR)? Yes. No. In that order. POINT is not defined in terms of physical representations. It merely specifies that any implementation should be capable of accepting or returning two values of type RATIONAL which correspond to one of the two named POSSREPS. It is merely a convenience for both user and implementer that the possreps are named after the mathematical concepts that are intended to be used. |
|
7) Is it true that the DDL doesn't separate out the abstractions from the physical representations, and therefore it is not possible to read the abstractions without being exposed to physical representation details? Is it true that software developers cannot extend or modify the physical representations without updating the definitions of the abstractions? No and no. All that matters is that any implementation of the type uses some valid physical representation and provides a suitable interface to the declared possible representations. |
|
8) In that same footnote mentioned above it is stated RATIONAL might be a built-in type with more than one declared possible representation. Can I assume RATIONAL is necessarily a type, and not a possrep? Are possreps allowed to reference other possreps? I would actually have thought it only makes sense to define a possrep in terms of other possreps. E.g. in an implementation language like C we may write struct Cartesian { float x,y; }; Yes and yes. In this case, on a given platform, a particular representation of a geometrical point is unambiguously defined in terms of particular representations of numbers. If RATIONAL is a type what does it mean to define a physical representation CARTESIAN in terms of a pure abstraction RATIONAL? Does this mean Date thinks of POSSREPS as abstractions? CARTESIAN is not a physical representation, though a physical representation of a POINT may use two instances of a physical representation of a RATIONAL in such a way that they should be interpreted as Cartesian co-ordinates in the mathematical sense. |
|
And I assume that he does. |
|
11) Does the footnote imply Date assumes that floating point numbers should be regarded as representing certain rationals exactly and only thinks of the operators as approximate? The footnote is referring to the accuracy of the use of terminology, rather that the accuracy of physical representations of any type of number in a computer. |
|
12) Am I correct in thinking that Date should instead think of floats as an approximate representation of the reals? My reasons for thinking this are: Instead? - definitely not! But without that word you are correct. |
|
13) Is it appropriate for assumptions about types employed in POSSREP declarations to be visible in the signatures of the operators at the logical level of discourse? For example, that the return type of THE_X is RATIONAL: OPERATOR THE_X ( P POINT ) RETURNS RATIONAL; THE_X returns a RATIONAL because it is the normal way to return a component of one particular POSSREP. This is exactly and perfectly appropriate. As an operator it is dependent on the specification of the POSSREP. At the logical level, this has nothing to do with operators on POINTS. |
|
14) Is there a requirement that each possrep be complete (meaning it can represent all possible values of the given type)? I note that on page 606 it states "Part of the definition of any given type is a specification of the set of all legal values of that type". Is it assumed this specification normally comes implicitly from one or more possreps, and is this a reason that on page 115 it is stated "... we do require that values of type T have at least one possible representation"? Yes, to an acceptable level of approximation if approximation will be necessary. Then yes (you cannot make a specification without some representation to use in the rules of the specification) and then no. Of course a type with no representation is not really very useful. |
|
15) Does Date assume that the set of legal values of type POINT is well defined? What does that mean if floats are used, thought of as representing certain rationals exactly but exact conversions between the two representations don't generally exist? Yes. There is no problem with a representation that requires approximation as long as this is stated, and as long as the expected accuracy is also stated. |
|
16) Does Date outlaw types which are uncountably infinite (because there is no representation with a finite encoding for every value)? Of course not, why would anyone do that? |
|
17) Why are only some operators called "selectors"? I would have thought this distinction only arises from physical implementation concerns. Is it not true that at an abstract level any operator that returns values of type T can be regarded as a means of selecting values of type T? "The parameters to a given selector S constitute - necessarily - a possible representation for <values of> the <type>." What some might refer to as a "constructor", but which does not "construct" a value but rather selects one of the members of the set of all possible values of the type. |
|
18) On page 606 it is stated "The physical representation of such values is always hidden from the user" and in the same paragraph "each type has at least one possible representation that is explicitly exposed to the user". How does one reconcile these apparently contradictory statements? What is Date saying exactly? That the physical representation used within the implementation need not be the same as any possible representation made available to the user, and that the user is not entitled to make any assumptions about a type and its values based on the physical representation that happens to be used. |
|
19) Can the definition of nonscalar be formalised? What is meant precisely by "user visible, directly accessible components"? Why isn't a POINT a nonscalar given that user access is provided to X,Y,R,THETA through operators such as THE_X? On the topic of physical representations Date states "... they can certainly have components - but ... any such components will be hidden from the user". What does he mean by hidden? Since tuple and relation types have physical representations why doesn't Date's latter statement apply to them as well? A scalar is a single value of a single type. That there may be operators which return other values of other types by operating on a scalar is not relevant, those operators are simply part of the definition of the type. |
|
How can you have missed the entire point that it is essential to design the logical model of your objects of interest without any consideration of the strange tricks that the implementer had to use to produce a working and reasonably efficient system to process your and other peoples logical models? |
#4
| |||
| |||
|
|
On May 27, 6:55 am, Eric <e... (AT) deptj (DOT) eu> wrote: On 2011-05-26, David BL <davi... (AT) iinet (DOT) net.au> wrote: 16) Does Date outlaw types which are uncountably infinite (because there is no representation with a finite encoding for every value)? Of course not, why would anyone do that? I would! The reals are clearly the most appropriate abstraction of numbers in computational geometry applications. |
#5
| |||
| |||
|
|
On May 27, 2:27 pm, David BL <davi... (AT) iinet (DOT) net.au> wrote: On May 27, 6:55 am, Eric <e... (AT) deptj (DOT) eu> wrote: On 2011-05-26, David BL <davi... (AT) iinet (DOT) net.au> wrote: 16) Does Date outlaw types which are uncountably infinite (because there is no representation with a finite encoding for every value)? Of course not, why would anyone do that? I would! The reals are clearly the most appropriate abstraction of numbers in computational geometry applications. Sorry, I somehow managed to look at "why would anyone do that?" and saw "why would anyone define an uncountable type", and then forget how I actually posed my question. Ok, we agree there is no reason to outlaw uncountably infinite types. BTW I'm sure I've read posts on this group that suggest uncountable types are inappropriate in database theory. I think Jan Hidders has made comments along those lines, defining "value of type" as something capable of finite representation (I hope I'm not misrepresenting what he's said). |
#6
| ||||||||||||||||||
| ||||||||||||||||||
|
|
On page 116 of An Introduction to Database Systems (8th edition) Chris Date provides the following example: * * TYPE POINT * * * * POSSREP CARTESIAN { X RATIONAL, Y RATIONAL } * * * * POSSREP POLAR { R RATIONAL, THETA RATIONAL }; A footnote on that page states "Tutorial D uses the more accurate RATIONAL over the more familiar REAL". I find this quite confusing, hence the following questions: 1) In the opening paragraphs of section 5.3 which is where POSSREPs are described, the word 'representation' is often qualified by 'physical'. Is it correct to assume that a POSSREP is indeed a physical representation (and has nothing to do with declaring "logical representations" which is a term I've seen mentioned a few times on this news group)? |
|
2) Is it reasonable for me to assume a physical representation of type T means some unambiguously defined method for encoding values of type T on some physical medium? |
|
3) Is it correct that a POSSREP typically doesn't unambiguously define a method for encoding values of type T on some physical medium? |
|
4) Consider a POINT value is encoded in computer memory using a '\0' terminated ASCII string such as "(1.34,-6.2)", and must be parsed according to some well defined grammar in order to retrieve the x,y coordinates. Does this qualify as a CARTESIAN representation? |
|
5) Is it correct to say that in Tutorial D types are sometimes defined in terms of possreps? |
|
6) Date states that types are by definition abstract (i.e. type means Abstract Data Type). *Can I assume by abstract he is referring to pure mathematical abstractions which are completely divorced from real world objects? If that is the case, is it not strange to define the abstract (like POINT) in terms of possible physical representations (like CARTESIAN or POLAR)? |
|
7) Is it true that the DDL doesn't separate out the abstractions from the physical representations, and therefore it is not possible to read the abstractions without being exposed to physical representation details? *Is it true that software developers cannot extend or modify the physical representations without updating the definitions of the abstractions? |
|
8) In that same footnote mentioned above it is stated RATIONAL might be a built-in type with more than one declared possible representation. *Can I assume RATIONAL is necessarily a type, and not a possrep? *Are possreps allowed to reference other possreps? *I would actually have thought it only makes sense to define a possrep in terms of other possreps. *E.g. in an implementation language like C we may write * * struct Cartesian { float x,y; }; In this case, on a given platform, a particular representation of a geometrical point is unambiguously defined in terms of particular representations of numbers. *If RATIONAL is a type what does it mean to define a physical representation CARTESIAN in terms of a pure abstraction RATIONAL? *Does this mean Date thinks of POSSREPS as abstractions? |
|
9) Is it correct to assume that in this usage of RATIONAL it is not meant to be associated with a TYPE/POSSREP which has the purpose of representing rationals exactly using a pair of "big integers" as long as memory is not exhausted, since such a type would not normally support the operators such as SQRT, SIN, COS and ARCTAN which appear on pages 117,118 and typically return irrationals? |
|
10) Is Date probably thinking that a floating point representation is in practise used for RATIONAL? 11) Does the footnote imply Date assumes that floating point numbers should be regarded as representing certain rationals exactly and only thinks of the operators as approximate? |
|
12) Am I correct in thinking that Date should instead think of floats as an approximate representation of the reals? *My reasons for thinking this are: * a) since only certain rationals can be represented exactly, we are forced * * *to represent most numbers only approximately. * b) given that the operations are typically approximate, the results of * * *calculation are typically approximate. *Therefore the floats * * *themselves are an approximation. * c) the abstract operators such as exp,log,sqrt,sin,cos,tan are unary * * *operators on the reals, so it makes little sense to implement them for * * *floating point numbers and yet regard floats as approximations to * * *rationals. |
|
13) Is it appropriate for assumptions about types employed in POSSREP declarations to be visible in the signatures of the operators at the logical level of discourse? *For example, that the return type of THE_X is RATIONAL: * * OPERATOR THE_X ( P POINT ) RETURNS RATIONAL; |
|
14) Is there a requirement that each possrep be complete (meaning it can represent all possible values of the given type)? *I note that on page 606 it states "Part of the definition of any given type is a specification of the set of all legal values of that type". *Is it assumed this specification normally comes implicitly from one or more possreps, and is this a reason that on page 115 it is stated "... we do require that values of type T have at least one possible representation"? |
|
15) Does Date assume that the set of legal values of type POINT is well defined? *What does that mean if floats are used, thought of as representing certain rationals exactly but exact conversions between the two representations don't generally exist? |
|
16) Does Date outlaw types which are uncountably infinite (because there is no representation with a finite encoding for every value)? |
|
17) Why are only some operators called "selectors"? *I would have thought this distinction only arises from physical implementation concerns. *Is it not true that at an abstract level any operator that returns values of type T can be regarded as a means of selecting values of type T? |
|
18) On page 606 it is stated "The physical representation of such values is always hidden from the user" and in the same paragraph "each type has at least one possible representation that is explicitly exposed to the user". *How does one reconcile these apparently contradictory statements? *What is Date saying exactly? |
|
19) Can the definition of nonscalar be formalised? *What is meant precisely by "user visible, directly accessible components"? *Why isn't a POINT a nonscalar given that user access is provided to X,Y,R,THETA through operators such as THE_X? * On the topic of physical representations Date states "... they can certainly have components - but ... any such components will be hidden from the user". *What does he mean by hidden? *Since tuple and relation types have physical representations why doesn't Date's latter statement apply to them as well? |
#7
| |||
| |||
|
|
On May 27, 6:55 am, Eric <e... (AT) deptj (DOT) eu> wrote: On 2011-05-26, David BL <davi... (AT) iinet (DOT) net.au> wrote: On page 116 of An Introduction to Database Systems (8th edition) Chris Date provides the following example: TYPE POINT POSSREP CARTESIAN { X RATIONAL, Y RATIONAL } POSSREP POLAR { R RATIONAL, THETA RATIONAL }; A footnote on that page states "Tutorial D uses the more accurate RATIONAL over the more familiar REAL". I find this quite confusing, hence the following questions: Questions, answers, and subsequent responses snipped, everything is too |
#8
| |||
| |||
|
|
Haven't gone through the other responses first, perhaps I should have, but anyway here goes (see inlined answers) : If yours had turned up first, I would have written much less in mine |
#9
| |||||
| |||||
|
|
On 2011-05-27, David BL <davi... (AT) iinet (DOT) net.au> wrote:> On May 27, 6:55 am, Eric <e... (AT) deptj (DOT) eu> wrote: On 2011-05-26, David BL <davi... (AT) iinet (DOT) net.au> wrote: On page 116 of An Introduction to Database Systems (8th edition) Chris Date provides the following example: TYPE POINT POSSREP CARTESIAN { X RATIONAL, Y RATIONAL } POSSREP POLAR { R RATIONAL, THETA RATIONAL }; A footnote on that page states "Tutorial D uses the more accurate RATIONAL over the more familiar REAL". I find this quite confusing, hence the following questions: Questions, answers, and subsequent responses snipped, everything is too interconnected for point by point answers to be sensible now. 1. Even though the real/rational thing seems to have been your main point, I want to ignore it for the moment. I believe that Date used "RATIONAL" to be consistent with somewhere else, then felt it would be questioned, so he added the footnote. So can we say that the declared POSSREPS for POINT contain numbers of a suitable type and leave the choice of type as a separate argument. 2. The logical model contains some types and operators sufficient for what we actually want to do with our model. 3. The "suitable number type" is not part of this logical model, because nothing is defined in terms of it, it is only used in some possible representations. |
|
4. A POINT is a scalar because it is not defined in terms of any other type in the model. |
|
5. The model is abstract because we could change the names of all the types and it would still be a logically consistent system. 6. A POSSREP is equally abstract. All it does is specify a set of values of certain types such that distinct sets of values correspond to a unique value of the type having the POSSREP, and vice-versa. The types used in the POSSREP need not be either defined or used in the logical model. |
|
7. There are two mappings of the logical model. The first is to objects and actions in the real world. The names of types and operators in the model are part of this mapping, as are the names and details of any POSSREPS. 8. The second is to the top layer of the implementation of the system which we use to "run" the model. Beyond this mapping is the only place physical representations come into it. |
|
In spite of what you say I suspect that you are sometimes crossing the boundary between logical and physical. I also think you are causing complications by wanting "abstract" to mean "completely mathematically abstract". |
#10
| ||||
| ||||
|
|
Haven't gone through the other responses first, perhaps I should have, but anyway here goes (see inlined answers) : On 26 mei, 06:04, David BL <davi... (AT) iinet (DOT) net.au> wrote: 3) Is it correct that a POSSREP typically doesn't unambiguously define a method for encoding values of type T on some physical medium? The POSSREPs as defined in the TTM literature have nothing to do with physical encoding. 4) Consider a POINT value is encoded in computer memory using a '\0' terminated ASCII string such as "(1.34,-6.2)", and must be parsed according to some well defined grammar in order to retrieve the x,y coordinates. Does this qualify as a CARTESIAN representation? It could qualify as a valid POSSREP for the POINT type, but it is a different one from the CARTESIAN possrep typically used in Date&Darwen's relational writings. |
|
5) Is it correct to say that in Tutorial D types are sometimes defined in terms of possreps? Yes. In fact this holds for all of them, except then the "basic" ones such as INTEGER, BOOLEAN, ... |
|
13) Is it appropriate for assumptions about types employed in POSSREP declarations to be visible in the signatures of the operators at the logical level of discourse? For example, that the return type of THE_X is RATIONAL: OPERATOR THE_X ( P POINT ) RETURNS RATIONAL; Don't see a problem. This operator coming into existence is a direct consequence of the fact that POINT is declared to have an X component of type RATIONAL in one of its declared possreps. So it's a direct consequence of the type definition, which is itself also at the logical level of discourse, no ? |
|
17) Why are only some operators called "selectors"? I would have thought this distinction only arises from physical implementation concerns. Is it not true that at an abstract level any operator that returns values of type T can be regarded as a means of selecting values of type T? You're right. The term was probably introduced to be able to speak of "operators" in general, instead of having to continuously say "operators and/or literals". Just like OO texts might want to talk of "methods" in general, rather than "methods and/or constructors". (Note that literals and selectors are not the same thing. All literals are selectors, but not all value selectors are literals. Literals are value selectors with no arguments, while there might be other value selectors that do take arguments. But the term "value selector" is restricted to those cases where the arguments match the POSSREP declaration : VAR RATIONAL X,Y; VAR POINT P = CARTESIAN(X,Y); /* this is a value selector but not a literal */ P = SHIFTHORZ(P, 2); /* allthough SHIFTHORZ returns a POINT value, and must thus itself _contain_ a POINT value selector, SHITHORZ itself is not a "value selector" */ |
![]() |
| Thread Tools | |
| Display Modes | |
| |