Naturally embedded query languages

  • Val Breazu-Tannen
  • Peter Buneman
  • Limsoon Wong
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 646)

Abstract

We investigate the properties of a simple programming language whose main computational engine is structural recursion on sets. We describe a progression of sublanguages in this paradigm that (1) have increasing expressive power, and (2) illustrate robust conceptual restrictions thus exhibiting interesting additional properties. These properties suggest that we consider our sublanguages as candidates for “query languages”. Viewing query languages as restrictions of our more general programming language has several advantages. First, there is no “impedance mismatch” problem; the query languages are already there, so they share common semantic foundation with the general language. Second, we suggest a uniform characterization of nested relational and complex-object algebras in terms of some surprisingly simple operators;and we can make comparisons of expressiveness in a general framework. Third, we exhibit differences in expressive power that are not always based on complexity arguments, but use the idea that a query in one language may not be polymorphically expressible in another. Fourth, ideas of category theory can be profitably used to organize semantics and syntax, in particular our minimal (core) language is a well-understood categorical construction: a cartesian category with a strong monad on it. Finally, we bring out an algebraic perspective, that is, our languages come with equational theories, and categorical ideas can be used to derive a number of rather general identities that may serve as optimizations or as techniques for discovering optimizations.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    S. Abiteboul, C. Beeri, M. Gyssens, and D. Van Gucht. An Introduction to the Completeness of Languages for Complex Objects and Nested Relations. In S. Abiteboul, P. C. Fisher, and H.-J. Schek, editors, LNCS 361: Nested Relations and Complex Objects in Databases, pages 117–138. Springer-Verlag, 1987.Google Scholar
  2. 2.
    Serge Abiteboul and Catriel Beeri. On the Power of Languages for the Manipulation of Complex Objects. In Proceedings of International Workshop on Theory and Applications of Nested Relations and Complex Objects, Darmstadt, 1988.Google Scholar
  3. 3.
    Catriel Beeri and Yoran Kornatzky. Algebraic Optimisation of Object Oriented Query Languages. In S. Abiteboul and P. C. Kanellakis, editors, LNCS 470: 3rd International Conference on Database Theory, Paris, France, December 1990, pages 72–88, Berlin, December 1990. Springer-Verlag.Google Scholar
  4. 4.
    V. Breazu-Tannen, P. Buneman, and S. Naqvi. Structural Recursion as a Query Language. In Proceedings of 3rd International Workshop on Database Programming Languages, pages 9–19, Nahplion, Greece, August 1991. Morgan Kaufmann.Google Scholar
  5. 5.
    V. Breazu-Tannen, P. Buneman, and L. Wong. Naturally Embedded Query Languages. Technical Report MS-CIS-92-47/L&C 47, Department of Computer and Information Science, University of Pennsylvania, June 1992.Google Scholar
  6. 6.
    V. Breazu-Tannen and A. R. Meyer. Lambda calculus with constrained types (extended abstract). In R. Parikh, editor, Proceedings of the Conference on Logics of Programs, Brooklyn, June 1985, pages 23–40. Lecture Notes in Computer Science, Vol. 193, Springer-Verlag, 1985.Google Scholar
  7. 7.
    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.Google Scholar
  8. 8.
    O. P. Buneman, R. Nikhil, and R. E. Frankel. An Implementation Technique for Database Query Languages. ACM Transactions on Database Systems, 7(2):164–187, June 1982.CrossRefGoogle Scholar
  9. 9.
    Ashok Chandra and David Harel. Structure and Complexity of Relational Queries. Journal of Computer and System Sciences, 25:99–128, 1982.CrossRefGoogle Scholar
  10. 10.
    Latha S. Colby. A Recursive Algebra for Nested Relations. Information Systems, 15(5):567–582, 1990.Google Scholar
  11. 11.
    Marc Gyssens and Dirk Van Gucht. A Comparison Between Algebraic Query Languages for Flat and Nested Databases. Theoretical Computer Science, 87:263–286, 1991.Google Scholar
  12. 12.
    Richard Hull and Jianwen Su. On the Expressive Power of Database Queries with Intermediate Types. Journal of Computer and System Sciences, 43:219–267, 1991.Google Scholar
  13. 13.
    Neil Immerman, Sushant Patnaik, and David Stemple. The Expressiveness of a Family of Finite Set Languages. In Proceedings of 10th ACM Symposium on Principles of Database Systems, pages 37–52, 1991.Google Scholar
  14. 14.
    J. Lambek and P. J. Scott. Introduction to Higher Order Categorical Logic. Cambridge University Press, 1986.Google Scholar
  15. 15.
    Eugenio Moggi. Notions of Computation and Monads. Information and Computation, 93:55–92, 1991.Google Scholar
  16. 16.
    A. Ohori, P. Buneman, and V. Breazu-Tannen. Database Programming in Machiavelli: A Polymorphic Language with Static Type Inference. In James Clifford, Bruce Lindsay, and David Maier, editors, Proceedings of ACM-SIGMOD International Conference on Management of Data, pages 46–57, Portland, Oregon, June 1989.Google Scholar
  17. 17.
    Jan Paredaens and Dirk Van Gucht. Possibilities and Limitations of Using Flat Operators in Nested Algebra Expressions. In Proceedings of 7th ACM Symposium on Principles of Database Systems, Austin, Texas, pages 29–38, 1988.Google Scholar
  18. 18.
    H.-J. Schek and M. H. Scholl. The Relational Model with Relation-Valued Attributes. Information Systems, 11(2):137–147, 1986.CrossRefGoogle Scholar
  19. 19.
    S. J. Thomas and P. C. Fischer. Nested Relational Structures. In P. C. Kanellakis, editor, Advances in Computing Research: The Theory of Databases, pages 269–307. JAI Press, 1986.Google Scholar
  20. 20.
    P. W. Trinder. Comprehension: A Query Notation for DBPLs. In Proceedings of 3rd International Workshop on Database Programming Languages, pages 49–62, Nahplion, Greece, August 1991. Morgan Kaufmann.Google Scholar
  21. 21.
    P. W. Trinder and P. L. Wadler. List Comprehensions and the Relational Calculus. In Proceedings of 1988 Glasgow Workshop on Functional Programming, pages 115–123, Rothesay, Scotland, August 1988.Google Scholar
  22. 22.
    Philip Wadler. Comprehending Monads. In Proceedings of ACM Conference on Lisp and Functional Programming, Nice, June 1990.Google Scholar
  23. 23.
    David A. Watt and Phil Trinder. Towards a Theory of Bulk Types. Fide Technical Report 91/26, Glasgow University, Glasgow G12 8QQ, Scotland, July 1991.Google Scholar

Copyright information

© Springer-Verlag 1992

Authors and Affiliations

  • Val Breazu-Tannen
    • 1
  • Peter Buneman
    • 1
  • Limsoon Wong
    • 1
  1. 1.Department of Computer and Information ScienceUniversity of PennsylvaniaPhiladelphiaUSA

Personalised recommendations