Expressiveness of structured document query languages based on attribute grammars

Structured document databases can be naturally viewed as derivation trees of a context-free grammar. Under this view, the classical formalism of attribute grammars becomes a formalism for structured document query languages. From this perspective, we study the expressive power of BAGs: Boolean-valued attribute grammars with propositional logic formulas as semantic rules, and RAGs: relation-valued attribute grammars with first-order logic formulas as semantic rules. BAGs can express only unary queries; RAGs can express queries of any arity. We first show that the (unary) queries expressible by BAGs are precisely those definable in monadic second-order logic. We then show that the queries expressible by RAGs are precisely those definable by first-order inductions of linear depth, or, equivalently, those computable in linear time on a parallel machine with polynomially many processors. Further, we show that RAGs that only use synthesized attributes are strictly weaker than RAGs that use both synthesized and inherited attributes. We show that RAGs are more expressive than monadic second-order logic for queries of any arity. Finally, we discuss relational attribute grammars in the context of BAGs and RAGs. We show that in the case of BAGs this does not increase the expressive power, while different semantics for relational RAGs capture the complexity classes NP, coNP and UP ∩ coUP.

[1]  Paolo Merialdo,et al.  The Araneus Web-based management system , 1998, SIGMOD '98.

[2]  Yiannis N. Moschovakis,et al.  Elementary induction on abstract structures , 1974 .

[3]  守屋 悦朗,et al.  J.E.Hopcroft, J.D. Ullman 著, "Introduction to Automata Theory, Languages, and Computation", Addison-Wesley, A5変形版, X+418, \6,670, 1979 , 1980 .

[4]  Donald Ervin Knuth,et al.  The Art of Computer Programming , 1968 .

[5]  Bruno Courcelle,et al.  Proofs of Partial Correctness for Attribute Grammars with Applications to Recursive Procedures and Logic Programming , 1988, Inf. Comput..

[6]  Serge Abiteboul,et al.  Computing with First-Order Logic , 1995, J. Comput. Syst. Sci..

[7]  Pierre Deransart,et al.  Attribute Grammars: Definitions, Systems and Bibliography , 1988 .

[8]  Herbert B. Enderton,et al.  A mathematical introduction to logic , 1972 .

[9]  Jörg Flum,et al.  Finite model theory , 1995, Perspectives in Mathematical Logic.

[10]  Neil Immerman,et al.  Expressibility and Parallel Complexity , 1989, SIAM J. Comput..

[11]  Joost Engelfriet,et al.  A Comparison of Tree Transductions Defined by Monadic Second Order Logic and by Attribute Grammars , 2000, J. Comput. Syst. Sci..

[12]  Moshe Y. Vardi Invited talk: automata theory for database theoreticians , 1989, PODS '89.

[13]  Jeffrey D. Ullman,et al.  Introduction to Automata Theory, Languages and Computation , 1979 .

[14]  Derick Wood,et al.  Standard Generalized Markup Language: Mathematical and Philosophical Issues , 1995, Computer Science Today.

[15]  Phokion G. Kolaitis,et al.  Infinitary Logics and 0-1 Laws , 1992, Inf. Comput..

[16]  Gaston H. Gonnet,et al.  Mind Your Grammar: a New Approach to Modelling Text , 1987, VLDB.

[17]  Charles F. Goldfarb,et al.  SGML handbook , 1990 .

[18]  Serge Abiteboul,et al.  A logical view of structured files , 1998, The VLDB Journal.

[19]  Moshe Y. Vardi Automata Theory for Database Theoreticans , 1991, Theoretical Studies in Computer Science.

[20]  Y. Moschovakis Elementary induction on abstract structures (Studies in logic and the foundations of mathematics) , 1974 .

[21]  Jennifer Widom,et al.  Object exchange across heterogeneous information sources , 1995, Proceedings of the Eleventh International Conference on Data Engineering.

[22]  Ferenc Gécseg,et al.  Tree Languages , 1997, Handbook of Formal Languages.

[23]  Phokion G. Kolaitis Implicit definability on finite structures and unambiguous computations , 1990, [1990] Proceedings. Fifth Annual IEEE Symposium on Logic in Computer Science.

[24]  Wolfgang Thomas,et al.  Languages, Automata, and Logic , 1997, Handbook of Formal Languages.

[25]  John Doner,et al.  Tree Acceptors and Some of Their Applications , 1970, J. Comput. Syst. Sci..

[26]  Etsuro Moriya,et al.  On Two-Way Tree Automata , 1994, Inf. Process. Lett..

[27]  Leslie G. Valiant,et al.  Relative Complexity of Checking and Evaluating , 1976, Inf. Process. Lett..