| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: choice of character for relational division
Marshall wrote:
> On Mar 31, 11:04 pm, Gene Wirchenko <g..._at_ocis.net> wrote:
>
>>"Marshall" <marshall.spi..._at_gmail.com> wrote: >> >>[snip] >> >> >>>So, if you had to choose an ascii character for >>>relational division, which one would you use >>>and why? >> >> I would not do so unless the meaning was fairly obvious, and it >>did not horribly overload the character.
>>Instead, I would pick a
>>three-or-so-letter name. ("mod" is used by some. ALGOL used "DIV"
>>and "REM".)
>> "|" is used a lot in one of my computing science classes. "|x|"
>>can mean the absolute value of x, or the size of x. "x|y" means that
>>x divides evenly into y. "|" is also used something like "such that",
>>as in {x | x>0}. I do not like this overloading.
I actually like set builder notation a lot for relations.
Compare the statement above to "division, '/', is a relation among attributes quotient, dividend and divisor where divisor is not zero". Except, for completeness one needs to include the domains of everything:
/: (quo, dend, sor |
quo in Q, dend in I, sor in I , sor != 0, dend = sor * quo
(I used quo for QUOtient, dend for diviDEND and sor for diviSOR.)
A similar (slightly more D'ish) alternative might be: /: {{quo in Q, dend in I, sor in I} | sor != 0, dend = quo * sor}
How do we decide what appears after the '|' ? For example, if we have a relation for the square root of integers, do we use:
sqrt: {{root in R, n in I} | n >= 0}
or do we use:
sqrt: {{root in R, n in W}} ?
(Some prefer N_0 for 'naturals including zero' over W for 'whole numbers'; substitute N_0 for W above if you prefer.)
Specialization by constraint would make both expressions equivalent. Which would we consider canonical?
We can use the above notation to express important invariants too:
*: {{ prod in I, cand in I, er in I} |
cand != 0 or prod = 0, er != 0 or prod = 0
, cand != 1 or prod = er, er != 1 or prod = cand
, exists({prod'=prod,cand'=er,er'=cand} in *)
, prod = SIGMA^er_1 cand
, prod = SIGMA^cand_1 er
(I used prod for PRODuct, cand for multipliCAND and er for multipliER.)
What then is the most effective way to express 'SIGMA' as a fold of '+'? And 'PI' as a fold of '*' ?
Is the 'exists' constraint above the best way to express commutativity? What about associativity and distributivitiy?
Do the 'better ways' you have found obviate the above questions? I am very interested to hear what you think those better ways are and how they improve the situation. Received on Mon Apr 02 2007 - 08:34:16 CDT
![]() |
![]() |