Questions on possreps

From: David BL <davidbl_at_iinet.net.au>
Date: Wed, 25 May 2011 21:04:57 -0700 (PDT)
Message-ID: <dfee5190-e76e-4c73-a5e9-e935c59956ba_at_j13g2000pro.googlegroups.com>



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?

  1. Is Date probably thinking that a floating point representation is in practise used for RATIONAL?
  2. 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?
  3. 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:
  4. since only certain rationals can be represented exactly, we are forced to represent most numbers only approximately.
  5. given that the operations are typically approximate, the results of calculation are typically approximate. Therefore the floats themselves are an approximation.
  6. 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.
  7. 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;

  1. 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"?
  2. 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?
  3. Does Date outlaw types which are uncountably infinite (because there is no representation with a finite encoding for every value)?
  4. 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?
  5. 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?
  6. 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?
Received on Thu May 26 2011 - 06:04:57 CEST

Original text of this message