Databases Reference
In-Depth Information
CONCLUDING REMARKS
I'd like to close this chapter by offering some observations that show that at least there's some
precedent for the idea that just because expressions exp1 and exp2 appear to be equivalent in
certain respects, it doesn't follow that they can be used completely interchangeably. Note,
however, that these remarks are something of a digression from our main topic, and you can skip
them if you like.
First of all, I want to make a general point: viz., I strongly suspect that what we're dealing
with here—viz., the issue of updating through “equivalent” expressions—is one of those
situation in which the logical difference between values and variables is significant. To be more
specific, there's a logical difference between an expression and a pseudovariable reference:
An expression denotes a value, a pseudovariable reference doesn't.
(See the very end of Chapter 2 if you need to refresh your memory regarding pseudovariables in
general, and recall from Chapter 3 that views act as pseudovariables as far as updates are
concerned.) In other words, an expression and a pseudovariable reference have very different
semantics, even if they're syntactically identical.
Next, I can recall several occasions in the past where thinking carefully about the logical
difference between values and variables led to an epiphany (or what I certainly thought of at the
time as an epiphany, anyway). One case in point has to do with the model of type inheritance
Hugh Darwen and I were developing, or trying to develop, as a logical consequence of the type
theory aspects of The Third Manifesto . We were struggling with the concept of what's known in
the world of object orientation (OO) as substitutability , which OO writings typically explain
thus:
If S is a subtype of T , then wherever the system expects an object of type T , an object of type S can be
substituted. 9
For example, if SQUARE is a subtype of RECTANGLE, then it should be possible to
substitute squares for rectangles in the foregoing kind of way, because squares are rectangles.
Taken at face value, however, this concept seems to give rise to all kinds of absurdities,
including squares that aren't square, circles that aren't circular, and other such solecisms
(contradictions in terms, really). 10 It was only when we realized that the OO term object
sometimes meant a variable and sometimes a value that we also realized that what we needed to
do was distinguish between variable substitutability and value substitutability—and it was
making that distinction that enabled us to avoid those OO solecisms. To be more specific, it was
making that distinction that led us to realize that certain expressions, though they might be
9 This definition, such as it is, is paraphrased from Wikipedia ( en.wikipedia.org ).
10 This criticism applies to SQL, incidentally.
Search WWH ::




Custom Search