A Compositional Query Algebra for Second-Order Logic and Uncertain Databases
World-set algebra is a variable-free query language for uncertain databases. It constitutes the core of the query language implemented in MayBMS, an uncertain database system. This paper shows that world-set algebra captures exactly second-order logi…
Authors: Christoph Koch
A Comp ositional Query Algebra for Second-Order Logi c and Uncertain Databases Christoph Ko c h Departmen t of C omputer Science Cornell Univ ersit y , Ithaca, NY 14853 , USA k o c h@cs.cornell.edu Abstract W orld-set algebra is a v ariable-free query language for uncertain databas e s. It con- stitutes the core of the query language implemented in MayBMS, an uncertain databa se system. This pap er shows that world-set algebr a captures exa ctly seco nd-order logic ov er finite structures, or equiv alently , the p olynomia l hier a rch y . The pro ofs also imply that world-set algebra is closed under co mpo sition, a previous ly op en pro blem. 1 In tro duction Dev eloping suitable query languages for uncertain d atabases is a substantia l researc h chal- lenge that is only currently starting to get addr essed. In previous w ork [3], we ha v e de- v elop ed a query language in the spirit of relational algebra for pro cessing uncertain data – world-set algebr a (WSA). WSA consists of the op erations of relational algebra plus t wo further op erations, one to in tro d u ce uncertaint y and one to compute p ossible tuples across groups of p ossible w orlds. WSA is implemented in the Ma yBMS system [3, 2, 10, 9]. It remains to obtain an und erstanding of the complexit y an d expressive p o wer of world- set algebra. The m ain r esult of this pap er is a pro of th at w orld-set algebra o v er un certain databases consisting of finite sets of p ossible wo r lds (eac h one a relat ional d atabase) pre- cisely captures second-order logic (SO) ov er fi nite structures, or equiv alen tly , the p olynomial hierarc hy . This seems to b e a somewhat su rprising coincidence, sin ce th e language wa s not designed with this result as a goal but b y abstraction from a set of use cases from the con texts of hyp othetical (“what-if ”) queries, decision supp ort queries, and data cleaning. View ed differen tly , WSA is a natural v ariable-free language equiv alen t to SO; it is to SO what relational algebra is to first-order log ic. T o the b est of the au th or’s kno wledge, no other suc h language is kno wn. The fact that WSA exactly captures second-ord er logic is a strong argument to ju stify it as a qu ery language for u ncertain data. Second-order logic is a natural yardstic k for languages for querying p ossible w orlds. Ind eed, second-order quantifiers are the essence of what-if reasoning ab out databases. W orld-set alg ebra seems to b e a strong candidate for a core algebra for forming query plans and optimizing and executing them in uncertain database managemen t systems. It was left op en in pr evious wo rk whether world-set algebra is closed un der comp osition, or in other words, whether definitions are adding to the expressiv e p o w er of the language. Comp ositionalit y is a desirable and rather commonplace prop erty of query algebras, but 1 in the case of WS A it seems rather unlike ly to hold. The reason for this is that the alge- bra co ntains an uncertain ty-in tro duction op eration that on th e lev el of p ossib le w orld s is nondeterministic. First materia lizing a view and subsequ en tly using it multiple times in the query is seman tically quite differen t from comp osin g the qu ery w ith the view and th us obtaining sev eral copies of the view definition that can n o w ind ep endently mak e their non- deterministic c hoices. In the pap er, evidence is giv en that seems to suggest that definitions are essen tial for the expressive p o wer of WSA. The pap er neve rtheless giv es a pro of that definitions do not add to the p ow er of the language, and WSA is ind eed comp ositional. In f act, there is even a (nont rivial) pr actical linear-time translation from SO to WS A without defin itions. This result, and the tec hn iques for proving it, ma y also b e relev ant in other con texts. F or example, it is s ho wn th at self- joins essentia lly can alw ays b e eliminated from classical relational algebra at the cost of in tro ducing difference op erators. The p ro ofs also imply that WSA is complete for the p olynomial hierarch y with resp ect to data complexit y and PSP A C E-complete with resp ect to com bined complexit y [15, 14]. F or use as a query language for p robabilistic databases, WSA has b een extend ed very sligh tly by a tuple confidence compu tation op eration (see e.g. [9]). The fo cus of this pa- p er is on the nonpr obabilistic language of [3]. F or the efficien t pro cessing of quer ies of this language, the confidence op eration is naturally orthogonal to the r emaining op erations [2, 10, 9]. Th e expressiveness and complexit y results obtained in th e presen t p ap er consti- tute lo wer b ounds f or the probabilistic v ersion of the language. But th e non-probabilistic language is interesti ng and imp ortan t in its own right: Man y interesting qu eries can b e phrased in terms of the alte rnativ es p ossible in a data managemen t scenario with un cer- tain t y , without r eference to the relativ e (probability) weig hts of these alternativ es. The stru cture of this pap er is as follo ws. Section 2 establishes the connection b etw een second-order logic and u ncertain databases. Section 3 in tro duces w orld -set algebra and giv es formal definitions of s yn tax and seman tics. S ection 4 pro v es that WSA exactly captures the exp ressiv e p o wer of second-order logic o v er fi nite structures. T hese pr o ofs assum e the a v ailabilit y of a construct for making defin itions (materia lizing views). Section 5 d iscusses the imp ortance of being able to comp ose these d efi nitions with the language, and shows wh y it should seem rather surp rising that defi n itions are not needed for capturing second- order logic. Section 6 fi n ally pro ves that definitions can ind eed b e eliminated without loss of expr essiv e p o we r, and a construction for comp osition is giv en. W e obtain f rom these results that WSA with or w ithout definitions is complete for the p olynomial hierarch y w ith resp ect to data complexit y and PSP A CE -complete with resp ect to combined complexit y . W e discuss relate d work in Section 7 and conclude in Section 8. 2 Uncertain Databases The sc hema of a relational d atabase is a set of relatio n n ames together with a function sch that maps eac h relation name to a tuple of attribute n ames. W e use calligraphic symbols suc h as A for relational databases. The arity | s ch ( R ) | of a relation R is denoted by ar ( R ). W e will us e the standard synta x of second-order logic (SO) (see e.g. [11]). Its seman tics is d efined usin g the satisfaction relation , as usual. Thr oughout this pap er, we w ill only use second-order logic r elativize d to some finite s et of domain elemen ts (sa y , D ), as is common in fi nite mo del theory (cf. [11 ]). That is, fir st-order quantifiers ∃ x φ are to b e read as ∃ x D ( x ) ∧ φ and second-order quantifiers ∃ R φ are to b e int erpreted as ∃ R R ⊆ D ar ( R ) ∧ φ . 2 An unc ertain datab ase ov er a given sc hema represen ts a finite set W = {A 1 , . . . , A n } of relational databases of that schema, called the p ossible world s . One w orld among these is the true w orld, b ut we d o n ot kno w which one. A r epr esentation for a finite set of p ossible w orlds W o v er schema ( R 1 , . . . , R k ) is a pair of a relational database schema and a formula ω o ver that database sc h ema with free second-order v ariables R 1 , . . . , R k and w ithout free first-order v ariables such that ω is true on exactly those structures th at are in W : ( R 1 , . . . , R k ) ω ⇔ ( R 1 , . . . , R k ) ∈ W. Example 2.1 (Standard Represen tation) C onsider a repr esen tation of an uncertain database by relations th at asso ciate w ith eac h tuple a lo cal condition in the form of a conjunction of prop ositional literals. A p ossible wo rld is iden tified b y a truth assignment for the prop ositional v ariables used, an d a tu p le is in a p ossib le wo r ld if the world’s truth assignmen t mak es the tuple’s clause true. A representat ion database consists of a set V of prop ositional v ariables, a relation L suc h th at L ( c, p, 1 ) is true iff v ariable p o ccurs p ositiv ely in conjunction c and L ( c, p, 0) is true iff v ariable p o ccurs negated in c , and a representat ion relation R ′ i for eac h sc h ema relation R i whic h extends the s chema of R i b y a column to asso ciate eac h tuple with a conjunction. P ossible wo rlds are identified by subsets P ⊆ V of v ariables that are true. A tuple ~ t is in relation R i in p ossible w orld P if R ′ j ( ~ t, c ) is true and conjunction c is true for the v ariable assignmen t that m ak es th e v ariables in P true and the others false. The represen tation form u la ω ( R 1 , . . . , R k ) is ∃ P P ⊆ V ∧ k ^ i =1 ∀ ~ t R i ( ~ t ) ⇔ ∃ c R ′ i ( ~ t, c ) ∧ ∀ p ( L ( c, p, 0) ⇒ ¬ P ( p )) ∧ ( L ( c, p, 1) ⇒ P ( p )) . This is the represen tation system that is essentiall y used in MystiQ [5], T rio [4], and Ma yBMS [2]. It is a sp ecial case of c-tables [7] in whic h local conditions are in DNF, there is no global condition, and no v ariables o ccur in the data tup les themselv es (jus t in the lo cal conditions asso ciated with the data tu ples). Note that it is complete in the sense that it ca n represent any nonempt y finite set of p ossible worlds. Moreo ver, it is succinct, i.e., the cardinalit y of the r epresen ted set of p ossible worlds is in general exp onen tial in the size of the represen tation d atabase. ✷ It is no w easy to use second-order logic for expressing queries on uncertain databases enco ded by a r epresen tation. F or instance, query φ is p ossib le if ∃ R 1 · · · R k ω ∧ φ and certain if ∀ R 1 · · · R k ω ⇒ φ . Second-order logic allo ws us to us e succinct representa tions, b ut also yields v ery p o werful h yp othetical qu eries that can ask q u estions ab out p ossible c h oices of sets of tu p les. S uc h a choic e of sets could b e e.g. clusters of tuples in record matc hin g (also kno wn as ded uplication and u n der man y other names). 3 The A lgebra 3.1 Syn tax and Seman t ics W orld-set algebra (WSA) consists of the op erations of relational alge bra (selection σ , p ro- jection π , r en aming ρ , pro duct × , union ∪ , and difference − ), t w o additional op erations 3 repair-k ey and p ossible ~ A , and d efinitions “let R := Q in Q ′ ” where R is a new r elation sym b ol that ma y b e u sed in Q ′ . WSA without definitions is the set of WSA queries in whic h no let-expressions o ccur . Conceptually all op er ations are ev aluated in eac h p ossible wo rld individually . The op erations of relational algebra are ev aluated within p ossib le w orld A in th e normal w ay . Giv en inpu t r elation R , repair-key ~ A ( R ) nondeterministically c ho oses a maximal repair of the functional dep end ency ~ A → sch ( R ) on R , that is, it returns a subset R ′ of R in which ~ A is a (sup er)k ey such that there is no sup erset of R ′ whic h is a subs et of R and in whic h ~ A is a (su p er)k ey . The op eration p ossible ~ A ( Q ) is the only op eration that can lo ok in to alternativ e p ossible worlds. It computes, for the current p ossible world giv en by A , the set of p ossible tup les occurr ing in the results of Q across the group of p ossible w orlds that agree with A on π ~ A ( Q ). Definitions (state men ts “let R := Q in Q ′ ”) extend A b y a named relation R defined by query Q . Since Q is nondeterministic in general, the o v erall set of p ossible w orlds on wh ic h Q ′ runs (whic h is relev an t for computing p ossible ~ A ) may increase. F ormally , the seman tics of world-set algebra is d efined u sing a translation [ [ · ] ] A W suc h that for a context of a set of p ossible w orlds W and a w orld A ∈ W , R is a p ossible r esult of w orld -set algebra query Q iff R ∈ [ [ Q ] ] A W : [ [ { ~ t } ] ] A W := {{ ~ t }} . . . ~ t constan t tup le [ [ R ] ] A W := { R A } [ [ θ ( Q )] ] A W := { θ ( R ) | R ∈ [ [ Q ] ] A W } . . . θ ∈ { σ φ , π ~ A , ρ A → B } [ [ Q 1 θ Q 2 ] ] A W := { R 1 θ R 2 | R 1 ∈ [ [ Q 1 ] ] A W , R 2 ∈ [ [ Q 2 ] ] A W } . . . θ ∈ {× , ∪ , −} [ [repair-k ey ~ A ( Q )] ] A W := { R ′ | R ′ ⊆ R ∈ [ [ Q ] ] A W , π ~ A ( R ) = π ~ A ( R ′ ) , ~ A is a key f or R 0 } [ [p ossible ~ A ( Q )] ] A W := S R ′ | B ∈ W , R ′ ∈ [ [ Q ] ] B W , π ~ A ( R ) = π ~ A ( R ′ ) | R ∈ [ [ Q ] ] A W [ [let R := Q in Q ′ ] ] A W := [ [ Q ′ ] ] ( A ,R ) W ′ | R ∈ [ [ Q ] ] A W where W ′ = { ( B , R ′ ) | B ∈ W, R ′ ∈ [ [ Q ] ] B W } . Queries are run against an uncertain database W , and [ [ Q ] ] A W giv es the result of Q s een in p ossible w orld A of W . Using p ossible ∅ , w e can close the p ossible worlds semantics and ask for p ossib le (or, using d ifference, certain) tuples. F or suc h queries A can b e chosen arbitrarily (and the seman tics fun ction can b e considered to b e of the form [ [ Q ] ] W ). Definitions in su b expr ession are unaffecte d by th e operations higher u p in th e expres- sion tree and can be pulled to the top of the expression without mo difi cation. T his is a direct consequence of the follo wing fact, wher e we assume that θ ma y b e any of the WS A op erations. (Thus 0 ≤ k ≤ 2 and for p ossible ~ A , k = 2.) Prop osition 3.1 F or arbitr ary WSA qu e ries Q , θ ( Q 1 , . . . , Q k ) , i f V o c curs only in Q i , θ ( Q 1 , . . . , Q i − 1 , ( let V := Q in Q i ) , Q i +1 , . . . , Q k ) = let V := Q in θ ( Q 1 , . . . , Q k ) . 4 Pro of. It can b e sho wn by an easy induction that for an y Q , [ [ Q ] ] ( A ,V ) W = [ [ Q ] ] A W ′ where W ′ = {A | ( A , V ) ∈ W } if relation n ame V do es not app ear in Q . T his is immediate for all op erations other than p ossible ~ A . Let Q = p ossible ~ A ( Q ′ ) and let the ind uction h yp othesis hold for Q ′ , i.e., [ [ Q ′ ] ] ( A ,V ) W = [ [ Q ′ ] ] A W ′ . Then [ [p ossible ~ A ( Q ′ )] ] ( A ,V ) W = n [ R ′ | ( B , V ′ ) ∈ W, R ′ ∈ [ [ Q ′ ] ] ( B ,V ′ ) W , π ~ A ( R ) = π ~ A ( R ′ ) | R ∈ [ [ Q ′ ] ] ( A ,V ) W o = n [ R ′ | V ′ ∈ W ′ , R ′ ∈ [ [ Q ′ ] ] B W ′ , π ~ A ( R ) = π ~ A ( R ′ ) | R ∈ [ [ Q ′ ] ] A W ′ o = [ [p ossible ~ A ( Q ′ )] ] A W ′ . No w w e apply the fact just pro ven to the sub queries Q j for j 6 = i . By definition, [ [let V := Q in θ ( Q 1 , . . . , Q k )] ] A W ′ = { [ [ θ ( Q 1 , . . . , Q k )] ] ( A ,V ) W | V ∈ [ [ Q ] ] A W ′ } . W e distinguish b et ween the v arious op erations θ . F or relational alge bra, [ [ θ ( Q 1 , . . . , Q k )] ] ( A ,V ) W = n θ ( R 1 , . . . , R k ) | ^ j R j ∈ [ [ Q j ] ] ( A ,V ) W o = n θ ( R 1 , . . . , R k ) | R i ∈ [ [ Q i ] ] ( A ,V ) W , ^ j 6 = i R j ∈ [ [ Q j ] ] A W ′ o b ecause V only o ccurs in Q i and [ [ Q j ] ] ( A ,V ) W = [ [ Q j ] ] A W ′ for j 6 = i . Thus [ [let V := Q in θ ( Q 1 , . . . , Q k )] ] A W ′ = n θ ( R 1 , . . . , R k ) | R i ∈ [ [ Q i ] ] ( A ,V ) W , V ∈ [ [ Q ] ] A W ′ | {z } R i ∈ [ [let V := Q in Q i ] ] A W ′ , ^ j 6 = i R j ∈ [ [ Q j ] ] A W ′ o = [ [ θ ( Q 1 , . . . , Q i − 1 , (let V := Q in Q i ) , Q i +1 , . . . , Q k )] ] A W ′ The pro of for the remaining op erations pro ceeds similarly . ✷ In other words, they can b e considered “gl obal”. That is, w ith ou t loss of generalit y we could assume that eac h WSA query is of the form let V 1 := Q 1 in ( · · · (le t V k := Q k in Q ) · · · ) where Q do es not con tain definitions. Observe that in th e ca se of b inary relat ional algebra op er ations θ , the set of p ossible w orld s [ [ Q 1 θ Q 2 ] ] A W is obtained by pairing relations in the results of [ [ Q 1 ] ] A W and [ [ Q 2 ] ] A W . This is consisten t with the int uition that θ is applied to p ossible worlds B that contai n tw o relations R B 1 and R B 2 and the r esult in B is R B 1 θ R B 2 : Pr op osition 3.1 implies that θ ( Q 1 , . . . , Q k ) = let V 1 := Q 1 , . . . , V k := Q k in θ ( V 1 , . . . , V k ) . As a con ven tion, we use {hi} to represent truth and ∅ to represent falsit y , ov er a nullary relation sc hema. 5 Example 3.2 Giv en a relational database w ith relations V ( V ) and E ( F r om , T o ) repr e- sen ting a graph (directed, or un directed if E is symmetric). Th en the follo wing WSA query Q returns true iff the graph is 3-colorable: let R := repair-key sch ( V ) V × ρ C { r } ∪ { g } ∪ { b } in p ossible ∅ {hi} − π ∅ ( σ 1 .V =2 . F r om ∧ 2 . T o =3 .V ∧ 1 .C = 3 .C ( R × E × R )) . The p ossible relations R are all the functions V → { r , g , b } , and Q s imply asks whether there is su c h a f u nction R su c h that there do n ot exist t w o ad j acen t no des of the same color. The corresp onding SO sen tence is ∃ R φ R : V →{ r , g ,b } ∧ ¬ ∃ u, v , c R ( u, c ) ∧ E ( u, v ) ∧ R ( v , c ) where φ R : V → { r,g,b } is a first-order sent ence that states that R is a relation ⊂ V × { r , g , b } that satisfies the functional d ep enden cy R : V → { r, g, b } . ✷ 3.2 Deriv ed Op erations: Syn tactic Sugar W e will also consider the follo wing op er ations, wh ic h are definable in th e base language: [ [subset( Q )] ] A W := { R ′ | R ′ ⊆ R ∈ [ [ Q ] ] A W } [ [c hoice-of ~ A ( Q )] ] A W := { π ~ A = ~ a ( R ) | R ∈ [ [ Q ] ] A W , ~ a ∈ π ~ A ( R ) } [ [certai n ~ A ( Q )] ] A W := T R ′ | B ∈ W , R ′ ∈ [ [ Q ] ] B W , π ~ A ( R ) = π ~ A ( R ′ ) | R ∈ [ [ Q ] ] A W [ [p ossible( Q )] ] A W := S R | B ∈ W , R ∈ [ [ Q ] ] B W [ [certai n( Q )] ] A W := T R | B ∈ W , R ∈ [ [ Q ] ] B W The op eration sub set nond eterministically c ho oses an arbitrary su bset of its inp ut r ela- tion. The op eration choice -of ~ A ( R ) nondeterministically chooses an ~ a ∈ π ~ A ( R ) and selects those tup les ~ t of R f or which ~ t. ~ A = ~ a . Conceptually , the op erations sub set and rep air-k ey cause an exp onentia l blo w up of the p ossible worlds u n der consideration: for instance, on a ce rtain database (i.e. , consisting of a s in gle p ossible world) s ubset( R ) creates the p o w- erset of relation R as the new set of p ossible w orlds. The op eration certain ~ A is the dual of p ossible ~ A and computes th ose tuples common to all the wo rlds that agree on π ~ A . The op erations p ossible an d certain compute the p ossible resp ectiv ely certain tuples across al l p ossible w orld s. Prop osition 3.3 The op er ations subset and p ossible ar e expr essible in WSA without defi- nitions. The op er ations choic e-of ~ A , c ertain ~ A , and c ertain ar e definable in WSA with defi- nitions. Pro of Sk etc h. The result is an immediate consequence of th e follo wing equiv alences. c hoice-of ~ A ( R ) = R ⊲ ⊳ repair-ke y ∅ ( π ~ A ( R )) . certain ~ A ( Q ) = Q − p ossible ~ A p ossible ~ A ( Q ) − Q subset( R ) = π sch ( R ) ( σ A =1 (repair-k ey sch ( R ) ( R × ρ A ( { 0 , 1 } )) )) (w.l.o.g., A 6∈ s ch ( R )). p ossible( Q ) = p ossible ∅ ( Q ) certain( Q ) = certain ∅ ( Q ) 6 Compan y Emp C E c 1 e 11 c 1 e 12 c 2 e 21 c 2 e 22 c 2 e 23 Emp Skills E S e 11 s 1 e 12 s 1 e 21 s 2 e 21 s 1 e 22 s 3 e 23 s 2 ( a ) U 1 C E c 1 e 11 U 2 C E c 1 e 12 U 3 C E c 2 e 21 U 4 C E c 2 e 22 U 5 C E c 2 e 23 ( b ) V 1 C E c 1 e 12 V 2 C E c 1 e 11 V 3 C E c 2 e 22 c 2 e 23 V 4 C E c 2 e 21 c 2 e 23 V 5 C E c 2 e 21 c 2 e 22 ( c ) W 1 C S c 1 s 1 W 2 C S c 1 s 1 W 3 C S c 2 s 2 W 4 C S c 2 s 2 W 5 C S c 2 s 2 ( d ) Figure 1: Database (a) and in termediate query results (b-d) of E xample 3.5. The expr ession p ossible ∅ ( Q ) compu tes the p ossible tuples of those worlds in which the result of Q in nonemp t y . B ut, obviously , in the remaining worlds there are no tuples to collect. By the defin ition of certain Q in terms of p ossible Q , the defin ition of certain is correct to o. ✷ Remark 3.4 The op eration repair-key is also definable usin g the b ase op erations without repair-k ey plus subset; ho w ever, suc h a d efinition seems to need le t-statemen ts, while the definition of subset using repair-k ey do es not. In [3], it was s h o wn that the fragmen t obtained from WSA by replacing repair-k ey b y c h oice-of is a conserv ativ e extension of fir s t-order logic. That is, eve ry query of that language that maps from a single p ossible w orld to a single p ossible wo r ld is equiv alen t to a first-order query . It is not surpr ising that this is not true f or full WSA. 3.3 A Hyp othetical Query P ro cessing Example Example 3.5 Consider the relational database of Figure 1(a) whic h r epresen ts emplo y ees w orkin g in companies and their skills. The query , a simplified decision sup p ort problem, will b e stated in four steps. 1. Supp ose I cho ose to buy exactly one compan y and, as a consequence, exactly one (k ey) emplo y ee lea v es that compan y . U := choic e of C,E (Compan y Emp) (This nondeterministically c ho oses a tuple from Compan y Emp.) 7 2. Who are the remaining emplo yees? V := π 1 .C, 2 .E ( U ⊲ ⊳ 1 .C =2 .C ∧ 1 .E 6 =2 .E Compan y Emp) 3. If I acquire that compan y , whic h skills can I obtain for c ertain ? W := certain C ( π C,S ( V ⊲ ⊳ Emp Skills)) (This query compu tes the tuples of V ⊲ ⊳ Emp Skills that are certain assuming that the company was c h osen correctly – i.e., certain in the set of p ossible worlds that agree with this w orld on the C column.) 4. No w list the p ossible acquisition targets if the gain of the skill s 1 shall b e guaran teed b y the acquisition. p ossible( π C ( σ S = s 1 ( W ))) Figure 1(b-d ) sho w s the deve lopmen t of the uncertain d atabase through steps 1 to 3. The fi rst step creates five p ossible worlds corresp ond ing to the five p ossible c h oices of compan y and renegade emp lo ye e from relation Company Emp . Steps tw o to four further pro cess the query , and the o v erall result, whic h is the same in all fiv e p ossible worlds, is Result C c 1 ✷ 4 WSA with Definitio ns Captures SO Logic In this section, it is shown that WSA with definitions has exactly the same expressive p o we r as second-order logic o v er finite structures. Theorem 4.1 F or every SO query, ther e is an e qui v alent WSA query with definitions. Pro of. W e ma y assu me without loss of generalit y that the SO query is a first-order query prefixed by a sequence of second-order quan tifi er s . The prop osition follo ws from in d uction. Induction start: FO queries can b e translated to relational algebra by a well -kno wn translation kno wn in the d atabase con text as one direction of Co dd’s Theorem (cf. [1 ]). Induction step (second-order existen tial qu an tification, ∃ R k +1 ( ⊆ D l ) φ ): Let φ b e an SO form u la with free second-order v ariables R 1 , . . . , R k +1 and free fi rst-order v ariables ~ x wh ere R k +1 has arity l . Let Q φ b e an equiv alen t WSA expression. Without loss of generalit y , w e ma y assum e th at the relatio ns R 1 , . . . , R k , Q φ ha ve disjoin t schemas. Let Q := (let R k +1 := s ubset( D l ) in π sch ( Q ) (p ossible sch ( R 1 ) ...sch ( R k ) (1 R 1 × · · · × 1 R k × Q φ ))) . where 1 R i = R i × { 1 } ∪ ( D ar ( R i ) − R i ) × { 0 } . (Note that the relations 1 R i will play a prominent role in later parts of this p ap er.) W e pro v e that ( R 1 , . . . , R k , ~ x ) ∃ R k +1 ( ⊆ D l ) φ ⇔ ~ x ∈ R Q where { R Q } = [ [ Q ] ] ( R 1 ,...,R k ) W . By definition of [ [ · ] ], [ [ Q ] ] ( R 1 ,...,R k ) W = π sch ( Q φ ) ([ [ Q ′ ] ] ( R 1 ,...,R k +1) W ′ ) | R k +1 ⊆ D l 8 where W ′ = { ( R 1 , . . . , R k +1 ) | ( R 1 , . . . , R k ) ∈ W , R k +1 ⊆ D l } and Q ′ is a shortcut f or p ossible sch ( R 1 ) ...sch ( R k ) (1 R 1 × · · · × 1 R k × Q φ ). W e ma y assume a nonempty domain D , so the result of 1 R 1 × · · · × 1 R k is never empt y , the mapping ( R 1 , . . . , R k ) 7→ 1 R 1 × · · · × 1 R k is injectiv e, and Q will therefore group the p ossible outcomes of Q φ for the v arious choic es of R k +1 b y R 1 , . . . , R k . F ormally , b y definition of [ [ · ] ], [ [ Q ′ ] ] ( R 1 ,...,R k +1 ) W ′ = n [ 1 R 1 × · · · × 1 R k × [ [ Q φ ] ] ( R 1 ,...,R k ,R ′ k +1 ) W ′ | ( R 1 , . . . , R k , R ′ k +1 ) ∈ W ′ | ( R 1 , . . . , R k +1 ) ∈ W ′ o = n 1 R 1 × · · · × 1 R k × [ [ [ Q φ ] ] ( R 1 ,...,R k ,R ′ k +1 ) W ′ | R ′ k +1 ⊆ D l o . Th us, in a given world ( R 1 , . . . , R k ), Q pro duces exac tly one wo r ld as the r esult, [ [ Q ] ] ( R 1 ,...,R k ) W = n [ [ [ Q φ ] ] ( R 1 ,...,R k ,R ′ k +1 ) W ′ | R ′ k +1 ⊆ D l o = { R Q } and this captures exactly second-order existentia l qu an tification. The WSA expression for un iv ersal second-order quan tifiers ∀ R k +1 ( ⊆ D l ) φ is similar. Alternativ ely , ∀ R k +1 φ can also b e tak en as ¬ ∃ R k +1 ¬ φ , wh ere complementa tion w ith resp ect to D is straight forw ard using the difference op eration. ✷ Example 4.2 Σ 2 -QBF is th e follo win g Σ P 2 -complete decision p roblem. Giv en tw o d isjoin t sets of pr op ositional v ariables V 1 and V 2 and a DNF formula φ o ve r the v ariables of V 1 and V 2 , do es th ere exist a truth assignment for the v ariables V 1 suc h that φ is true for all truth assignmen ts for the v ariables V 2 ? Instances of this p roblem s hall b e represente d by sets V 1 and V 2 , a set C of ids of clauses in φ , and a ternary relation L ( C, P , S ) suc h that h c, p, 1 i ∈ L (resp., h c, p, 0 i ∈ L ) iff prop ositional v ariable p occurs p ositiv ely (resp., negativ ely) in clause c of φ , i.e., φ = _ c ∈ C ^ h c,p, 1 i∈ L p ∧ ^ h c,p, 0 i∈ L ¬ p. The QBF is tru e iff second-order sentence ∃ P 1 ( P 1 ⊆ V 1 ) ∧ ∀ P 2 ( P 2 ⊆ V 2 ) ⇒ ψ is true, where ψ is th e first-order sen tence ∃ c ¬∃ p L ( c, p, 0) ∧ ( P 1 ( p ) ∨ P 2 ( p )) ∨ L ( c, p, 1) ∧ ¬ ( P 1 ( p ) ∨ P 2 ( p )) . whic h asserts the truth of φ : that there is a clause c in φ of whic h n o literal is inconsistent with the truth assignm ent p 7→ ( p ∈ P 1 ∪ P 2 ). By Theorem 4.1, this can b e expressed as the Bo olean WSA query let P 1 := s ubset( V 1 ) in p ossible {hi} − let P 2 := subs et( V 2 ) in p ossible sch ( P 1 ) (1 P 1 × ( {hi} − Q )) where Q = π ∅ C − π C ( σ S =0 ( L ) ⊲ ⊳ ( P 1 ∪ P 2 )) ∪ ( σ S =1 ( L ) ⊲ ⊳ (( V 1 ∪ V 2 ) − ( P 1 ∪ P 2 ))) is relational algebra for ψ . ✷ 9 F or the conv erse result, we m ust first make pr ecise ho w second-order log ic will b e compared to WSA, since second-order logic queries are u sually not “run” on uncertain databases. W e will consider WSA queries that are ev aluated against a (single-w orld) re- lational d atabase A r epresen ting an uncertain database (e.g., usin g the standard repre- sen tation of E xample 2.1). W e already kno w that arbitrary uncertain databases (that is, nonempt y finite sets of p ossible w orlds) can b e s o represented, and this assumption means no loss of generalit y . The query constructs the uncertain database fr om the represen tation and is alw a ys ev aluated as [ [ Q ] ] A {A} , precisely as s ketc hed at the end of Section 2. Theorem 4.3 F or every WSA query, ther e is an e quivalent se c ond-or der lo gic query. Pro of Sk etc h. The pr o of rev olves around the d efinition of a fun ction [ [ · ] ] so that maps eac h WSA expression Q to an S O form u la [ [ Q ] ] so with free second-order v ariables ~ R and R Q and without free fi rst-order v ariables such that [ [ Q ] ] so and Q are equiv alen t in the sense that [ [ Q ] ] so is true on stru ctur e ( A , ~ R, R Q ) iff R Q is among the p ossible resu lts of Q starting from p ossible wo r ld ( A , ~ R ). W e can state this notion of correctness, w hic h is the hypothesis of the follo wing in duction along the str ucture of the WSA expression, formally as ( A , ~ R, R Q ) [ [ Q ] ] so ⇔ R Q ∈ [ [ Q ] ] ( A , ~ R ) W for W = n ( A , ~ R ) | ( A , ~ R ) ^ V in ~ R ψ V o . Here the free second-order v ariables ~ R are also the names of th e views defined (using let- expressions) along the path from the ro ot of the p arse tree of th e query to th e sub expression Q . A formula ψ V is iden tified by the name of the view relation V , assu m ing without loss of generalit y th at eac h view name is in tro d u ced only once by a let expression across the en tire query . The formula e ψ V will b e defined b elo w. F or the op erations θ of relational algebra, [ [ θ ( Q 1 , . . . , Q ar ( θ ) )] ] so ( ~ R, R Q ) := ∃ R Q 1 · · · R Q ar ( θ ) ar ( θ ) ^ i =1 [ [ Q i ] ] so ( ~ R, R Q i ) ∧ ∀ ~ x R Q ( ~ x ) ⇔ φ θ ( Q 1 ,...,Q ar ( θ ) ) ( ~ x ) where 0 ≤ ar ( θ ) ≤ 2 and φ S ( ~ x ) := S ( ~ x ), wher e S is either a relation from A or a second- order v ariable from ~ R , φ { ~ t } ( ~ x ) := ~ x = ~ t , φ Q 1 ∪ Q 2 ( ~ x ) := R Q 1 ( ~ x ) ∨ R Q 2 ( ~ x ), φ Q 1 − Q 2 ( ~ x ) := R Q 1 ( ~ x ) ∧ ¬ R Q 2 ( ~ x ), φ Q 1 × Q 2 ( ~ x, ~ y ) := R Q 1 ( ~ x ) ∧ R Q 2 ( ~ y ), φ σ γ ( Q ) ( ~ x ) := R Q ( ~ x ) ∧ γ , φ π ~ x ( Q ) ( ~ x ) := ∃ ~ y R Q ( ~ x, ~ y ), and φ ρ ~ x → ~ y ( Q ) ( ~ y ) := ∃ ~ x R Q ( ~ x ) ∧ ~ x = ~ y . It is easy to ve rify th at for any tuple ~ x and relational algebra op eration θ , ( A , R Q 1 , . . . , R Q ar ( θ ) ) φ θ ( Q 1 ,...,Q ar ( θ ) ) ( ~ x ) if and only if ~ x is a result tuple of relational algebra qu ery θ ( R Q 1 , . . . , R Q ar ( θ ) ). Assume that the induction h y p othesis holds for the sub queries Q 1 , . . . , Q ar ( θ ) , i.e., ( A , ~ R, R Q i ) [ [ Q i ] ] so if and only if R Q i ∈ [ [ Q i ] ] ( A , ~ R ) W for 1 ≤ i ≤ ar ( θ ). Th e formula [ [ θ ( Q 1 , . . . , Q ar ( θ ) )] ] so just s tates that R Q is a r elation consisting of exactly th ose tuples ~ x that satisfy φ θ ( Q 1 ,...,Q ar ( θ ) ) ( ~ x ) for a c hoice of p ossible resu lts R Q i ∈ [ [ Q i ] ] ( A , ~ R ) W of the sub queries Q i , for 1 ≤ i ≤ ar ( θ ). But this is exactly the definition of [ [ θ ( Q 1 , . . . , Q ar ( θ ) )] ] ( A , ~ R ) W . 10 This in particular co ve rs the n ullary op erations of relational algebra ( { ~ t } and R ), which form the induction start. The remaining op erations are those sp ecial to WSA (with defin itions): [ [su bset( Q 1 )] ] so ( ~ R, R Q ) := ∃ R Q 1 [ [ Q 1 ] ] so ( ~ R, R Q 1 ) ∧ R Q ⊆ R Q 1 [ [rep air-k ey ~ A ( Q 1 )] ] so ( ~ R, R Q ) := ∃ R Q 1 [ [ Q 1 ] ] so ( ~ R, R Q 1 ) ∧ R Q ⊆ R Q 1 ∧ ~ A is a key f or R Q ∧ ¬∃ R ′ Q R Q ⊂ R ′ Q ⊆ R Q 1 ∧ ~ A is a key f or R ′ Q [ [let V := Q 1 in Q 2 ] ] so ( ~ R, R Q ) := ∃ V ψ V ∧ [ [ Q 2 ] ] so ( ~ R, V , R Q ) and define ψ V := [ [ Q 1 ] ] so ( ~ R, V ) [ [p ossible ~ A ( Q 1 )] ] so ( ~ R, R Q ) := ∃ R Q 1 [ [ Q 1 ] ] so ( ~ R, R Q 1 ) ∧ ∀ ~ x R Q ( ~ x ) ⇔ ∃ ~ R ^ V in ~ R ψ V ∧ ∃ R ′ Q 1 [ [ Q 1 ] ] so ( ~ R, R ′ Q 1 ) ∧ π A ( R Q 1 ) = π A ( R ′ Q 1 ) ∧ R ′ Q 1 ( ~ x ) where “ ~ A is a key f or R ” and π ~ A ( · ) = π ~ A ( · ) are easily expr essible in F O. It is straightfo rw ard to v erify the correctness of [ [ · ] ] so for sub set and repair-k ey : The definitions of [ [ · ] ] so and [ [ · ] ] essen tially coincide. Similarly , the correctness of the definition of [ [ · ] ] so for let is easy to ve rify . Here w e also define the form ulae ψ V . Finally , [ [p ossible ~ A ( Q 1 )] ] so mak es reference to w orld-set W and for that p urp ose uses the formulae ψ V : Indeed, the worlds in W are exactly those structures that satisfy all the ψ V for relations V defined b y let expressions on the path from the ro ot of the query to the current sub expr ession p ossible ~ A ( Q 1 ). The definition [ [p ossible ~ A ( Q 1 )] ] so is again v ery close to the definition of [ [p ossible ~ A ( Q 1 )] ], and its correctness is straigh tforward to v erify . Note that by eliminating the defin itions ψ V w e in general obtain an exp onential- size form u la. ✷ 5 In termezzo: Why w e are not done The pr o of that WSA with definitions can express an y SO query m ay seem to settle the expressiv eness question for our language. Ho wev er, un derstanding WSA without defin itions is also imp ortan t, for t w o r easons. First, it is a commonplace an d desirable p rop erty of query algebras that th ey b e comp ositional, i.e., that th e p ow er to define views is not needed for th e expressive p o wer, and all v iews can b e eliminated by comp osing the qu ery . Second, if this p rop erty do es not hold, it m eans that in general we hav e to pr ecompute and materialize views. And ind eed, su p erfi cially w e w ould exp ect that WSA is not comp ositional in that resp ect: it supp orts nondeterministic op erations (repair-ke y and/or sub s et). If a view definition V con tains su c h a n ondeterministic op eration and a query uses V at least t wice, rep lacing eac h o ccur rence with th e definition will n ot b e equiv alen t b ecause the tw o copies of the definition of V will pro duce differen t relations in some wo rlds. F or example, (let V := subset( U ) in V ⊲ ⊳ V ) is not at all equiv alen t to subset( U ) ⊲ ⊳ sub set( U ). 11 The question remains whether for eac h WSA query th ere is an equiv alen t query in WSA without defi n itions via a less dir ect rewriting. T h e answ er to this question is less ob vious. Our language defin ition has assumed repair-key to be the base op eration an d su bset de- finable us ing WSA with repair-ke y. Indeed, in WSA with definitions, either one can b e defined using the other. How ev er, it can b e sho wn that repair-k ey cannot b e expressed using subset without using defi n itions even though subset can guess subsets and app ears comparable in expressiv eness to repair-ke y. Consider p ossib le w orlds databases in which eac h relation is ind ep endent fr om th e other relations, i.e., the w orld set is of the form { ( R 1 , . . . , R k ) | R 1 ∈ W 1 , . . . , R k ∈ W k } . WSA without definitions on su c h r elation-indep endent datab ases giv es rise to a m u c h simpler and more int uitiv e seman tics definition than th e one of S ection 3 , via the follo win g fun ction [ [ · ] ] ndef . [ [ θ ] ] ndef ( W 1 , . . . , W ar ( θ ) ) := { θ ( R 1 , . . . , R ar ( θ ) ) | R 1 ∈ W 1 , . . . , R ar ( θ ) ∈ W ar ( θ ) } . . . where θ is an op er ation of relational algebra [ [rep air-k ey ~ A ] ] ndef ( W ) := { R | R ⊆ R ′ ∈ W, π A ( R ) = π A ( R ′ ) , ~ A is a key f or R } [ [su bset] ] ndef ( W ) := { R | R ⊆ R ′ ∈ W } [ [p ossible ~ A ] ] ndef ( W ) := n [ { R ′ ∈ W | π ~ A ( R ) = π ~ A ( R ′ ) } | R ∈ W o The correctness of this alternativ e semantics definition, stated n ext, is easy to verify . Prop osition 5.1 F or r elation-indep endent data b ases and WSA without definitions, [ [ · ] ] ndef is e quivalent to [ [ · ] ] in the sense that for any op er ation θ , { [ [ θ ( Q 1 , . . . , Q ar ( θ ) )] ] A W | A ∈ W } = [ [ θ ] ] ndef ( W 1 , . . . , W ar ( θ ) ) wher e W i = S { [ [ Q i ] ] A W | A ∈ W } for al l 1 ≤ i ≤ ar ( θ ) . The follo wing result asserts th at adding su bset to relational algebra yields little expr es- siv e p o w er. By the existence of sup rem u m of a set of w orlds W , we assert the existence of an elemen t ( S W ) ∈ W , den oted sup( W ). An infimum is a set inf( W ) := ( T W ) ∈ W . Theorem 5.2 Any world-set c omputable using r elational algebr a extende d by the op er ation subset has a supr emum and an infimum. Pro of. Th e nulla ry relational algebra exp ressions ( { ~ t } and R ) yield just a singleton world- set, and the single wo rld is b oth the su premum and the infim um. Giv en a w orld -set W , sup([ [su bset] ] ndef ( W )) := sup( W ) and in f([ [subs et] ] ndef ( W )) := ∅ . F or a p ositiv e re- lational algebra expression θ , sup([ [ θ ] ] ndef ( W 1 , . . . , W k )) := θ (su p( W 1 ) , . . . , sup( W k )) and inf([ [ θ ] ] ndef ( W 1 , . . . , W k )) := θ (inf( W 1 ) , . . . , inf( W k )). F or relational difference, it can b e v erified that s u p([ [ − ] ] ndef ( W 1 , W 2 )) := su p( W 1 ) − inf( W 2 ) and inf([ [ − ] ] ndef ( W 1 , W 2 )) := inf( W 1 ) − su p( W 2 ). It is easy to verify the co rrectness of these definitions, and together they yield the theorem. ✷ Th us, not ev en repair-key ∅ ( { 0 , 1 } ) = { 0 } , { 1 } can b e defined. 12 Corollary 5.3 The set of worlds { 0 } , { 1 } is not definable in r elational algebr a extende d by subset. In con trast, r ep air-k ey sch ( U ) ( U × { 0 , 1 } ) can b e defined as follo ws in the language f rag- men t of r elational alge b ra plus subs et if definitions are a v ailable: let R := s u bset( U ) in ( R × { 1 } ∪ ( U − R ) × { 0 } ) . Th us, remo v in g defin itions seems to cause a sub stan tial red uction of expressive p o wer. In the remainder of th is pap er, w e stud y wh ether p ossible ~ A and r epair-k ey can offset th is. Before we mo ve on , another simp le result shall b e stated that gives an intuition for the apparen t weakness of WSA without d efinitions. If a view is d efined by a query that inv olv es one of the nondeterministic op erations (possib le ~ A or rep air-k ey), then this view can only b e used at one p lace in the qu er y if the qu ery is to b e comp osed with the view. Ho w ever, subsequent relational algebra op erations will b e monotonic with resp ect to that v iew. Prop osition 5.4 L et Q b e a nonmonotonic r elational algebr a query that is bu ilt using a r elation R and c onstant r elations. Then R o c curs at le ast twic e in Q . Pro of. Assume a r elational algebra query tree exists that expr esses Q and in whic h R only o ccurs as a single leaf. Th en the path from that leaf tow ards the ro ot op eration consists of unary op erations and op erations Q 1 θ Q 2 where Q 1 con tains R and Q 2 has only constant relations as lea v es: Q 2 is constant. So Q 1 θ Q 2 can b e th ough t of as a unary op eration. But all unary operations θ are monotonic, i.e., if X ⊆ Y , then θ ( X ) ⊇ θ ( Y ) for the family of op erations ( C − X ) C const ., sch ( C )= sch ( X ) and θ ( X ) ⊆ θ ( Y ) for all other op erations. It f ollo ws that Q , a sequ en ce of suc h op erations, is also monotonic. ✷ 6 WSA without Definitions Expresses all of SO Logic As the main tec hn ical resu lt of the p ap er, w e no w sho w th at WS A without defin itions (but usin g repair-key as in our language defin ition), captures all of SO. It follo w s that definitions, despite our n ondeterministic op erations, do n ot add p o wer to the language. This is surprising giv en Theorem 5.2. 6.1 Indicator Relations Let U b e a nonempty relation (the universe ) and let R ⊆ U . Then the indicator fun ction 1 R : U → { 0 , 1 } is defined as 1 R : x 7→ 1 . . . x ∈ R 0 . . . x 6∈ R The corresp onding indicator relation is just the relation {h x, 1 R ( x ) i | x ∈ U } whic h, obvi- ously , has fun ctional dep en dency U → { 0 , 1 } . Su b sequent ly , we will alwa ys use indicator relations rather than indicato r fu nctions and will denote them by 1 R as w ell. By our assumption that U 6 = ∅ , indicator relations are alw ays nonempt y . Giv en relatio ns R and U with R ⊆ U 6 = ∅ , the in d icator relation 1 R w.r.t. universe U can b e constructed in r elational algebra as ind( R, U ) := ( R × { 1 } ) ∪ (( U − R ) × { 0 } ) . 13 The expression repair-k ey sch ( U ) ( U × { 0 , 1 } ) is equiv alen t to let R := subs et( U ) in in d( R, U ) and yields an indicator relatio n in eac h p ossible w orld. Indicator r elations ha v e the nice p rop erty that their complemen t can b e computed using a conjunctiv e query (with an inequalit y), 1 U − R = ( U × { 0 , 1 } ) − 1 R := π 1 , 2 ( σ 1=3 ∧ 2 6 =4 ( U × { 0 , 1 } × 1 R )) . Let R denote the complemen t of relation R and let U i = R i ∪ R i , called the universe of R i . Note that R 1 × · · · × R k = k [ i =1 U 1 × · · · × U i − 1 × R i × U i +1 × · · · × U k . The complemen t of a pro d uct ~ 1 := 1 R 1 × · · · × 1 R k can b e ob tained as compl U 1 ,...,U k ( ~ 1) = ( U 1 × { 0 , 1 } × · · · × U k × { 0 , 1 } ) − ~ 1 = π A 1 ,B 1 ,...,A k ,B k ( σ W i ( A i = A ′ i ∧ B i 6 = B ′ i ) ( ρ A ′ 1 B ′ 1 ...A ′ k B ′ k ( ~ 1) × ρ A 1 B 1 ...A k B k ( U 1 × { 0 , 1 } × · · · × U k × { 0 , 1 } ))) . if, for eac h 1 ≤ i ≤ k , U i is the univ erse of R i . Moreo ver, Lemma 6.1 The k - times pr o duct of 1 R , denote d by (1 R ) k U := k times z }| { 1 R × · · · × 1 R , c an b e e x- pr esse d as a r elational algebr a expr ession in which 1 R only o c curs onc e. Pro of. Let U b e the univ erse of R . (1 R ) k U = ρ A 1 B 1 ...A k B k (( U × { 0 , 1 } ) k ) − compl U k (1 k R ) = ρ A 1 B 1 ...A k B k (( U × { 0 , 1 } ) k ) − π A 1 ,B 1 ,...,A k ,B k ( σ W 1 ≤ i ≤ k ( A 1 = A ′ ∧ B i 6 = B ′ ) ( ρ A 1 B 1 ...A k B k (( U × { 0 , 1 } ) k ) × ρ A ′ B ′ (1 R ))) . ✷ As a con ve n tion, let S 0 = {hi} for nonempt y relations S . In particular, (1 R ) 0 U = {hi} . 6.2 The Quan tifier-F ree Case By quantifier-free formulae we will d enote formulae of pr edicate logic that ha v e n either first- nor second-order quan tifiers. Lemma 6.2 L et φ b e a quantifier-fr e e formula with r elations ~ R . Then φ c an b e tr anslate d in line ar time into a formula ∃ ~ x α ∧ β , wher e α is a Bo ole an c ombination of e qualities and β is a c onjunction of r elational liter als, which is e quivalent to φ on structur es in which e ach r elation of ~ R and its c omplement ar e nonempty. 14 Pro of Sk etc h . L et R 1 , . . . , R s the set of distinct predicates (relation names) o ccurring in φ . First push negations in φ do wn to the atomic form ulae using De Morgan’s la ws and the elimination of double negati on and replace relational atomic form ulae ¬ R j ( ~ t ), where ~ t is a tuple of v ariables and constant s, by R j ( ~ t ). No w apply the follo wing trans lation inductive ly b ottom-up. The translati on is the iden tity on inequalit y literals. Rewrite atomic formulae R j ( ~ t ) into ∃ ~ v j 1 ~ v j 1 = ~ t ∧ R j ( ~ v j 1 ) and atoms R j ( ~ t ) in to ∃ ~ w j 1 ~ w j 1 = ~ t ∧ R j ( ~ w j 1 ). Let γ j,m,m ′ = m ^ k =1 R j ( ~ v j k ) ∧ m ′ ^ k =1 R j ( ~ w j k ) . A subformula ψ 1 ∨ ψ 2 (resp., ψ 1 ∧ ψ 2 ) with ψ i = ∃ ~ v ~ w α i ∧ s ^ j =1 γ j,n ij ,n ′ ij is turned in to ∃ ~ v ~ w α ∧ s ^ j =1 γ j,m j ,m ′ j where m j = max( n 1 j , n 2 j ), m ′ j = max( n ′ 1 j , n ′ 2 j ) and α = α 1 ∨ α 2 (resp., m j = n 1 j + n 2 j , m ′ j = n ′ 1 j + n ′ 2 j , α = α 1 ∧ α ′ 2 , and α ′ 2 is obtained fr om α 2 b y replacing eac h v ariable v j k l b y v j ( k + n 1 j ) l and eac h v ariable w j k l b y w j ( k + n 1 j ) l ). F or the equiv alence of the rewritten f orm u la to φ , it is only necessary to p oin t out that since all the relatio ns R j and R j are nonempt y , ψ i is equiv alen t to ∃ ~ v ~ w α i ∧ s ^ j =1 γ j,m j ,m ′ j . It is not hard to v erify that th e translation can indeed b e imp lemented to run in linear time and that the rewritten formula is of the form claimed in the lemma. ✷ Theorem 6.3 F or any quantifier-fr e e formula ther e is an e quiv alent expr ession in WSA over uni v erse r elations and indic ator r elations in which e ach indic ator r elation only o c curs onc e. Pro of Sk etc h. Assu me R 1 , . . . , R s are all the pred icates o ccurr ing in the formula. By Lemma 6.2, w e only need to consider form ulae of synta x φ = ∃ ~ v ~ w α ∧ s ^ j =1 m j ^ k =1 R j ( ~ v j k ) ∧ m ′ j ^ k =1 ¬ R j ( ~ w j k ) where α do es not con tain relational atoms if eac h r elation R j is nonempt y and different from U j . Such a formula φ is equiv alen t to ∃ ~ v ~ w ~ t ~ t ′ α ′ ∧ s ^ j =1 m j ^ k =1 1 R j ( ~ v j k , t j k ) ∧ m ′ j ^ k =1 1 R j ( ~ w j k , t ′ j k ) 15 with α ′ = α ∧ s ^ j =1 m j ^ k =1 t j k = 1 ∧ m ′ j ^ k =1 t ′ j k = 0 . This is true b ecause R j ( ~ v j k ) is equiv alen t to 1 R j ( ~ v j k , 1) and ¬ R j ( ~ w j k ) is equiv alen t to 1 R j ( ~ w j k , 0). Obtaining formulae of this form is indeed feasible b ecause 1 R j 6 = ∅ and 1 R j 6 = U j . Let ~ x b e the fr ee v ariables of the formula. Th e WSA expression is π ~ x ( σ α ′ ( B 1 × · · · × B s )) with B j := ρ ~ v j 1 t j 1 ...~ v j m j t j m j ~ w j 1 t ′ j 1 ... ~ w j m ′ j t ′ j m ′ j (1 R j ) m j + m ′ j U j . Eac h B j computes an ( m j + m ′ j )-times pro d uct of 1 R j using the tec hn ique of Lemma 6.1 whic h j ust u s es one o ccurr ence of 1 R j . All the r elations 1 R j only o ccur once. T his p ro ves the theorem. ✷ Example 6.4 Consider an alternativ e enco ding of 3-co lorabilit y in WSA whic h is based on guessing a subset of relation U = V × ρ C ( { r , g , b } ). Then 3-colorabilit y is the problem of deciding th e SO sentence ∃ C ( ⊆ U ) ¬∃ v , w , c, c ′ φ 1 ∨ φ 2 ∨ φ 3 with φ 1 = E ( v , w ) ∧ C ( v , c ) ∧ C ( w, c ), φ 2 = C ( v , c ) ∧ C ( v , c ′ ) ∧ c 6 = c ′ , and φ 3 = ¬ C ( v, r ) ∧ ¬ C ( v , g ) ∧ ¬ C ( v , b ), i.e., φ 1 asserts that t w o neigh b oring no d es hav e the same colo r , φ 2 that a no de has simultaneously t wo colors, and φ 3 that a no d e has not b een assigned any color at all. If neither is the case, w e h av e a 3-coloring of th e graph. Using Theorem 6.3, φ 1 ∨ φ 2 ∨ φ 3 b ecomes π = ( ψ 1 ∨ ψ 2 ∨ ψ 3 ) ∧ 1 C ( u 1 , c 1 , t 1 ) ∧ 1 C ( u 2 , c 2 , t 2 ) ∧ 1 C ( u 3 , c 3 , t 3 ) ∧ 1 E ( v , w , t 4 ) where ψ 1 = u 1 = v ∧ u 2 = w ∧ c 1 = c 2 ∧ t 1 = t 2 = t 4 = 1 ψ 2 = u 1 = u 2 ∧ c 1 6 = c 2 ∧ t 1 = t 2 = 1 ψ 3 = u 1 = u 2 = u 3 ∧ c 1 = r ∧ c 2 = g ∧ c 3 = b ∧ t 1 = t 2 = t 3 = 0; F ollo wing T h eorem 6.3, f orm u la π can b e tur ned in to WSA as Q π := σ ψ 1 ∨ ψ 2 ∨ ψ 3 ( ρ u 1 c 1 t 1 u 2 c 2 t 2 u 3 c 3 t 3 ((1 C ) 3 V ×{ r ,g , b } ) × ρ vw t 4 ( E )) where (1 C ) 3 V ×{ r,g ,b } denotes the WSA expression f or 1 C × 1 C × 1 C from Lemma 6.1. The complete SO sen tence can b e stated as ∃ 1 C (1 C : V × { r , g , b } → { 0 , 1 } ) ∧ ¬∃ u 1 c 1 t 1 u 2 c 2 t 2 u 3 c 3 t 3 v w t 4 π . If 1 C in Q π is replaced by r epair-k ey V , C ( V × ρ C ( { r , g , b } ) × ρ T ( { 0 , 1 } )) , this sen tence can b e turned in to WSA without definitions as p ossible( {hi} − π ∅ ( Q π )) . ✷ 16 6.3 Quan tification and Alternation Conceptually , in SO, there is no difference in th e treatment of second-order v ariables and relations coming fr om the input structure; an existen tial second-order quanti fier extends the structure o v er whic h the formula is ev aluated. In ou r algebra, ho wev er, w e ha ve to construct the p ossible alternativ e relatio ns for a second-order v ariable R at the b eginning of the bottom-up ev aluation of the alge bra expression using repair-k ey and ha ve to lat er test the existen tial quantifier ∃ R u sing the p ossible op eration grouping th e p ossible worlds that agree on R . F or that w e hav e to k eep R around during the ev aluation of the algebra expression. Selections also m us t not actually remo ve tuples b ecause this would mean that the in formation ab out whic h world the tuple is missing from would b e lost. F or example, the algebra expression corresp onding to a Boolean formula must not return f alse, but in some form m ust compute the pair h R, false i . Let φ b e an SO formula with free second-order v ariables R 1 , . . . , R k and free first-order v ariables x 1 , . . . , x l . Conceptually , our pro ofs will pro duce a WSA expression for φ that computes, in eac h p ossible world iden tifi ed by c hoices of rela tions R 1 , . . . , R k for th e free second-order v ariables, the r elation R 1 × · · · × R k × Θ where Θ is a repr esen tation of a mapping ~ a 7→ truth v alue of φ [ ~ x replaced b y ~ a ] . T ruth and falsit y cannot b e ju st r epresen ted b y 1 and 0, r esp ectiv ely , b ecause an existen tial first-order quantifier will effect a p ro jection on Θ whose result may cont ain b oth tru th v alues 1 and 0 for a v ariable assignment ~ a . Th u s, pro jection ma y map en vironmen ts for whic h φ is true toge ther with en vironments f or whic h φ is false. In th at case w e w ould like to remo v e the tuples for whic h the truth v alue encod ing is 0. Unfortunately , the function F : { 0 } 7→ { 0 } { 1 } 7→ { 1 } { 0 , 1 } 7→ { 1 } is nonmonotonic, and b y Prop osition 5.4 cann ot b e expressed in relational algebra if th e input relation is to o ccur in the query only once. F ortunately , w e d o not need su c h a function F . Definition 6.5 A PBIT (pr ote cte d bit) is either {⊥} (denoting 0) or {⊥ , 1 } (denoting 1). Giv en a Bo olean qu ery Q (i.e., Q return s either {hi } or ∅ ), P B I T ( Q ) := ( Q × { 1 } ) ∪ {⊥} . The negation of PBIT B is obtained by {⊥ , 1 } − ( B ∩ { 1 } ). The s et u nion on PBITs effects a logical OR, thus a relatio n ⊆ R × P B I T for w hic h h ~ a, 1 i ∈ R implies h ~ a, ⊥i ∈ R guar- an tees that pro jecting a wa y a column other than the r igh tmost corresp onds to existen tial quan tification. F or an SO formula φ with free second-order v ariables R 1 , . . . , R k and fr ee fir s t-order v ariables x 1 , . . . , x l , w e will define a WSA expression that compu tes th e relation T T ( φ ) := 1 R 1 × · · · × 1 R k × Θ 17 suc h that Θ = ( D l × {⊥} ) ∪ {h ~ a, 1 i | φ [ ~ x replaced b y ~ a ] is tru e } an d D is a domain relation con taining the p ossible v alues for the fir s t-order v ariables. (S o Θ can b e thought of as a mapping D l → P B I T .) T he complement of suc h a relation Θ is compl D l (Θ) := D l × {⊥ , 1 } − σ T =1 (Θ) . Next we obtain an auxiliary construction for complementing a Θ relatio n wh ile passing on the second-order r elation. Th is will b e the essentia l to ol for alternation. Lemma 6.6 L et P = 1 R 1 × · · · × 1 R k × Θ wher e Θ ⊆ D 1 × · · · × D l × P B I T . Ther e is a WSA expr ession without definitions for compl U 1 ,...,U k ; ~ D ,T ( S ) := 1 R 1 × · · · × 1 R k × compl(Θ) in which P only o c curs onc e. Pro of . Let s ch ( U i ) = A i and s ch (1 R i ) = A i B i . W e write ~ 1 for 1 R 1 × · · · × 1 R k and ~ U + for U 1 × · · · × U k × ρ B 1 ...B k ( { 0 , 1 } k ). A defin ition of compl U 1 ,...,U k ( ~ 1) w as given in Section 6.1. compl U 1 ,...,U k ; ~ D,T ( ~ 1 × Θ) = ~ 1 × ( D l × {⊥ , 1 } − σ T =1 (Θ)) = ( ~ U + × D l × ρ T ( {⊥ , 1 } )) − compl U 1 ,...,U k ( ~ 1) × D l × ρ T ( {⊥ , 1 } ) − ~ U + × σ T =1 (Θ) = ( ~ U + × D l × ρ T ( {⊥ , 1 } )) − π A 1 ,B 1 ,...,A k ,B k ,T ( σ W i ( A i = A ′ i ∧ B i 6 = B ′ i ) ∨ T ′ = T =1 ( ~ U + × ρ A ′ 1 B ′ 1 ...A ′ k B ′ k T ′ ( ~ 1 × Θ | {z } P ) × ρ T ( {⊥ , 1 } ))) . The final WSA expression is in the desired form. ✷ No w w e are ready to pro ve th e m ain result of this s ection. Theorem 6.7 Given a formula i n se c ond-or der lo gic, an e quivalent WSA expr ession with- out definitions c an b e c ompute d in line ar time in the size of the formula. Pro of Sketc h. The p ro of is b y indu ction. Given second-order formula φ with f ree first- order v ariables ~ x and zero or more fr ee second-order v ariables. Induction start: Assu m e th at φ is qu an tifier-fr ee. Consider the quan tifier-free form u la ψ ( ~ x, ~ y , t ) := ^ j : R j is an SO v ar . R j ( ~ y j ) ∧ φ ∨ t = ⊥ , where the v ariables ~ y and t are n ew and do not o ccur in φ . I t is easy to v erify th at ψ defines the relation T T ( φ ). S p ecifically , the pro jection do w n to columns ~ y j represent s the free second-order v ariable R j , the pro jection do wn to column s ~ x sp ecifies all the p ossible assignmen ts to the first-order v ariables, and t is a PBIT for the truth v alue of φ for a giv en assignmen t to the firs t- and second-ord er v ariables. The corresp onding WSA exp ression without definitions is obtained using Theorem 6.3. Induction step ( φ has quan tifiers): W e assume that u niv ers al quantifiers ∀· ha ve b een replaced b y ¬∃ · ¬ . Let P b e the WSA expression f or ψ claimed by th e theorem. 18 • Firs t-order existen tial quantifica tion: If φ = ∃ x l ψ , the corresp ondin g WSA exp r ession is π sch ( P ) − x l ( P ) . It is easy to v erify that the pro jection has exactly the effect of existen tial fir s t-order quan tification, T T ( ∃ x l ψ ) = π sch ( P ) − x l ( T T ( ψ )). • S econd-order existentia l quant ification: Let R 1 , . . . , R s b e the free second-order v ari- ables in ψ . W e may assume w.l.o.g. that these h av e disjoint sc hemas. If φ = ∃ R s ψ , the corresp onding WSA expression is π sch ( P ) − sch ( R j ) (p ossible sch ( R 1 ) ,...,sch ( R s − 1 ) ( P ) ) . Again, the correctness is straight forw ard , T T ( ∃ R s ψ ) = π sch ( P ) − sch ( R j ) ( T T ( ψ )). • Negation: By L emm a 6.6, the WSA expression compl U 1 ...U s ; ~ D ,T ( P ) is equiv alen t to φ = ¬ ψ . All th at is left to b e d one is to pro vide WSA expressions for th e in dicator relations 1 R j . F or d atabase relations R j , the algebra expression is ind( R j , U j ). F or s econd-order v ariables R j , it is r epair-k ey sch ( U j ) ( U × { 0 , 1 } ). F or an SO sen tence φ (i.e., without free v ariables), the alg eb r a expression computes a PBIT T T ( φ ) and its truth v alue is obtained as π ∅ ( σ T =1 ( · )). ✷ Example 6.8 W e con tinue E x amp le 4.2. Let φ = L ( c, p, 0) ∧ ( P 1 ( p ) ∨ P 2 ( p )) ∨ L ( c, p, 1) ∧ ¬ ( P 1 ( p ) ∨ P 2 ( p )) . Then Σ 2 -QBF can b e expr essed b y the SO sen tence ∃ P 1 ( ⊆ V 1 ) ¬∃ P 2 ( ⊆ V 2 ) ¬∃ c ( ∈ C ) ¬ ∃ p φ. W e can turn φ ∨ t = ⊥ ∧ P 1 ( p 12 ) ∧ P 2 ( p 22 ) in to WSA ov er ind icator r elations as Q = σ ψ ρ cpst L (1 L ) × ρ p 11 t 11 p 12 t 12 ((1 P 1 ) 2 V 1 ) × ρ p 21 t 21 p 22 t 22 ((1 P 2 ) 2 V 2 ) × ρ t ( {⊥ , 1 } ) where ψ = t = ⊥ ∨ ( t L = 1 ∧ p = p 11 = p 21 ∧ (( s = 0 ∧ ( t 11 = 1 ∨ t 21 = 1)) ∨ ( s = 1 ∧ t 11 6 = 1 ∧ t 21 6 = 1))) . Note that we hav e s im p lified the expression of th e pro of somewhat b y inlining the auxiliary v ariables ~ v and ~ w . The complete WSA expression for the SO sente nce is P B I T to b o ol z }| { π ∅ ◦ σ t =1 ◦ ∃ P 1 z }| { π t ◦ p ossible ◦ ¬ z }| { compl V 1 ; T ◦ ∃ P 2 z }| { π p 12 t 12 t ◦ p ossible p 12 t 12 ◦ compl V 1 ,V 2 ; T | {z } ¬ ◦ π p 12 t 12 p 22 t 22 t | {z } ∃ c ◦ compl V 1 ,V 2 ; C,T | {z } ¬ ◦ π p 12 t 12 p 22 t 22 ct | {z } ∃ p ( Q |{z} φ ) . W e replace 1 L b y ind ( L, · ) and 1 P i b y repair-key p ( ρ pt ( V i × { 0 , 1 } )). ✷ Th us, definitions add no p o wer to WSA. Corollary 6.9 WSA without definitions c aptur es WSA. 19 The data complexit y of a query language refers to the p roblem of ev aluating qu er ies on databases assuming th e queries fixed and only the database part of th e input, while com- bined complexit y assumes that b oth the qu ery and the database are part of the input [15]. Since SO logic is complete for the p olynomial hierarc hy (PHIER) with resp ect to data com- plexit y and PSP A CE -complete with resp ect to combined complexit y [14], a generalization of F agin’s Theorem [6] (see also [11]), Corollary 6.10 1. WSA with or without definitions is P HIER-c omplete with r esp e c t to data c omplexity, 2. WSA with definitions is PSP ACE-har d with r esp e ct to c ombine d c omplexity, and 3. WSA without definitions is PSP ACE-c omplete with r esp e ct to c ombine d c omplexity. W e cannot directly conclude an up p er b ound on the com bin ed complexit y of WSA with definitions from the r ed uction of Th eorem 4.3 b ecause it w as exp onenti al-time: In the case that WSA defi nitions are used, several copies of form ulae ψ V ma y b e used in the SO formula constructed in the pr o of, and that recursively . Ho wev er, we can think of the pro of constr u ction as a linear-time mappin g from WSA with d efi nitions to second-order logic with definitions. But the standard PSP ACE algorithm for second-order logic extends directly to second-order logic with definitions: Of the formula, we only hav e to main tain a current path in its parse tree, whic h is clearly of p olynomial size. It follo ws that Prop osition 6.11 WSA with definitions is P SP ACE-c omplete with r esp e ct to c ombine d c omplexity. 7 Related W ork In an early piece of related w ork, Libkin and W ong [12] define a query algebra for h an d ling b oth nested data t yp es and uncertain t y . Their notion of u ncertain ty ca lled or-sets (as a generalizat ion of the or-sets of [8]) is treated as a sp ecial collection t yp e th at can syn tacti- cally b e thought of as a set of data and is only inte rpreted as u ncertain ty on an additional “conceptual lev el”. The result is a very elegan t and clean algebra th at nicely com bines complex ob jects with uncertaint y . While their language is stronger and can manage n ested data, there is n evertheless a close conn ection to WSA, whic h ca n b e thought of as a flat relational v ersion of their language. Indeed, the or-set language conta in s an op erator α that is essen tially equiv alen t to the repair-k ey op erator of WSA. T riQL, the query language of the T rio pr o ject [16], su bsumes the p ow er of relational algebra and supp orts an op eration “groupalts” wh ic h exp resses the r epair-k ey op eration of WSA applied to a certain relation. There are man y more op erations in T riQL, but it is hard to tell whether p ossible ~ A is expressible in T riQL since no form al seman tics of the language is a v ailable. Moreo v er, T riQL con tains a n u m b er of representati on-dep endent (non-generic [1]) op erations wh ic h may return seman tically different results for differen t seman tically equiv alen t represent ations of a probabilistic database. This mak es T riQL h ard to stud y and compare with WSA. Ho wev er, it seems that WSA is a goo d candidate for a clean core to T riQL , and th e results of the p resen t pap er pro vide additional evidence that it is highly expressiv e. The probabilistic databases definable u sing repair-key from certain relations are also exactly the b lo c k indep endent-disjoin t (BID) tables of R´ e and Suciu. In their p ap er [13], 20 they stud y the relat ed repr esen tabilit y problems for BID tables. Their results su ggest that BID tables are more p o werful than tuple-indep endent tables, whic h corresp ond to uncertain tables definable using the sub set op eration. This is in line with observ ations made in Section 5 of the present pap er. The algebra defined in our own earlier work [3] is exactly the one describ ed in the present pap er, m o dulo the follo wing details. Most im p ortan tly , while repair-key is in tr o duced there as part of the algebra, most of th e pap er fo cuses on the f r agmen t that is obtained by replacing repair-key by choic e-of. Moreo ve r , the sy ntax of p ossible ~ A allo ws for the grouping of worlds b y a query Q that can b e giv en as a parameter; the synta x is p ossible Q ( Q ′ ). An op eration p ossible ~ A in th e syntax of th e pr esen t pap er corresp ond s to an op eration p ossible π ~ A in the syn tax of [3]. The r esults of this pap er imp ly that all o wing general queries Q for grouping adds no p o w er, so we are indeed studyin g the same language. The pap er [3] also gives an S QL-lik e syntax for WSA, in w h ic h the intuitio n of p ossible ~ A is made explicit b y the syn tax “select p ossible . . . group w orlds b y . . . ”. In recent w ork [2 , 10, 9], w e h a ve dev elop ed efficie n t tec hniqu es for p r o cessing a large part of WSA. The only op erations th at currently defy go o d solutions are p ossible ~ A (i.e., with grouping, n ot p ossible ∅ ) and, to a lesser extent, relational d ifferen ce. Ind eed, the repair-k ey op erator on the standard repr esen tations describ ed in Example 2.1 can b e imp lemen ted efficien tly , ev en thou gh semantica lly it generally causes an exp onential blowup in the size of the set of p ossible worlds. Th us, it is natural to ask for the expressiv e p o wer of WSA with p ossible ~ A replaced by p ossible. The construction of the pro of of Th eorem 4.1 can map an y SO form ula of the form ∃ R φ or ∀ R φ where φ is FO to WSA. It is not hard to see that despite the r estriction to a single second-order quant ifier, this fragment of WS A (with definitions) can expr ess all of NP ∪ co-NP . F or an upp er b ound, it seems that all s uc h restricted WSA queries ha ve data complexit y in ∆ P 2 (i.e., P NP ). 8 Conclusions The main cont ribution of this pap er is to gi v e the apparen tly first co m p ositional algebra that exactly captures second-order logic ov er fin ite stru ctures, a logi c of wide in terest. Second-order logic is a natur al y ard s tic k for the exp ressiv eness of query languages for uncertain databases. It is an elegan t and well-st udied formalism that naturally captures what-if queries. It can b e argued th at second-order logic tak es the same role in un certain databases that first-order logic and r elational alge bra take in classical relatio nal databases. In that sense, the expressiveness result of th is pap er , W S A = S O , is an u ncertain d atabases analog of Co dd’s Theorem. Finding the righ t query alg ebra for uncertain databases is imp ortan t because efficien t query pro cessing tec hn iques are easier to obtain for algebraic languages without v ariables or quanti fiers, and algebraic op erators are natur al bu ilding b lo c ks for database query plans . Of course, the expressiveness result of this p ap er also implies that WSA has high complexit y and th u s this pap er can only b e an initial call f or the search for more efficiently p ro cessible fragmen ts of WSA that retain some of its fla v or of simplicit y and cleanliness. References [1] S . Abiteb oul, R. Hull, and V. Vianu. F oundations of Datab ases . Addison-W esley , 1995. 21 [2] L. Anto v a, T. J an s en, C. Ko ch, and D. Oltean u. “F a s t and Simp le Relational Pro cess- ing of Uncertain Data”. In Pr o c. ICDE , 2008 . [3] L. Anto v a, C. Ko ch, and D. Olteanu. “F rom C omplete to Incomplete Inf ormation and Bac k”. In Pr o c. SIGMOD , 2007 . [4] O. Benjelloun, A. D. Sarma, A. Halevy , and J. Widom. “ULDBs: Databases with Uncertain t y and Lineage”. In Pr o c. VLDB , 2006. [5] N. Dalvi and D. Suciu. “Efficie nt query ev aluation on probabilistic databases”. V LD B Journal , 16 (4):5 23–54 4, 2007. [6] R. F agin. “Generalized First-Or d er Sp ectra and Pol ynomial-Time Recognizable Sets”. In Complexity of Computation, R. Karp, e d., SIAM -AMS Pr o c e e dings 7 , pages 27–4 1. 1974. [7] T. Imielinski and W. Lipski. “Incomplete in f ormation in relational databases”. J ournal of the ACM , 31 (4):761– 791, 1984 . [8] T. Imielinski, S. Na qvi, and K. V adaparty . “In complete ob jects — a data mo del for design and planning applicatio ns”. In Pr o c . SIGMO D , pages 288 –297, 1991. [9] C. Ko c h. “Appro ximating Predicates and Exp ressiv e Queries on Probabilistic Databases”. In Pr o c. PODS , 2008. [10] C. Koch and D. Oltean u. “Conditioning Probabilistic Databases”. In Pr o c. VLDB , 2008. [11] L. Lib kin. Elements of Finite Mo del The ory . Sp ringer, 2004. [12] L. Libkin and L. W ong. “Semantic Repr esen tations and Query L an gu ages for O r-Sets”. J. Comput. Syst. Sci. , 52 (1):1 25–14 2, 1996. [13] C. R´ e and D. Suciu. “Materialized Views for Probabilistic Databases (F or In formation Exc hange and Q u ery Optimization)”. In Pr o c. V LD B , 200 7. [14] L. S to c kmeyer. “The P olynomial Hierarch y”. The or. Comput. Sci. , 3 :1–22, 1977. [15] M. Y. V ardi. “The Complexit y of Relational Q uery Languages”. In Pr o c. STOC , p ages 137–1 46, 1982. [16] J. Widom. “TRIO: A S ystem for Managing Data, Uncertain t y , and Lineage”. In C. Agarw al, editor, Managing and Mining U nc ertain Data , 2008. T o app ear. 22
Original Paper
Loading high-quality paper...
Comments & Academic Discussion
Loading comments...
Leave a Comment