Skip to main content
Log in

Structural Recursion as a Query Language on Lists and Ordered Trees

  • Published:
Theory of Computing Systems Aims and scope Submit manuscript

Abstract

XML query languages need to provide some mechanism to inspect and manipulate nodes at all levels of an input tree. We investigate the expressive power provided in this regard by structural recursion. In particular, we show that the combination of vertical recursion down a tree combined with horizontal recursion across a list of trees gives rise to a robust class of transformations: it captures the class of all primitive recursive queries. Since queries are expected to be computable in at most polynomial time for all practical purposes, we next identify a restriction of structural recursion that captures the polynomial time queries. We also give corresponding results for list-based complex objects.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  1. Abiteboul, S., Beeri, C.: The power of languages for the manipulation of complex values. VLDB J. 4(4), 727–794 (1995)

    Article  Google Scholar 

  2. Abiteboul, S., Hull, R., Vianu, V.: Foundations of Databases. Addison-Wesley, Reading (1995)

    MATH  Google Scholar 

  3. Bellantoni, S., Cook, S.: A new recursion-theoretic characterization of the polytime functions (extended abstract). In: STOC 1992, pp. 283–293. ACM Press, New York (1992)

    Chapter  Google Scholar 

  4. Boag, S., Chamberlin, D., Fernández, M.F., Florescu, D., Robie, J., Siméon, J.: XQuery 1.0: An XML Query Language. W3C Recommendation, January 2007

  5. Bonner, A.J., Mecca, G.: Sequences, datalog, and transducers. J. Comput. Syst. Sci. 57(3), 234–259 (1998)

    Article  MATH  MathSciNet  Google Scholar 

  6. Boolos, G.S., Jeffrey, R.C.: Computability and Logic, 3rd edn. Cambridge University Press, Cambridge (1989)

    MATH  Google Scholar 

  7. Buneman, P., Fernandez, M.F., Suciu, D.: UnQL: a query language and algebra for semistructured data based on structural recursion. VLDB J. 9(1), 76–110 (2000)

    Article  Google Scholar 

  8. Buneman, P., Naqvi, S.A., Tannen, V., Wong, L.: Principles of programming with complex objects and collection types. Theor. Comput. Sci. 149(1), 3–48 (1995)

    Article  MATH  MathSciNet  Google Scholar 

  9. Caseiro, V.-H.: Equations for defining poly-time functions. PhD thesis, University of Oslo (1997)

  10. Chandra, A.K., Harel, D.: Computable queries for relational data bases. J. Comput. Syst. Sci. 21(2), 156–178 (1980)

    Article  MATH  MathSciNet  Google Scholar 

  11. Cobham, A.: The intrinsic computational difficulty of functions. In: Logic, Methodology, and Philosophy of Science II, pp. 24–30. Springer, Berlin (1965)

    Google Scholar 

  12. Colby, L.S., Libkin, L.: Tractable iteration mechanisms for bag languages. In: ICDT 1997. Lecture Notes in Computer Science, vol. 1186, pp. 461–475. Springer, Berlin (1997)

    Google Scholar 

  13. Colby, L.S., Robertson, E.L., Saxton, L.V., Van Gucht, D.: A query language for list-based complex objects. In: PODS 1994, pp. 179–189. ACM Press, New York (1994)

    Chapter  Google Scholar 

  14. Draper, D., Fankhauser, P., Fernández, M.F., Malhotra, A., Rose, K., Rys, M., Siméon, J., Wadler, P.: XQuery 1.0 and XPath 2.0 Formal Semantics. W3C Recommendation, January 2007

  15. Fernández, M.F., Malhotra, A., Marsh, J., Nagy, M., Walsh, N.: XQuery 1.0 and XPath 2.0 Data Model. W3C Recommendation, January 2007

  16. Girard, J.-Y.: Light linear logic. Inf. Comput. 143(2), 175–204 (1998)

    Article  MATH  MathSciNet  Google Scholar 

  17. Gladstone, M.D.: Simplifications of the recursion scheme. J. Symb. Log. 36(4), 653–665 (1971)

    Article  MathSciNet  Google Scholar 

  18. Grumbach, S., Milo, T.: Personal communication

  19. Grumbach, S., Milo, T.: An algebra for pomsets. Inf. Comput. 150(2), 268–306 (1999)

    Article  MATH  MathSciNet  Google Scholar 

  20. Hofmann, M.: A mixed modal/linear lambda calculus with applications to Bellantoni-Cook safe recursion. In: CSL 1997. Lecture Notes in Computer Science, vol. 1414, pp. 275–294. Springer, Berlin (1998)

    Google Scholar 

  21. Hofmann, M.: Linear types and non-size-increasing polynomial time computation. In: LICS, pp. 464–473 (1999)

  22. Hofmann, M.: Semantics of linear/modal lambda calculus. J. Funct. Program. 9(3), 247–277 (1999)

    Article  MATH  Google Scholar 

  23. Hofmann, M., Jost, S.: Static prediction of heap space usage for first-order functional programs. In: POPL, pp. 185–197 (2003)

  24. Hull, R., Su, J.: Algebraic and calculus query languages for recursively typed complex objects. J. Comput. Syst. Sci. 47(1), 121–156 (1993)

    Article  MATH  MathSciNet  Google Scholar 

  25. Immerman, N., Patnaik, S., Stemple, D.W.: The expressiveness of a family of finite set languages. Theor. Comput. Sci. 155(1), 111–140 (1996)

    Article  MATH  MathSciNet  Google Scholar 

  26. Leivant, D.: Stratified functional programs and computational complexity. In: POPL 1993, pp. 325–333. ACM Press, New York (1993)

    Chapter  Google Scholar 

  27. Libkin, L., Wong, L.: Query languages for bags and aggregate functions. J. Comput. Syst. Sci. 55(2), 241–272 (1997)

    Article  MATH  MathSciNet  Google Scholar 

  28. Sazonov, V.Yu.: Hereditarily-finite sets, data bases and polynomial-time computability. Theor. Comput. Sci. 119(1), 187–214 (1993)

    Article  MATH  MathSciNet  Google Scholar 

  29. Suciu, D.: Bounded fixpoints for complex objects. Theor. Comput. Sci. 176(1–2), 283–328 (1997)

    Article  MATH  MathSciNet  Google Scholar 

  30. Suciu, D., Wong, L.: On two forms of structural recursion. In: ICDT 1995. Lecture Notes in Computer Science, vol. 893, pp. 111–124. Springer, Berlin (1995)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Stijn Vansummeren.

Additional information

S. Vansummeren is a postdoctoral Fellow of the Research Foundation—Flanders (FWO).

Rights and permissions

Reprints and permissions

About this article

Cite this article

Robertson, E.L., Saxton, L.V., Van Gucht, D. et al. Structural Recursion as a Query Language on Lists and Ordered Trees. Theory Comput Syst 44, 590–619 (2009). https://doi.org/10.1007/s00224-008-9110-5

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s00224-008-9110-5

Keywords

Navigation