Skip to main content

A calculus for collections and aggregates

  • Conference paper
  • First Online:

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 1290))

Abstract

We present a calculus that should play for database query languages the same role that the lambda calculus plays for functional programming. For the semantic foundations of the calculus we introduce a new concept: monads enriched with algebraic structure. We model collection types through enriched monads and aggregate operations through enriched monad algebras. The calculus derives program equivalences that underlie a good number of the optimizations used in query languages.

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

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. R. C. Backhouse. An exploration of the Bird-Meertens formalism. Technical Report CS 8810, Groningen University, The Netherlands, 1988.

    Google Scholar 

  2. Val Breazu-Tannen, Peter Buneman, and Limsoon Wong. Naturally embedded query languages. In J. Biskup and R. Hull, editors, LNCS 646: Proceedings of 4th International Conference on Database Theory, Berlin, Germany, October, 1992, pages 140–154. Springer-Verlag, October 1992.

    Google Scholar 

  3. Peter Buneman, Shamim Naqvi, Val Tannen, and Limsoon Wong. Principles of programming with complex objects and collection types. Theoretical Computer Science, 149(1):3–48, September 1995.

    Article  MATH  MathSciNet  Google Scholar 

  4. F. Borceux. Handbook of categorical algebra, Vol.2. Cambridge University Press, 1994.

    Google Scholar 

  5. 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 

  6. Michael Barr and Charles Wells. Toposes, Triples, and Theories. Springer-Verlag, New York, 1985.

    MATH  Google Scholar 

  7. R. G. G. Cattell, editor. The Object Database Standard: ODMG-93. Morgan Kaufmann, San Mateo, California, 1996.

    MATH  Google Scholar 

  8. R. Di Cosmo. On the power of simple diagrams. In LNCS 1103: Rewriting Techniques and Applications, New Brunswick, NJ, July 1996, Berlin, July 1996. Springer-Verlag.

    Google Scholar 

  9. S. Eilenberg and J. C. Moore. Adjoint functors and triples. Illinois Journal of Mathematics, 9:381–398, 1965.

    MATH  MathSciNet  Google Scholar 

  10. A. Filinski. Controlling effects. PhD thesis, School of Computer Science, Carnegie Mellon University, Pittsburgh, PA 15213, May 1996. Available as CMU Technical Report CMU-CS-96-119.

    Google Scholar 

  11. Leonidas Fegaras and David Maier. Towards an effective calculus for object query languages. In Proceedings of ACM SIGMOD International Conference on Management of Data, pages 47–58, San Jose, California, May 1995.

    Google Scholar 

  12. A. Gill, J. Launchbury, and S. Peyton Jones. A short cut to deforestation. In Proceedings of Conference on Functional Programming Languages and Computer Architecture, pages 223–232, 1993.

    Google Scholar 

  13. P. Hoogendijk. Relational programming laws in the Boom hierarchy of types. Technical report, Eindhoven University of Technology, The Netherlands, 1994.

    Google Scholar 

  14. H. Kleisli. Every standard construction is induced by a pair of adjoint functors. Proceedings of the American Mathematical Society, 16:544–546, 1965.

    Article  MATH  MathSciNet  Google Scholar 

  15. K. Lellahi. Towards a characterization of bulk types. Technical Report 94-01, Université Paris 13, LIPN, 1994.

    Google Scholar 

  16. K. Lellahi. Type de collection et monades. In Actes des Journées Cateégories, Algèbres, Esquisses et neo-esquisses, Caen, 1994.

    Google Scholar 

  17. J. Lambek and P. J. Scott. Introduction to Higher Order Categorical Logic, volume 7 of Cambridge Studies in Advanced Mathematics. Cambridge University Press, London, 1986.

    Google Scholar 

  18. J. Launchbury and T. Sheard. Warm fusion: deriving build-catas from recursive definitions. In Proceedings of Conference on Functional Programming Languages and Computer Architecture, pages 314–323, 1995.

    Google Scholar 

  19. Leonid Libkin and Limsoon Wong. Aggregate functions, conservative extension, and linear orders. In Catriel Beeri, Atsushi Ohori, and Dennis E. Shasha, editors, Proceedings of DBPL-4; New York, August 1993, pages 282–294. Springer-Verlag, January 1994.

    Google Scholar 

  20. Leonid Libkin and Limsoon Wong. Some properties of query languages for bags. In Catriel Beeri, Atsushi Ohori, and Dennis E. Shasha, editors, Proceedings of DBPL-4, New York, August 1993, pages 97–114. Springer-Verlag, January 1994.

    Google Scholar 

  21. S. MacLane. Categories for the Working Mathematician. Springer-Verlag, Berlin, 1971.

    Google Scholar 

  22. Ernest G. Manes.Algebraic Theories, volume 26 of Graduate Texts in Mathematics. Springer-Verlag, Berlin, 1976.

    Google Scholar 

  23. Erik Meijer, Maartens Fokkinga, and Ross Paterson. Functional programming with bananas, lenses, envelopes, and barbed wires. In J. Hughes, editor, LNCS 523. 5th ACM Conference on Functional Languages and Computer Architecture, pages 124–144. Springer-Verlag, August 1991.

    Google Scholar 

  24. Eugenio Moggi. Notions of computation and monads. Information and Computation, 93:55–92, 1991.

    Article  MATH  MathSciNet  Google Scholar 

  25. P. Mulry. Monads and algebras in the semantics of partial data types. Theoretical Computer Science, 99:141–155, 1992.

    Article  MATH  MathSciNet  Google Scholar 

  26. P. Mulry, May 1997. Private communication.

    Google Scholar 

  27. Dan Suciu and Val Breazu-Tannen. A query language for NC. In Proceedings of 13th ACM Symposium on Principles of Database Systems, pages 167–178, Minneapolis, Minnesota, May 1994. See also UPenn Technical Report MS-CIS-94-05.

    Google Scholar 

  28. P. W. Trinder. Comprehensions, a query notation for DBPLs. In Proceedings of 3rd International Workshop on Database Programming Languages, Nahplion, Greece, pages 49–62. Morgan Kaufmann, August 1991.

    Google Scholar 

  29. Philip Wadler. Comprehending monads. Mathematical Structures in Computer Science, 2:461–493, 1992.

    Article  MATH  MathSciNet  Google Scholar 

  30. 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-92-59.

    Google Scholar 

  31. Limsoon Wong. Querying Nested Collections. PhD thesis, Department of Computer and Information Science, University of Pennsylvania, Philadelphia, PA 19104, August 1994. Available as University of Pennsylvania IRCS Report 94-09.

    Google Scholar 

  32. David A. Watt and Phil Trinder. Towards a theory of bulk types. Fide Technical Report 91126, Glasgow University, Glasgow G12 8QQ, Scotland, July 1991.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Eugenio Moggi Giuseppe Rosolini

Rights and permissions

Reprints and permissions

Copyright information

© 1997 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Lellahi, K., Tannen, V. (1997). A calculus for collections and aggregates. In: Moggi, E., Rosolini, G. (eds) Category Theory and Computer Science. CTCS 1997. Lecture Notes in Computer Science, vol 1290. Springer, Berlin, Heidelberg. https://doi.org/10.1007/BFb0026993

Download citation

  • DOI: https://doi.org/10.1007/BFb0026993

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-63455-3

  • Online ISBN: 978-3-540-69552-3

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics