Re: Abstract Data Types
Date: Sat, 21 Jul 2001 23:26:25 GMT
Message-ID: <slrn9h4oh9.67h.korek_at_lilia.lab.icm.edu.pl>
In article <9bt54b$mdk$1_at_news.tpi.pl>, Kazimierz Subieta wrote:
>> Just out of curiosity, wouldnt: >> >> Empty, Insert, Union, Intersection, Difference, Product, Join, Select and >> Project
>
> then: +, -, *, /, sum, avg, min, max, count, like, distinct, exists, order
> by... ?
> then: quentifiers, assignments, if...then...else, while...do...?
sum,avg,min,max,count,exists <= Reduce
+,-,*,/ <= to use it we need just Map(possibly Project first) on standard
ops in the (presumably)Real domain
I guess why you consider `while...do...' and assignments to belong
to relational ADT spec? (and what is it *really* needed for
> Unfortunately you are on a wrong way, for two reasons.
> First, some of you operations, e.g. select, are indexed by a predicate.
> Considering select an ADT operation it must have a predicate as an argument.
> Hence at least it is a second-order operator. If the predicate uses
> the other ADT operators, it means some unacceptable mix of language and
> metalanguage levels. Imagine this practically: you are a programmer
> who is trying to implement the select operator as a piece of a program.
> Your program takes the predicate text as a parameter, parses and
> compiles it, generates its code, executes and then discovers that
> this parameter refers to the select operator. Is such a recursion sound?
Usually such `recursions' are not real, e.g. can be eliminated (for _logical_ purposes) by doing finite number of Joins first, and computing on the result later on. And what is wrong with ADT whose operators have functional parameters(predicate is boolean function)? As a functional programmer I used them often.
> Unfortunately not.
> Gurus from the polymorphic programming languages camp sadly confess
> their polymorphisms are not sufficiently powerful to write e.g.
> generic procedures for join, select and other relational operators.
For currently used languages you are right. But that's because they are not usually used for DB programming. Type system for expressing join and record concatenation is perfectly feasible(ref: A.Ohori, P.Buneman "Type inference in a database programming language" 1988, but so many people reinvented similar systems for records, that interesting idea would be asking Type Theory student to generate such system "on the fly").
Greetings :-)
Michal Gajda
korek_at_icm.edu.pl
*knowledge-hungry student*
Received on Sun Jul 22 2001 - 01:26:25 CEST
