A Query Language for NC - CiteSeerX

2 downloads 0 Views 302KB Size Report
databases, Grumbach and Vianu GV91b, GV91a] give a syntactic restriction of the ...... Kevin L. Compton and Claude La amme. An algebra and a logic for NC.
A Query Language for NC Val Breazu-Tannen

Dan Suciu

University of Pennsylvania [email protected]

University of Pennsylvania [email protected]

Abstract

of at relations that are NC -computable. We also show that a bounded version of dcr together with the We show that a form of divide and conquer recursion nested relational algebra expresses exactly the queries on sets together with the relational algebra expresses over ordered databases of complex objects that are exactly the queries over ordered relational databases NC -computable. In fact, we prove the more re ned which are NC -computable. At a ner level, we relate versions that relate k nested uses of (bounded) dcr k nested uses of recursion exactly to AC k , k  1. We exactly to the subclass AC k of NC where k  1 (de also give corresponding results for complex objects. nitions are reviewed in section 4). Some explanations are in order: - Computable queries are in the sense of Chandra and Harel [CH80], with a natural extension to NC is the complexity class of functions that are com- complex objects (section 5). - Any language that can express the class of queries putable in polylogarithmic time with polynomially expressed by rst-order logic would do just as well as many processors on a parallel random access machine the relational algebra. Similarly for complex objects, (PRAM). The query language for NC discussed here where a corresponding class of tractable queries has is centered around a divide and conquer recursion emerged from several equivalent formalisms. Some of (dcr ) on sets which has obvious potential for parallel these formalisms are syntactically restricted higherevaluation and can easily express, for example, tranorder logics, others are algebraic languages, often called sitive closure and parity. dcr with parameters e; f; u nested relational algebras, hence our phrasing above. de nes the unique function ' = dcr (e; f; u) such that: In fact, we will use the family of query languages introduced in [BBW92] because it is semantically re'(;) def = e lated to dcr (section 3). '(fyg) def = f (y) - dcr and (nested) relational algebra have meaning any (nested) relational database. But, as with all '(s1 [ s2 ) def = u('(s1 ); '(s2 )) when s1 \ s2 = ; over known characterizations of query complexity classes below NP , we know how to capture the entire NC For parity, we take e def = false , f (y) def = true and only over ordered databases. Formally, we do this by u(v1 ; v2 ) def = v1 xor v2 . To compute the transitive extending the language with an order predicate. - A bounded version of dcr is necessary over comclosure of some binary relation r, take e def = ;, f (y) def = def plex objects, otherwise queries of high complexity r and u(r1 ; r2 ) = r1 [ r2 [ r1  r2 . Then, the transitive such as powerset will be expressible. The bounded closure of r is obtained by applying ' to the set of version is obtained by intersecting the result with a nodes of the relation r, namely tc(r) = '(1 (r) [ bounding set at each recursion step (section 2). This 2 (r)), where 1 ; 2 are the relational projections. is similar to the bounded xpoints studied in [Suc94], In general, dcr (e; f; u) is well-de ned when there is and, as with xpoints, over at relations dcr can alsome set containing e and the range of f , on which ways be expressed through bounded dcr (section 2). u is associative, commutative and has the identity We believe that these results are of interest from e. For parity, this is the set B of booleans, while for two angles. 2 n transitive closure, it is the set fr [r [: : :[r j n  0g. \ Query language design. dcr is a well-known We show that dcr together with the relational alconstruct. It appears under the name pump, in a gebra expresses exactly the queries over ordered databases language speci cally designed for a parallel database  The authors were partially supported by NSF Grant CCRmachine, FAD [BBKV87]. Following FAD, but under

1 Introduction

90-57570 and ONR Contract NOOO14-93-11284

1

the name hom, it was included in Machiavelli [OBB89] tions or recursion depth. Moreover, it can be shown where it t nicely into the language's type system. that a di erent kind of recursion on sets, namely Called (a form of) transducer, it is part of SVP [PSV92], structural recursion on the insert presentation of sets precisely in order to support divide and conquer par- ([BTS91]; notation sri ; de nitions reviewed in secallelism. Some limitations of its theoretical expres- tion 2), together with the relational algebra expresses sive power were examined (under the name hom ) by exactly the PTIME -computable queries on ordered Immerman, Patnaik, and Stemple ([IPS91] theorem databases1. This follows from results in [IPS91]; we 7.8). They also note that dcr is in NC . state the corresponding result for complex objects in As part of a larger group of researchers, we be- proposition 6.6. Hence, at least over ordered databases, came interested in dcr because it ts into a natural the di erence between NC and PTIME boils down hierarchy of query languages that share a common se- to two di erent ways of recurring on sets, divide and mantic basis, built around forms of structural recur- conquer vs. element by element. sion on collection types [BTS91, BTBN91, BBW92] Gurevich [Gur83] and Compton and La amme [CL90] (see section 2). Theoretical studies of expressiveness, characterize the DLOGSPACE - and respectively the such as [Won93, BTBN91, Suc94] and the present pa- NC 1 -computable global functions on nite and orper help us with the choice and mix of primitives, as dered relational structures as algebras with certain well as implementation strategies. In particular, dcr primitive recursion schemas. Compton and La amme is at the core of a sublanguage for which we are cur- capture NC 1 also with rst-order logic augmented rently seeking ecient implementation techniques for with BIT 2 . and with an operator for de ning rea variety of parallel architectures. lations by primitive recursion. The kinds of recur\ Computational complexity. Following Vardi sions used in these two papers are very di erent from and Immerman's in uential result [Var82, Imm86] dcr because they depend on some linear ordering of that rst-order logic with least xed point captures the underlying structures for their actual de nition. exactly the PTIME -computable queries on at re- While dcr is a form of recursion on nite sets, these lations over ordered databases, several characteriza- recursions are on notations for elements of (linearly tions of low complexity classes in terms of logics or ordered) nite sets. Of course, we do not attempt algebras used in databases have been discovered with to characterize DLOGSPACE or NC 1 or, for that the hope that logical methods may give insights into matter, any class below AC 1 , but see Immerman's the dicult problem of complexity class separation. characterizations of such classes in terms of languages We mention rst a few of these characterizations which more in the spirit of ours than of those of Gurevich, have had a direct in uence on the work here. Compton, and La amme [Imm87b, Imm87a]. For parallel complexity classes, Immerman [Imm89] We should also mention here the work of Clote [Clo90] shows that the class of nite and ordered relational for related characterizations of most parallel comstructures recognizable in parallel time t(n) (n is the plexity classes of arithmetical functions. Also of resize of the structure) on a certain CRCW (concur- lated interest, but in a di erent direction, is the work rent read - concurrent write) PRAM coincides with of Denningho and Vianu [DV91] who characterize the class of structures de nable by a rst-order induc- NC in terms of a resource-restricted message-passing tion [Mos74] of depth up to t(n). For complex object model with parallel semantics which computes objectdatabases, Grumbach and Vianu [GV91b, GV91a] oriented queries. give a syntactic restriction of the rami ed higherWe should point out, however, one sense in which order logic CALC which, together with in ationary our language is not as neat as, say, rst-order logic xpoints and in the presence of order, captures ex- with least xpoint, which captures PTIME in the actly the PTIME -computable complex-object queries. presence of order, or rst-order logic with transitive Suciu [Suc94] shows that, in the presence of order, the closure, which captures NLOGSPACE in the pressame class of queries is captured by the nested rela- ence of order. For dcr to be well-de ned, the optional algebra augmented with an in ationary bounded erations involved in it must satisfy certain algebraic xpoint operator. identities (associativity, commutativity, identity) and To the best of our knowledge, no characterization this turns out to be an undecidable condition (in fact of parallel complexity classes of queries over complex 01 complete; see section 2). Of course, only a certain objects has been given before. What is more likely family of instances of dcr is actually needed in the to set our results apart, however, is the intrinsic na- simulations, and for these, the algebraic conditions ture of the language we are proposing: the semantics 1 course, so does least xpoint recursion, for example, of dcr puts it naturally in NC ; there is no need to but Of it is not a recursion on sets. 2 A relation giving the binary representation of integers. impose logarithmic bounds on the number of itera2

form fsg, with s a product of base types (D ; B ; unit ), are called at types. We will also need to consider function types having the form s ! t, where s and t are complex object types 4 . There seem to be two basic ways of describing the structure of nite sets. In one way, they are generated by nitely many (maybe zero!) binary unions of singleton sets. We call this the union presentation. In another way, they are generated by nitely many insertions of one element, starting with the empty set. We call this the insert presentation. Recognizing the relevant algebraic identities satis ed by union (associativity, commutativity, idempotence, has ; as an identity) and by element insertion (icommutativity and i-idempotence) gives us two different algebraic structures on nite sets. Both these algebras are characterized by universality properties, which amount to de nitions of functions by structural recursion [BTS91, BTBN91]. We have a structural recursion construct on the union presentation, sru : e:t f :s!t u:tt!t sru (e; f; u) : fsg ! t

always hold (proposition 7.3). Hence, it is of theoretical interest that there is a decidable sublanguage of dcr plus relational algebra which captures exactly NC in the presence of order. In practice, we have found it useful to provide special syntax for some instances of dcr in which the algebraic conditions are automatically satis ed, but we found it counterproductive to limit dcr to these instances, as other uses kept appearing. This paper is organized as follows. Section 2 introduces four di erent forms of recursions over sets (one of which is dcr ) and establishes the relationships between them, then de nes bounded versions of recursion on sets, which are necessary for controlling complexity when we work with nested sets. It also brie y discusses the undecidability of the wellde nedness of the dcr construct. Section 3 gives precise de nitions of the languages we show equivalent to NC, over complex objects and at relations respectively. We brie y review the parallel complexity classes AC k and NC in section 4, and extend them to classes of queries in section 5. The main results are stated and discussed in section 6. Finally, we sketch the proofs of the main results in section 7.

sru (e; f; u)(;) def = e def sru (e; f; u)(fyg) = f (y) sru (e; f; u)(s1 [ s2 ) def = u(sru (e; f; u)(s1 ); sru (e; f; u)(s2 ))

2 Recursion on Sets A fruitful approach to the design of query languages for complex objects is to consider tuples and sets as orthogonal [BTBN91, BBW92]. Hence, there will be primitives that work on tuples, primitives that work on sets, and general primitives for combining other primitives. In this section we discuss four forms of recursion on sets (two of which are structural recursions) and the relationship between them. One of these forms of recursion|dcr |will be at the core of our \query languages for NC ". A precise de nition of the languages will be given in section 3. However, we already need to refer in this section to some bits and pieces of the language for complex objects, notably to its type system, de ned as follows. Complex objects are built essentially from tuples and nite sets. To describe them, we de ne the complex object types by the grammar:

sru (e; f; u) is well-de ned when there is some subset of t containing e and the range of f , on which u is associative, commutative, idempotent, and has the identity e. We also have a structural recursion construct on the insert presentation, sri (x^/ s is the element insertion operation, fxg [ s): e:t i:st! t sri (e; i) : fsg ! t sri (e; i)(;) sri (e; i)(y^/ s)

= e = i(y; sri (e; i)(s))

def def

sri (e; i) is well-de ned when there is some subset of t containing e on which i is i-commutative, i(x; i(y; s)) = i(y; i(x; s)), and i-idempotent i(x; i(x; s)) = i(x; s). where D is some base type, B is the type of booleans 3 In addition to sru and sri we consider two other and unit is the type containing only the empty tuple forms of recursion on sets. One of them is dcr whose (unit = f()g). The values of type s  t are pairs 4 that we never make use of functions that take func(x; y) with x 2 s; y 2 t, and the values of type ftg are tionsNote as arguments. Thus, as a functional language, our lan nite sets of elements from t. Products of types of the guage is rst-order. Of course, as a set-theoretic language, the

t def =

3

D

j B j unit j t  t j ftg

Not really necessary, could have been encoded as language is higher-order since it manipulates complex objects. [BBW92].

funit g

3

(here (u \ b)(y; y0) def = u(y; y0) \ b, etc). As for dcr , we de ne the bounded sri , bsri (e; i; b), for some PStype t, to be sri (e \ b; i \ b). Proposition 2.1 easily extends to the bounded versions of recursion. Over

at relations the explicit bounding is unnecessary: Proposition 2.2 bdcr together with the relational algebra can express dcr when its arguments are at relations and its values are of at PS-type. Similarly for bsri and sri. What is the role played by the algebraic conditions such as associativity etc., that are required for the constructs presented above that perform recursion on sets? Immerman, Patnaik, and Stemple [IPS91] esr (e; i)(y^/ s) def = i(y; esr (e; i)(s)) when y 62 s consider under the name set-reduce a form of recurwhere i is required to be i-commutative (but not nec- sion on sets which resembles somewhat sri , but whose essarily i-idempotent). Obviously, esr can express sri de nition relies on the existence of a linear order5 . The non-immediate relationships between the four ing. Essentially,defa function f may be de ned by: f (fx1 ; : : : ; xn g) = i(x1 ; f (fx2 ; : : : ; xn g)), provided forms of recursion on sets are contained in: that x1 < x2 < : : : < xn (no conditions are imProposition 2.1 sri can express sru [BTS91]. Sim- posed on i): we can prove that, in the presence of ilarly esr can express dcr. Moreover, sri can express order, this form of recursion has the same expressive esr [BT92]. All these are done with at most polyno- power as sri . Similarly, one can conceive a form of mial overhead. divide and conquer recursion that relies on the ordering, which allows us to de ne some function by Proof. f (fx1 ; : : : ; xn g) def = u(f (fx1 ; : : : ; x 2 g); f (fx 2 +1 ; : : : ; xn g)) def (no conditions are imposed on u): again, we can dcr (e; f; u) = esr (e; (x; y):u(f (x); y)) prove that this form of recursion has the same exesr (e; i) def = 2 (sri ((;; e); (x; (s; y)): if x 2 s pressive power as dcr . In contrasts, the algebraic then (s; y) else (x^/ s; i(x; y)))) conditions, besides the fact that they arise from principled mathematical characterizations of nite sets, 2 provide us with an elegant alternative for ensuring One can easily see that over complex objects dcr the well-de nedness of various forms of recursion on (and even sru ) can express powerset hence we need sets. Unfortunately, for a language at least as exsome restriction if we are to stay within NC . An ana- pressive as rst-order logic, verifying most of these log to Peter Buneman's idea of bounded xpoints [Suc94]identities is as hard as testing the validity of a rstdoes the job. We de ne a PS-type (product of sets order formula in all nite models, hence it is a 01 type) to be either a set type, or a product of PS- complete question. For example, consider u(x; y) def = types. Then, the bounded version of dcr is de ned if p then u1 (x; y) else u2(x; y), where u1 is some by: associative, commutative operation (e.g. u1 (x; y) = x [ y), while u2 is not (e.g. u2 (x; y) = x ? y), and e:t f :s!t u:tt!t b:t p is some arbitrary predicate (independent on x; y). bdcr (e; f; u; b) : fsg ! t Then u is associative, commutative i p is true. (See where t is a PS-type, with the semantics: also [Sar92] for forms of recursion on sets that are at least as powerful as Datalog and [BTS91] for strucbdcr (e; f; u; b) def = dcr (e \ b; f \ b; u \ b) tural recursion on lists and bags.)

de nition was already given in section 1. dcr is super cially related to sru , for example sru (e; f; u) is wellde ned then so is dcr (e; f; u) and they are equal. But dcr is potentially more expressive, since u need not be idempotent. In fact, we do not know if sru can express parity or transitive closure. An interesting remark is that over ordered databases, sru together with transitive closure expresses dcr . One can also de ne a fourth form of recursion on sets which is related to sri similarly to the way dcr is related to sru , let's call it element-step recursion, esr . This is like sri , with the second clause modi ed as:

n

5 sru and sri are easier to reason about than dcr or esr because they de ne functions that preserve the algebraic structure, i.e. homomorphisms, hence the \structural" in their names. A good way to think about dcr ( ) is as the composition of the canonical coercion from sets to bags followed by the structural recursion on the sum presentation of bags [BTS91], with parameters . Similarly, esr can be expressed via structural recursion on the increment presentation of bags.

n

3 Query Languages

e; f; u

In this section we de ne the languages that o er characterizations of NC over complex objects and over

at relations. For complex objects, the language is obtained by adding bdcr and an order predicate to

e; f; u

4

the nested relational algebra NRA. This name can =t: t  t ! B , is de ned by induction on the type t. be used to describe a language that has the same When t = ft0 g, we start by de ning member? : t0  expressive power as Schek and Scholl's NF 2 rela- ft0g ! funit g, with the semantics member?(x; s) = tional algebra [SS86], or Thomas and Fischer's al- f()g when x 2 s, and member?(x; s) = ; otherwise. gebra [TF86], or Paredaens and Van Gucht's nested Namely: algebra [PVG88, PVG92], or Abiteboul and Beeri's def algebra without powerset [AB88]. The particular for- member?(x; s) = ext (y:if x = y then f()g else ;)(s) malization we use here was essentially introduced in [BBW92] Using member? we can de ne set inclusion, and, and is based on what is called there the monad cal- nally, we can de ne the equality at type ft0 g. culus. We will make two extensions to NRA in order to We assume an in nite set of variables to be given, obtain a language that characterizes NC . One exeach having a complex object type associated with tension is the addition of divide-and-conquer recurit. We write xs for a variable of type s. As usual, sion on sets. dcr is too powerful on complex objects we distinguish between free and bound variables, and since it can express powerset (actually one can show we identify those expressions that di er only in the that NRA(dcr ) has the same expressive power as name of some bound variables. NRA is de ned by Abiteboul and Beeri's algebra [AB88]). So instead, the following expressions, presented as part of their we will add the bounded version of this kind of retyping rules: cursion and consider the language NRA(bdcr ). We shall have occasion to contrast this languages with NRA(bsri ). Note that proposition 2.1 states that NRA (bdcr )  NRA(bsri ), and this holds even in e1 : t 1 e2 : t 2 the presence of external functions. xt : t (e1 ; e2 ) : (t1 ; t2 ) The second extension concerns ordering. All known e : t1  t2 e : t1  t2 characterizations of complexity classes below PTIME 1 (e) : t1 2 (e) : t2 are about ordered databases, and ours is no excepe:t e1 : ftg e1 : ftg tion. We isolate the use of ordering into the addition ; : ftg feg : ftg e1 [ e2 : ftg of an external function : D  D ! B , which is undere1 : D e 2 : D stood always to denote a linear order on D . The order e1 = e 2 : B () : unit relation can be lifted to all types (e.g. see [LW94]). We have thus reached the language NRA(bdcr ;  e : B e1 : t e2 : t e : ftg ) which is the subject of one of our main theorems, empty(e) : B if e then e1 else e2 : t characterizing the NC -computable queries on ordered f :s!t e:s e:t databases of complex objects (theorem 6.1). xs :e : s ! t f (e) : t In the same theorem, we obtain a ner characf : s ! ftg terization, involving the AC -hierarchy, for which we ext (f ) : fsg ! ftg need the notion of the depth of recursion nesting depth (e), of some expression e. We de ne this to We brie y describe the semantics of the expres- be to be the maximum depth of recursions occurring sions: (e1 ; e2 ) constructs a tuple, 1 ; 2 are the pro- in e. For example, for bdcr : depth (bdcr (e; f; u)) def = jections, feg is the singleton set, empty(e) returns max(depth (e); depth (f ); 1 + depth (u)) (only u is actrue i e = ;, if e then e1 else e2 equals e1 i tually iterated). We denote NRA(bdcr (k) ; ) the ree = true and e2 otherwise, xs :e denotes a func- strictions of the language NRA(bdcr ; ) to iteration tion whose input is the variable xs , f (e) is function depth  k. We have thus obtained the hierarchy of application, and ext (f )(fx1 ; : : : ; xn g) def = f (x1 ) [ languages NRA(bdcr (k) ; ) which is the subject of : : : [ f (xn ). A possible set  of external func- the ner characterization given in theorem 6.1. tions p : dom(p) ! codom(p) could be added to To characterize the NC -computable queries over the language; in this case, we denote the language by ordered at relations (theorem 6.2), we denote by NRA(). We abbreviate with (x; y):e the expres- NRA1 the restriction of NRA to types of \set1 height sion z:e[1 (z )=x; 2 (z )=y].  1", i.e. the only types allowed in NRA as inNRA is powerful enough to express the following puts, outputs and intermediate types are products of functions: set di erence, set intersection, cartesian base and at types. Its expressive power is essentially product, database projections, equalities at all types, the same as that of the relational algebra [BTBN91], selections over predicates de nable in the language, hence rst-order logic. We make the same two extennest and unnest [BBW92]. E.g., equality at type t, sions as for NRA, except that here it is safe to use 5

dcr . For good measure, proposition 2.2 states that it doesn't matter: NRA1 (bdcr ) = NRA1 (dcr ). Note however that this fails in the presence of certain external functions. Again we will have occasion to contrast NRA1 (dcr ) with NRA1 (1sri ) so note that1 proposition 2.1 states that NRA (dcr )  NRA (sri ), and this holds even in the presence of external functions. Therefore, for at relations, the languages of interest are NRA1 (dcr ; ) and the hierarchy NRA1 (dcr (k) ;  ). The reader may have noticed that some redundancy in expressibility will appear when we add dcr . Indeed, it turns out that ext (f ) can be expressed with sru (and hence with dcr ) as sru (;; x:fxg; [). It is important however to keep ext (f ) as a separate construct in the language because the expression derived through dcr would be computed in log n parallel steps while a direct one-step parallel computation is possible: obtain in parallel and independently f (x1 ); : : : ; f (xn ), and then take their union to compute ext (f )(fx1 ; : : : ; xn g).

x1 ; : : : ; xn are identi ed by assigning them the numbers 1; : : : ; n. We say that the family of circuits n is DLOGSPACE -DCL uniform, i the DCL can be accepted by some O(log n) space deterministic Turing Machine T . S Now NC is de ned as k0 AC k . The results in Stockmeyer and Vishkin [SV84] imply that this class coincides with the class of functions computable by a CRCW PRAM (Concurrent Read Concurrent Write Parallel Random Access Machine) in polylogarithmic time using polynomially many processors.

5 Encodings of Complex Objects

Our encodings of complex objects with strings over some xed alphabet is related to that in [GV91b]. We start with an encoding of the base type D into natural numbers which preserves the order relation . Next, we encode complex objects using the eight symbols from the alphabet A = f0; 1; f; g; (; ); comma; blankg, as follows: elements from D are encoded in binary, true and false are encoded by 1 and 0 respectively, () is encoded by (), a pair is encoded by (X1 ; X2 ), and a set by fX1; : : : ; Xn g. No duplicates are allowed in the Let F : f0; 1g ! f0; 1g; we say that F is in AC k , encoding of a set. However, blanks may be scattered for k  0 i the following conditions are met: (1) arbitrarily inside some encoding, but not inside the There is some polynomial Q(n) s.t. 8w 2 f0; 1g, binary numbers. Since the encoding of some complex j f (w) j= Q(j w j). Thus, F is the union of its object x is not unique, we de ne an encoding relation restrictions to inputs of length n, Fn : f0; 1gn ! x  X to denote the fact that X is a valid encoding f0; 1gQ(n). (2) There is a family of circuits n made of x. We view encodings as strings in f0; 1g, by up of input gates, NOT gates, unbounded fan-in AND representing each of the eight symbols in A with three and OR gates, s.t. n has n inputs, Q(n) outputs, bits. Removing duplicates is essential in the presence and computes Fn , for all n  0. (3) size( n)  P (n) of recursors or iterators; else the size of some reprefor some polynomial P (the size is the number of k sentation could grow beyond any polynomial. Dupligates), and depth ( n ) = O(log n). (4) The family cates can be removed in AC 0 , by replacing them with n is \uniform", as described below. Following Cook (see [Coo85], Proposition 4.7), we blanks, and blanks can be1 removed (more 0precisely: impose as uniformity condition the DLOGSPACE - moved at the end) in AC . So, within AC it would possible duplicates and DCL uniformity. Barrington, Immerman and Straub- have suced to encode with k no blanks, while for AC , k  1, we could ask both ing in [BIS90] give a weaker uniformity condition for blanks and duplicate elimination. But our choice called FO -DCL-uniformity which is equivalent to the k k is uniform for all AC , k  0. DLOGSPACE -DCL uniformity for the classes AC , Note that this encoding is di erent from that conk  1, and which provide a more satisfactory characterization for AC 0 . In this paper, only proposi- sidered by Immerman in [Imm89], who only deals tion 6.4 deals with the class AC 0 and it remains true with at relations. Under that encoding, a relation for the more restrictive FO -DCL-uniformity condi- of type fD k g is encoded by a string of bits of length nk . For at relations, we can translate between the tion in [BIS90]. The direct connection language DCL for a two encodings in AC 0 . family n of circuits, is the set of quadruples (n; g; g0; t), Consider D and D 0 two di erent interpretations where g; g0 are gate numbers in n , such that g is a of the base type. A morphism is some function ' : child of g0 , and t is the type of g0, t 2 fNOT; AND; OR; yD1 ;!: : :D;0ywith . property x  y () '(x)  '(y) (so Q(n) gthe When t = yi , then g0 is the output bit i. We use ' is injective); for any type t, ' extends to a function the convention that the input gates corresponding to 't : t ! t0 , where t0 is obtained from t by substituting

4 Complexity Classes

6

with D 0 . Adapting the de nition in [CH80], we de ne a database query of type s ! t to be some functions fD : s ! t (one for each interpretation of the base type D ) such that, for any morphism ', 't  fD = fD  's . We say that some query f is in AC k , or in NC , i there is some function F : f0; 1g ! f0; 1g such that, 8x 2 s; 8X 2 f0; 1g; x  X ) f (x)  F (X ). In order to compute f on an input x 2 s, it suces to choose some minimal encoding X of x, namely without blanks and in which the atomic values of x are encoded by 0; 1; : : :; m ? 1, next to compute Y = F (X ), and nally to decode Y . We de ne FLAT-NC and CMPX-OBJ-NC to be the class of queries over base types and at relations, and complex objects respectively, which are in NC . Similarly, we de ne the subclasses FLAT-AC k and CMPX-OBJ-AC k .

We state two more results which help us put the main theorems in perspective. Their proofs are omitted from this extended abstract. Conservative extension. One may wonder in what sense theorem 6.2 is a \particular case" of theorem 6.1. Actually, even though the proof of theorem 6.2 is quite similar to that of theorem 6.1, and we do present them \together" in section 7, theorem 6.2 in fact follows from theorem 6.1, proposition 2.2 and the conservative extension result presented below. Paredaens and Van Gucht in [PVG92], and Wong in [Won93] prove that NRA is a conservative extension of NRA1 . Suciu in [Suc94] proves that NRA(bfix) is a conservative extension of NRA1 (fix), where fix is the usual in ationary xpoint, and bfix is a bounded version of fix. Using the techniques in [Suc94], we can prove the following:

D

0

Proposition 6.5 Let  be a set of external functions which have set heights  1. Then, NRA(; bdcr ; ) is a conservative extension of NRA (; bdcr ; ). We only state the results here and give the proofs in section 7. Note that for the case when  = ;, we can turn the tables and proposition 6.5 follows directly from Theorem 6.1 NRA(bdcr ; ) = CMPX-OBJ-NC . the main theorems. For the case when  = 6 0, this k More precisely NRA(bdcr ; ) = CMPX-OBJ-AC k proposition requires a separate proof, and we are only for every k  1. able to do it in the presence of order. However, we Theorem 6.2 NRA (dcr ; ) = FLAT-NC . More conjecture that NRA(bdcr ) is a conservative extenprecisely NRA (dcr k ; ) = FLAT-AC k for every sion of NRA (dcr ). PTIME vs. NC. Immerman, Patnaik and Stemk  1.

6 Main Results

1

( )

1

1

1

( )

ple [IPS91] show that PTIME is captured by a language built around set-reduce (see section 2). Extending their result also to complex objects we have:

These languages are purely for complex objects, respectively relations. But many external functions of practical interest such as the usual arithmetical operations (+; ; ?; =; etc), and the usual aggregate functions (cardinality, sum, average, etc.) are also in NC . Can they be added in? The answer is yes for bdcr but no for dcr : Proposition 6.3 Let  be an extension consisting of possible additional base types and a set of functions computable in NC . Then NRA(; bdcr )  NC . However, NRA1 (N ; +; dcr ) can express exponential space queries. Immerman in [Imm89] and Barrington, Immerman and Straubing in [BIS90] prove that FO is included in FO -DCL-uniform AC 0 , and that FO together with order and BIT relation has the same expressive power as AC 0 . Here, we prove that NRA is included in AC 0 , thus extending half of their results to complex objects. Proposition 6.4 Under the encoding of complex objects described in subsection 5, all queries in NRA( ), are in FO-DCL-uniform AC 0 (see [BIS90])

Proposition 6.6 NRA (sri ; ) = PTIME [IPS91] and NRA(bsri ; ) = PTIME. 1

(1)

(1)

Thus, by the main theorems and this proposition, the di erence between PTIME and NC computable queries over ordered databases can be characterized by the di erence between two kinds of recursion on sets. It is interesting to note that only one level of recursion nesting suces for sri and PTIME , as opposed to dcr and NC .

7 Proofs 7.1

Iteration over sets

The central technical tool in proving our main result, is to convert the two forms of recursion over sets, into more simple loops. The logarithmic and the bounded logarithmic iterator are de ned by: 7

f :t!t log loop (f ) : fsg  t ! t f :t!t b:t blog loop (f; b) : fsg  t ! t

Proposition 7.3 Let f : s ! t, with t some PStype. Then f 2 NRA (; log loop k ; ) () f 2 NRA (; dcr k ; ), and f 2 NRA(; blog loop k ;  ) () f 2 NRA(; bdcr k ; ), 8k  0. A similar 1

1

( )

( )

( )

( )

relationship holds between loop and sri.

with the semantics: = f (dlog(jxj+1)e)(y) log loop (f )(x; y) def where j x j is the cardinal of x. The bounded log= arithmic iterator is de ne by blog loop (f; b)(x; y) def log loop (f \ b)(x; y \ b). Thus, log loop iterates some function f a number of times equal to the number of bits necessary to represent the cardinality of a set x. Similarly, we de ne the iterator and the bounded iterator loop and bloop , which iterates some function j x j times, instead of dlog(j x j +1)e times. We extend the de nition of depth of recursion nesting to depth of iteration nesting for these construct, by de ning depth (log loop (f )(e)) def = max(1 + depth (f ); depth (e)), etc. Both log loop and loop are powerful enough to express powerset. Hence, we will only consider the unbounded versions in conjunction with at relations, and use their bounded versions for complex objects.

Example 7.1 log loop can express transitive closure,

tc : ft  tg ! ft  tg. Indeed, let r 2 ft  tg be some relation. First compute v = 1 (r) [ 2 (r) (the set of all elements mentioned in r), then, repeat dlog(n +1)e times r r [ r  r, where n def = j v j, and  is relation composition.

Example 7.2 Let n = card(x). Then loop (f ) and

log loop (f ) allow us to iterate n and log n times respectively. To iterate n2 times, it suces to loop over x  x, which has n2 elements. To iterate log2 n times, we use a depth two of iteration nesting.

Proof. Consider some function h = dcr (e; f; u), h : fsg ! t, and x = fa1 ; : : : ; an g 2 fsg some input to it. The idea of simulating h with log loop is to rst apply f to each element in x, obtaining y = ff (a1); : : : ; f (an )g 2 ftg, and then to iterate log n times some function g on y, which, for some set set y = fb1; : : : ; bmg, is de ned by: g(y) def = fu(b1; b2 ); u(b3 ; b4); : : : ; u(bn?2 ; bm?1); u(bm ; e)g (assuming m is odd): the order relation on y is used in the de nition of g, and some transitive closure is com-

puted to identify the odd and even positions. Thus, the number m of elements in y is initially n, and is halved at each step. Eventually, the set y will contain only one element, which one can prove to be h(x) (associativity and commutativity of u is used here). Since t is a PS-type, one can extract the unique element out of a singleton set. To compute bdcr , one proceeds similarly, but use blog loop instead of log loop . Only one problem remains: the type of y is ftg, which has a set height one larger than t. To circumvent that, we use the fact that t is a PS-type and \ atten" y; to distinguish elements belonging to di erent subsets, we tag them with elements from x. Conversely, consider some log loop (f )(x; y); we can express it by divide and conquer recursion on the set x, by noting that: log loop (f )(;; y) = y log loop (f )(fag; y) = f (y)

For log loop (f )(x1 [ x2 ; y), assume j x1 jj x2 j (the case j x1 j>j x2 j is similar). Then

Immerman de nes FO(t(n)) in [Imm89] to be rst order logic, with order and with a binary relation BIT , extended with those inductive de nitions which close after t(n) steps. NRA1 (log loop ; ; BIT ) and NRA1 (loop ; ; BIT ) have essentially the same expressive power as FO (logO(1) n) and FO (nO(1) ) respectively. However, without order, these two are no longer equivalent: loop can express parity, while FO (nO(1) ) (without order and BIT ) is included in FO + LFP , and hence it cannot express parity. Similar, we can argue that FO (logO(1) n) is less powerful than NRA1 (log loop ). The key technical lemma in proving the main results states that dcr and log loop have the same expressive power over ordered databases:

log loop (f )(x1 [ x2 ; y) =



f (log loop (x1 ; y)) or log loop (x1 ; y)

Namely log loop (f )(x1 [ x2 ; y) = f (log loop (x1 ; y)) if j x1 [ x2 j has one more bit than j x1 j, and log loop (f )(x1 [ x2 ; y) = log loop (x1 ; y) otherwise. So we only have to argue that we can answer the question about the number of bits. The idea is to use the set x as a set of numbers 0; 1; : : :; n ? 1, and to compute the function '(x0 ) = (j x0 j; (2dlog(jx j+1)e ; f (dlog(jx j+1)e) (y))), for all x0  x. I.e., we return the cardinality of x0 , the next power of 2, and log loop (f )(x0 ; y). Addition and comparison on the \numbers" in x (which 0

8

0

can be done with transitive closure) suces to com- Proposition 7.7 NRA(blog loop (k) )  AC k for all pute h using dcr . To avoid increasing the iteration k  0. Hence, NRA1 (log loop (k) )  AC k . depth we precompute addition and comparison, as Proof. We prove by induction on some comsubsets of x  x  x and x  x respectively, using a expressions of iteration depth 1; thus, an expres- plex object expression es2 NRAs(blog loop (k) ) of type sion in NRA(; blog loop (k) ) will be translated into t with free variables x11 ; : : : ; xl , that the function some NRA(; dcr ) expression with iteration depth (xs11 ; : : : ; xsl ):e : s1  : : : sl ! t is in AC k . Simultamax(k; 1) = k. The \u" used in this dcr will be as- neously, we prove also by induction that, for any funcsociative and commutative on some set of the form tion f of type s ! t with free variables xs11 ; : : : ; xsl , f(i; ci ) j i j x0 jg, because u is de ned as u((i; ci ); (j; cj ))(=xs ; xs11 ; : : : ; xsl ):f (xs ) : s  s1  : : :  sl ! t is in (i + j; ci+j ). 2 AC k . We only illustrate some of the cases. The annoying condition for t to be a PS-type is due to the fact that the function get : fD g  D ! D e [ e0 (union) Let n be the circuit for e and 0n the circuit for e0 . Concatenate their result, elimide ned by get(x; y) def = if x = fz g then z else y is denate the braces g f replacing them with blanks nable with dcr , but not with log loop . But log loop and conditionally placing a comma (the comma together with get can indeed express dcr at all types is placed only when both e and e0 yield a nonempty t. set). Finally, eliminate the duplicates in the reThe proof of Proposition 7.3 has an important sulting set, using lemmas 7.5 and 7.6, by replacconsequence. Recall that the conditions for well-de nedness 1 0 ing them with blanks. of dcr are 1 -complete hence the language NRA (dcr ;  ) is not r.e. But, by restricting it to the instances of ext (f ) For simplicity suppose f : s ! ftg doesn't dcr used in the simulation of log loop we obtain an have free variables, and let n be a circuit for r.e., in fact decidable, sublanguage L which has the computing f . The circuit for ext (f ) will con1 same expressive power as the whole NRA (dcr ; ). sists of 3 ( 32+1) copies of n (recall that three bits are used to encode one character), iden7.2 Circuits ti ed by pairs (i; j ), 1  i  j  n3 , and whose outputs are concatenated. Circuit (i; j ) In order to prove that NRA(blog loop )  AC , we will have as inputs the symbols from position rst establish some technical lemmas. 3i ? 2 to 3j , and its output will be overridden Lemma (i.e. replaced by blanks) unless in the input S 7.4 For each type t, there is some function F = Fn in AC 0 , Fn : f0; 1gn ! f0; 1gn2 which fX1 ; : : : ; Xm g there is some Xl starting at poidenti es the pairs of parenthesis for any encoding of sition 3i ? 2 and ending on position 3j (which type t. can be determined using lemma 7.5). Finally we concatenate their results and eliminate the Proof. The nesting depth of parenthesis for duplicates. some type t is bounded by some dt , so identifying the pairs of parenthesis can be done by some circuit of f (e) Construct the circuit for e and direct its outputs depth O(dt ). 2 into the circuit for f . Lemma 7.5S For any set type ftg, there is some func- blog loop (f; b) For clarity, assume the type of f is tion F = Fn in AC 0 , Fn : f0; 1gn ! f0; 1gn, ftg ! ftg. First we construct the circuit n which, for some encoding fX1 ; : : : ; Xm g of type ftg, for computing b: let its output have size Q(n), returns a string containing exactly m 1's, namely on where Q is some polynomial. Let fX1; : : : ; Xmg those positions where some Xi begins. Similarly for be the output of n . Clearly, m  P (n), so it pair types (s; t). suces to make log Q(n) copies of the circuit Q(n) for f . Each such copy receives some input Proof. The circuit computing Fn identi es the Y of size Q(n), computes f (Y ), and intersects it outermost commas (i.e. those not included in any with fX1 ; : : : ; Xmg (the output of b) such that pair of parenthesis, except the outermost f g), and the result Y 0 has the same size Q(n), so it can returns a 1 on each rst nonblank position following be fed into the next level. Of course, we have such a comma, or following the leading left brace. 2 to bypass all levels above level log m. For this As a consequence, we have: we compute m by counting the number of 1's produced by lemma 7.5 on fX1 ; : : : ; Xm g (this Lemma 7.6 For all types t, equality of objects of can be done in AC 1 ), compute log m (again in type t is computable in AC 0 . l

l

l

l

n

9

n

There are two ways of simulating F on X . One is to use the result in [Imm89] which says that, since F is in AC k , F is also in FO (logk n)+  +BIT , and to observe that, for k  1, FO (logk n)+  +BIT  NRA1 (log loop (k) ; ). The second way is to usek the DLOGSPACE -DCL-uniformity de nition of AC . First, We skip the proof of the uniformity, which is te- we simulate the O(log n) space Turing Machine comdious but straightforward. 2 puting the DCL of n : this can be done, since there Instead of designing a circuit for computing f , are only polynomially many con gurations for T , and we could have shown that f can be computed in deciding whether T accepts some input (n; g; g0; t) reFO (logk n)+  +BIT , and then using the results duces to the computation of transitive closure of the in [Imm89, BIS90] to conclude f 2 AC k : in fact, this successor relation on the set of con gurations. Secis the way we prove proposition 6.4. But we chose to ond, we simulate the circuit n itself, by computing construct the circuit for computing f in order to sug- step by step the outputs of the gates at each level: gest that how f may compiled on a CRCW PRAM. this only requires logk n iterations, so it can be done in NRA1 (log loop (k) ; ). Note that ext is used in an Proposition 7.8 Letk f : s ! t be s.t.1 t is a PS-type. essential way at each iteration stept, accounting for Then f 2 FLAT-AC ) f 2 NRA (log loop (k) ; ) the parallelism in the evaluation of n . and f 2 CMPX-OBJ-AC k ) f 2 NRA(blog loop (k) ;  This proved ), for k  1. CMPX-OBJ-AC k  NRA(blog loop (k) ; ); 8k  1 k Proof. Let F 2 CMPX-OBJ-AC , of type s ! t. F is given by: (1) A DLOGSPACE Turing If s and t are both at types, then all the compuMachine T accepting the DCL of a family of circuits, tations describe above are in NRA1 (blog loop (k) ;  (2) Polynomials P (n) and Q(n) (see section 4). For ), which is equal to NRA1 (log loop (k) ; ). Hence, some input x 2 s, let n be the length of the minimal FLAT-AC k  NRA1 (log loop (k) ; ). 2 encoding X of x (see section 5). The simulation of F Now we can prove our main results. Theorems in NRAk (blog loop ; ) is described below. 6.1 and 6.2 follow from propositions 7.7 and 7.8, and the cases when the target type t of f : s ! t is 1. Construct from the input x some set z having not a PS-type are handled separatedly, essentially by a cardinality  n. The type of z will have a set observing that dcr can express get (see subsection height which is at most equal to the set height of 7.1). Proposition 6.4 follows from proposition 7.7, s; thus z is in NRA1 when F is in FLAT-AC k . and proposition 6.3 is proven by an straightforward We omit the technical details for computing z : extension of the proof of proposition 7.7. see [GV91a, Suc94]. 2. Some power of z will have p = nl elements, enough to perform all the arithmetic needed in the sequel. Over this ordered set, we pre- Ordering seems to play a crucial role in capturing compute the functions plus, minus, multiplica- complexity classes below NP and our characterization, and bit, on the numbers 0; : : : ; p ? 1. E.g. tion is no exception. Indeed, it follows from theorem to compute addition, we use transitive closure, 7.8 in [IPS91] that in the absence of ordering FO +dcr a technique found in [Imm87b]. Everything in cannot express the lower bound in [CFI92] which is in this step is in NRA(blog loop (1) ; ). AC 0 plus parity gates ([CFI92] remark 7.2). As with , DLOGSPACE , etc., it remains an impor3. Compute the minimal encoding X of x, of length PTIME tant open whether there exists an r.e. set of n, without blanks: X 2 f0; 1g is represented \programs"question that express exactly the NC -computable as a set of \numbers". The computation is queries over arbitrary relational databases. 1 done in NRA (blog loop ; ), the blog loop beOn the other hand, studying expressiveness ing needed to compute the sum of a set of num- of the various forms of recursion the on sets in the abbers. sence of ordering is quite relevant to query language 4. Simulate F on X , as described below, to get design. It may also be relevant to complexity theory, Y = F (X ). Then \decode" Y , to get y 2 t. if an analog to the surprising result of Abiteboul and Vianu [AV91] holds. They have shown that PTIME 6= Decoding is done in NRA. AC 1 ) and bypass all circuits for f whose level is larger than log m. Finally, observe that, if the circuit Q(n) for computing f had depth O(logk n), then the resulting circuit has depth O(logk+1 n).

8 Conclusions

10

PSPACE i rst-order least xpoint queries 6= rst- [BIS90] order while queries. (Vardi had shown that in the presence of order the FO +while captures PSPACE [Var82].) Dawar, Lindell, and Weinstein [DLW93] give a machineindependent proof of the Abiteboul and Vianu result [BT92] making use of properties of bounded variable logics. Abiteboul, Vardi and Vianu [AVV92] give evidence for the robustness of the idea with several such results for other pairs of complexity classes. In our case, the [BTBN91] analog would be: NC 6= PTIME i FO + dcr 6= FO + sri (in our formalism, NRA1 (dcr ) 6= NRA1 (sri )). By setting aside the ordering, with its potential for tricky encodings, this would strengthen the observation (section 6) that the di erence between tractable sequential and tractable parallel computation can be characterized as the di erence between two ways of [BTS91] recurring on sets. Acknowledgements. We thank Scott Weinstein for many illuminating discussions, Neil Immerman for answering our sometimes naive queries, Peter Buneman and Leonid Libkin for suggestions from a careful reading of an earlier version of this paper, and Peter, Leonid, and Limsoon Wong for their constant help. [CFI92]

David Mix Barrington, Neil Immerman, and Howard Straubing. On uniformity within NC 1 . Journal of Computer and System Sciences, 41:274{306, 1990. Val Breazu-Tannen. Generalized structural recursion and sets vs. bags, January 1992. Manuscript available from [email protected]. V. Breazu-Tannen, P. Buneman, and S. Naqvi. Structural recursion as a query language. In Proceedings of 3rd International Workshop on Database Programming Languages, Naphlion, Greece, pages 9{ 19. Morgan Kaufmann, August 1991. Also available as UPenn Technical Report MS-CIS92-17. V. Breazu-Tannen and R. Subrahmanyam. Logical and computational aspects of programming with Sets/Bags/Lists. In LNCS 510: Proceedings of 18th International Colloquium on Automata, Languages, and Programming, Madrid, Spain, July 1991, pages 60{75. Springer Verlag, 1991. Jin-Yi Cai, Martin Furer, and Neil Immerman. An optimal lower bound on the number of variables for graph identi cation. Combinatorica, 12(4):389{410, 1992. [AB88] Serge Abiteboul and Catriel Beeri. On the [CH80] Ashok Chandra and David Harel. Computable queries for relational databases. power of languages for the manipulation of Journal of Computer and System Sciences, complex objects. In Proceedings of Inter21(2):156{178, 1980. national Workshop on Theory and Applications of Nested Relations and Complex Ob- [CL90] Kevin L. Compton and Claude La amme. An jects, Darmstadt, 1988. Also available as INalgebra and a logic for NC . Information and RIA Technical Report 846. Computation, 87(1/2):240{262, 1990. [AV91] Serge Abiteboul and Victor Vianu. Generic [Clo90] P. Clote. Sequential, machine-independent computation and its complexity. In Proceedcharacterizations of the parallel complexity ings of 23rd ACM Symposium on the Theory classes AlogTime, AC k , NC k , and NC . In Samuel R. Buss and Philip J. Scot, editors, of Computing, 1991. Feasible Mathematics. Birkhauser, Boston, [AVV92] S. Abiteboul, M. Vardi, and V. Vianu. Fix1990. point logics, relational machines, and computational complexity. In Structure and Com- [Coo85] S. Cook. A taxonomy of problems with fast parallel algorithms. Information and Control, plexity, 1992. 64:2{22, 1985. [BBKV87] F. Bancilhon, T. Briggs, S. Khosha an, and P. Valduriez. FAD, a powerful and simple [DLW93] Anuj Dawar, Steven Lindell, and Scott Weinstein. In nitary logic and inductive de ndatabase language. In Proceedings of 13th Inability over nite structures. Information and ternational Conference on Very Large Data Computation, 1993. To appear. Available as Bases, pages 97{105, 1987. UPenn Technical Report MS-CIS-91-97. [BBW92] Val Breazu-Tannen, Peter Buneman, and Limsoon Wong. Naturally embedded query [DV91] K. Denninghof and V. Vianu. The power of methods with parallel semantics. In Proceedlanguages. In J. Biskup and R. Hull, edings of 17th International Conference on Very itors, LNCS 646: Proceedings of 4th InLarge Databases, 1991. ternational Conference on Database Theory, Berlin, Germany, October, 1992, pages 140{ [Gur83] Y. Gurevich. Algebra of feasible functions. 154. Springer-Verlag, October 1992. Available In Proceedings of 24th IEEE Symposium on as UPenn Technical Report MS-CIS-92-47. Foundations of Computer Science, pages 210{ 214. IEEE Computer Society Press, 1983.

References

11

[GV91a]

[GV91b]

[Imm86] [Imm87a] [Imm87b] [Imm89] [IPS91]

[LW94]

[Mos74] [OBB89]

[PSV92]

Stephane Grumbach and Victor Vianu. Expressiveness and complexity of restricted languages for complex objects. In Proceedings of 3rd International Workshop on Database Programming Languages, Naphlion, Greece, pages 191{202. Morgan Kaufmann, August 1991. Stephane Grumbach and Victor Vianu. Tractable query languages for complex object databases. Technical Report 1573, INRIA, Rocquencourt BP 105, 78153 Le Chesnay, France, December 1991. Extended abstract appeared in PODS 91. Neil Immerman. Relational queries computable in polynomial time. Information and Control, 68:86{104, 1986. Neil Immerman. Expressibility as a complexity measure: Results and directions. In Proceedings of 2nd Conference on Structure in Complexity Theory, pages 194{202, 1987. Neil Immerman. Languages that capture complexity classes. SIAM Journal of Computing, 16:760{778, 1987. Neil Immerman. Expressibility and parallel complexity. SIAM Journal of Computing, 18:625{638, 1989. Neil Immerman, Sushant Patnaik, and David Stemple. The expressiveness of a family of nite set languages. In Proceedings of 10th ACM Symposium on Principles of Database Systems, pages 37{52, 1991. Leonid Libkin and Limsoon Wong. Aggregate functions, conservative extension, and linear orders. In Catriel Beeri, Atsushi Ohori, and Dennis E. Shasha, editors, Proceedings of 4th International Workshop on Database Programming Languages, New York, August 1993, pages 282{294. Springer-Verlag, January 1994. See also UPenn Technical Report MS-CIS-93-36. Y. N. Moschovakis. Elementary Induction on Abstract Structures. North Holland, 1974. A. Ohori, P. Buneman, and V. BreazuTannen. Database programming in Machiavelli, a polymorphic language with static type inference. In James Cli ord, Bruce Lindsay, and David Maier, editors, Proceedings of ACM-SIGMOD International Conference on Management of Data, pages 46{57, Portland, Oregon, June 1989. D. Stott Parker, Eric Simon, and Patrick Valduriez. SVP: A model capturing sets, streams, and parallelism. In Li-Yan Yuan, editor, Proceedings of 18th International Conference on Very Large Databases, Vancouver, August 1992, pages 115{126, San Mateo, California, August 1992. Morgan-Kaufmann.

[PVG88] Jan Paredaens and Dirk Van Gucht. Possibilities and limitations of using at operators in nested algebra expressions. In Proceedings of 7th ACM Symposium on Principles of Database Systems,Austin, Texas, pages 29{38, 1988. [PVG92] Jan Paredaens and Dirk Van Gucht. Converting nested relational algebra expressions into

at algebra expressions. ACM Transaction on Database Systems, 17(1):65{93, March 1992. [Sar92] Yatin Saraiya. Fixpoints and optimizations in a language based on structural recursion on sets, December 1992. Manuscript available from [email protected]. [SS86] H.-J. Schek and M. H. Scholl. The relational model with relation-valued attributes. Information Systems, 11(2):137{147, 1986. [Suc94] Dan Suciu. Bounded xpoints for complex objects. In Catriel Beeri, Atsushi Ohori, and Dennis Shasha, editors, Proceedings of 4th International Workshop on Database Programming Languages, New York, pages 263{281. Springer-Verlag, January 1994. [SV84] Larry Stockmeyer and Uzi Vishkin. Simulation of parallel random access machines by circuits. SIAM Journal of Computing, 13:409{ 422, May 1984. [TF86] S. J. Thomas and P. C. Fischer. Nested relational structures. In P. C. Kanellakis and F. P. Preparata, editors, Advances in Computing Research: The Theory of Databases, pages 269{307, London, England, 1986. JAI Press. [Var82] M. Y. Vardi. The complexity of relational query languages. In Proceedings of 14th ACM SIGACT Symposium on the Theory of Computing, pages 137{146, San Francisco, California, 1982. [Won93] Limsoon Wong. Normal forms and conservative properties for query languages over collection types. In Proceedings of 12th ACM Symposium on Principles of Database Systems, pages 26{36, Washington, D. C., May 1993. See also UPenn Technical Report MS-CIS-9259.

12