Skip to main content

The Expression Lemma

  • Conference paper
Book cover Mathematics of Program Construction (MPC 2008)

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 5133))

Included in the following conference series:

Abstract

Algebraic data types and catamorphisms (folds) play a central role in functional programming as they allow programmers to define recursive data structures and operations on them uniformly by structural recursion. Likewise, in object-oriented (OO) programming, recursive hierarchies of object types with virtual methods play a central role for the same reason. There is a semantical correspondence between these two situations which we reveal and formalize categorically. To this end, we assume a coalgebraic model of OO programming with functional objects. The development may be helpful in deriving refactorings that turn sufficiently disciplined functional programs into OO programs of a designated shape and vice versa.

See http://www.uni-koblenz.de/~laemmel/expression/ (the paper’s web site) for an extended version.

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

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Awodey, S.: Category Theory. Clarendon Press (2006)

    Google Scholar 

  2. Beck, J.: Distributive laws. Lecture Notes in Mathematics 80, 119–140 (1969)

    Article  MathSciNet  Google Scholar 

  3. Bierman, G.M., Meijer, E., Torgersen, M.: Lost in translation: formalizing proposed extensions to C#. In: OOPSLA 2007: Proceedings of the 22nd annual ACM SIGPLAN conference on Object oriented programming systems and applications, pp. 479–498. ACM Press, New York (2007)

    Chapter  Google Scholar 

  4. Birka, A., Ernst, M.D.: A practical type system and language for reference immutability. In: OOPSLA 2004: Proceedings of the 19th annual ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications, pp. 35–49. ACM Press, New York (2004)

    Chapter  Google Scholar 

  5. Chin, W.-N.: Towards an automated tupling strategy. In: PEPM 1993: Proceedings of the 1993 ACM SIGPLAN symposium on Partial evaluation and semantics-based program manipulation, pp. 119–132. ACM Press, New York (1993)

    Chapter  Google Scholar 

  6. Clarke, D.G., Potter, J.M., Noble, J.: Ownership types for flexible alias protection. In: OOPSLA 1998: Proceedings of the 13th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications, pp. 48–64. ACM Press, New York (1998)

    Chapter  Google Scholar 

  7. Fiore, M., Plotkin, G., Turi, D.: Abstract Syntax and Variable Binding. In: LICS 1999: Proceedings of the 14th Annual IEEE Symposium on Logic in Computer Science, pp. 193–202. IEEE Press, Los Alamitos (1999)

    Google Scholar 

  8. Fisher, K., Reppy, J.: Object-oriented aspects of Moby. Technical report, University of Chicago Computer Science Department Technical Report (TR-2003-10) (July 2003)

    Google Scholar 

  9. Fokkinga, M.M.: Tupling and Mutumorphisms. Appeared in: The Squigollist 1(4), 81–82 (1990)

    Google Scholar 

  10. Gamma, E., Helm, R., Johnson, R., Vlissides, J.: Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley, Reading (1994)

    Google Scholar 

  11. Hu, Z., Iwasaki, H., Takeichi, M.: Deriving structural hylomorphisms from recursive definitions. In: ICFP 1996: Proceedings of the first ACM SIGPLAN international conference on Functional programming, pp. 73–82. ACM Press, New York (1996)

    Chapter  Google Scholar 

  12. Hu, Z., Iwasaki, H., Takeichi, M., Takano, A.: Tupling calculation eliminates multiple data traversals. In: ICFP 1997: Proceedings of the second ACM SIGPLAN international conference on Functional programming, pp. 164–175. ACM Press, New York (1997)

    Chapter  Google Scholar 

  13. Jacobs, B.: Distributive laws for the coinductive solution of recursive equations. Information and Computation 204(4), 561–587 (2006)

    Article  MATH  MathSciNet  Google Scholar 

  14. Jacobs, B.P.F.: Objects and classes, coalgebraically. In: Freitag, B., Jones, C.B., Lengauer, C., Schek, H.J. (eds.) Object-Orientation with Parallelism and Persistence, pp. 83–103. Kluwer Academic Publishers, Dordrecht (1996)

    Google Scholar 

  15. Kabanov, J., Vene, V.: Recursion Schemes for Dynamic Programming. In: Uustalu, T. (ed.) MPC 2006. LNCS, vol. 4014, pp. 235–252. Springer, Heidelberg (2006)

    Chapter  Google Scholar 

  16. Klin, B.: Adding recursive constructs to bialgebraic semantics. Journal of Logic and Algebraic Programming 60-61, 259–286 (2004)

    Article  MathSciNet  Google Scholar 

  17. Launchbury, J., Sheard, T.: Warm fusion: deriving build-catas from recursive definitions. In: FPCA 1995: Proceedings of the seventh international conference on Functional programming languages and computer architecture, pp. 314–323. ACM Press, New York (1995)

    Chapter  Google Scholar 

  18. Meertens, L.G.L.T.: Paramorphisms. Formal Aspects of Computing 4(5), 413–424 (1992)

    Article  MATH  Google Scholar 

  19. Meijer, E., Fokkinga, M.M., Paterson, R.: Functional Programming with Bananas, Lenses, Envelopes and Barbed Wire. In: Hughes, J. (ed.) FPCA 1991. LNCS, vol. 523, pp. 124–144. Springer, Heidelberg (1991)

    Google Scholar 

  20. Odersky, M.: The Scala Language Specification, Version 2.6, DRAFT, Programming Methods Laboratory, EPFL, Switzerland (December 19, 2007)

    Google Scholar 

  21. Pierce, B.C., Turner, D.N.: Simple type-theoretic foundations for object-oriented programming. Journal of Functional Programming 4(2), 207–247 (1994)

    MATH  Google Scholar 

  22. Reichel, H.: An approach to object semantics based on terminal co-algebras. Mathematical Structures in Computer Science 5(2), 129–152 (1995)

    Article  MATH  MathSciNet  Google Scholar 

  23. Rémy, D.: Programming Objects with ML-ART: An extension to ML with Abstract and Record Types. In: Hagiya, M., Mitchell, J.C. (eds.) TACS 1994. LNCS, vol. 789, pp. 321–346. Springer, Heidelberg (1994)

    Google Scholar 

  24. Turi, D.: Functorial Operational Semantics and its Denotational Dual. PhD thesis, Free University, Amsterdam (June 1996)

    Google Scholar 

  25. Turi, D., Plotkin, G.D.: Towards a mathematical operational semantics. In: Proceedings 12th Annual IEEE Symposium on Logic in Computer Science, LICS 1997, Warsaw, Poland, 29 June – 2 July 1997, pp. 280–291. IEEE Press, Los Alamitos (1997)

    Chapter  Google Scholar 

  26. Uustalu, T., Vene, V., Pardo, A.: Recursion schemes from comonads. Nordic Journal of Computing 8(3), 366–390 (2001)

    MATH  MathSciNet  Google Scholar 

  27. Vene, V., Uustalu, T.: Functional programming with apomorphisms (corecursion). Proceedings of the Estonian Academy of Sciences: Physics, Mathematics 47(3), 147–161 (1998)

    MATH  MathSciNet  Google Scholar 

  28. Wadler, P.: The expression problem. Message to java-genericity electronic mailing list (November 1998), http://www.daimi.au.dk/~madst/tool/papers/expression.txt

Download references

Author information

Authors and Affiliations

Authors

Editor information

Philippe Audebaud Christine Paulin-Mohring

Rights and permissions

Reprints and permissions

Copyright information

© 2008 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Lämmel, R., Rypacek, O. (2008). The Expression Lemma. In: Audebaud, P., Paulin-Mohring, C. (eds) Mathematics of Program Construction. MPC 2008. Lecture Notes in Computer Science, vol 5133. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-70594-9_12

Download citation

  • DOI: https://doi.org/10.1007/978-3-540-70594-9_12

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-70593-2

  • Online ISBN: 978-3-540-70594-9

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics