skip to main content
article

Talking bananas: structural recursion for session types

Published:04 September 2016Publication History
Skip Abstract Section

Abstract

Session types provide static guarantees that concurrent programs respect communication protocols. We give a novel account of recursive session types in the context of GV, a small concurrent extension of the linear λ-calculus. We extend GV with recursive types and catamorphisms, following the initial algebra semantics of recursion, and show that doing so naturally gives rise to recursive session types. We show that this principled approach to recursion resolves long-standing problems in the treatment of duality for recursive session types.

We characterize the expressiveness of GV concurrency by giving a CPS translation to (non-concurrent) λ-calculus and proving that reduction in GV is simulated by full reduction in λ-calculus. This shows that GV remains terminating in the presence of positive recursive types, and that such arguments extend to other extensions of GV, such as polymorphism or non-linear types, by appeal to normalization results for sequential λ-calculi. We also show that GV remains deadlock free and deterministic in the presence of recursive types.

Finally, we extend CP, a session-typed process calculus based on linear logic, with recursive types, and show that doing so preserves the connection between reduction in GV and cut elimination in CP.

References

  1. S. Abramsky. Proofs as processes. Theor. Comput. Sci., 135(1):5–9, 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. R. Atkey, S. Lindley, and J. G. Morris. Conflation confers concurrency. In S. Lindley, C. McBride, P. W. Trinder, and D. Sannella, editors, A List of Successes That Can Change the World - Essays Dedicated to Philip Wadler on the Occasion of His 60th Birthday, volume 9600 of Lecture Notes in Computer Science, pages 32–55. Springer, 2016.Google ScholarGoogle Scholar
  3. D. Baelde. Least and greatest fixed points in linear logic. ACM Trans. Comput. Logic, 13(1):2:1–2:44, Jan. 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. D. Baelde and D. Miller. Least and greatest fixed points in linear logic. In N. Dershowitz and A. Voronkov, editors, Logic for Programming, Artificial Intelligence, and Reasoning, 14th International Conference, LPAR 2007, Yerevan, Armenia, October 15-19, 2007, Proceedings, volume 4790 of Lecture Notes in Computer Science, pages 92–106. Springer, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. G. Bellin and P. J. Scott. On the π-Calculus and linear logic. Theoretical Computer Science, 135(1):11–65, 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. G. Bernardi and M. Hennessy. Using higher-order contracts to model session types (extended abstract). In P. Baldan and D. Gorla, editors, CONCUR 2014, volume 8704 of Lecture Notes in Computer Science, pages 387–401. Springer, 2014.Google ScholarGoogle ScholarCross RefCross Ref
  7. G. Bernardi and M. Hennessy. Using higher-order contracts to model session types. CoRR, abs/1310.6176v4, 2015.Google ScholarGoogle Scholar
  8. G. Bernardi, O. Dardha, S. J. Gay, and D. Kouzapas. On duality relations for session types. In Trustworthy Global Computing - 9th International Symposium, TGC 2014, Rome, Italy, September 5-6, 2014. Revised Selected Papers, pages 51–66, 2014.Google ScholarGoogle Scholar
  9. R. S. Bird and O. de Moor. Algebra of programming. Prentice Hall International series in computer science. Prentice Hall, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. V. Bono and L. Padovani. Typing copyless message passing. Logical Methods in Computer Science, 8(1), 2012.Google ScholarGoogle Scholar
  11. V. Bono, L. Padovani, and A. Tosatto. Polymorphic types for leak detection in a session-oriented functional language. In D. Beyer and M. Boreale, editors, Formal Techniques for Distributed Systems - Joint IFIP WG 6.1 International Conference, FMOODS/FORTE 2013, Held as Part of the 8th International Federated Conference on Distributed Computing Techniques, DisCoTec 2013, Florence, Italy, June 3-5, 2013. Proceedings, volume 7892 of Lecture Notes in Computer Science, pages 83–98. Springer, 2013.Google ScholarGoogle Scholar
  12. M. Boreale. On the expressiveness of internal mobility in namepassing calculi. In U. Montanari and V. Sassone, editors, CONCUR ’96, Concurrency Theory, 7th International Conference, Pisa, Italy, August 26-29, 1996, Proceedings, volume 1119 of Lecture Notes in Computer Science, pages 163–178. Springer, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. L. Caires and F. Pfenning. Session types as intuitionistic linear propositions. In P. Gastin and F. Laroussinie, editors, CONCUR 2010 - Concurrency Theory, 21th International Conference, CONCUR 2010, Paris, France, August 31-September 3, 2010. Proceedings, volume 6269 of Lecture Notes in Computer Science, pages 222–236. Springer, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. M. Carbone, S. Lindley, F. Montesi, C. Shürmann, and P. Wadler. Coherence generalises duality: a logical explanation of multiparty session types. In CONCUR. LIPICS, 2016. To appear.Google ScholarGoogle Scholar
  15. O. Danvy and L. R. Nielsen. A first-order one-pass CPS transformation. In M. Nielsen and U. Engberg, editors, Foundations of Software Science and Computation Structures, 5th International Conference, FOSSACS 2002. Held as Part of the Joint European Conferences on Theory and Practice of Software, ETAPS 2002 Grenoble, France, April 8-12, 2002, Proceedings, volume 2303 of Lecture Notes in Computer Science, pages 98–113. Springer, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. O. Dardha. Recursive session types revisited. In Proceedings Third Workshop on Behavioural Types, BEAT 2014, Rome, Italy, 1st September 2014.Google ScholarGoogle ScholarCross RefCross Ref
  17. , pages 27–34, 2014.Google ScholarGoogle Scholar
  18. O. Dardha, E. Giachino, and D. Sangiorgi. Session types revisited. In D. D. Schreye, G. Janssens, and A. King, editors, Principles and Practice of Declarative Programming, PPDP’12, Leuven, Belgium - September 19 - 21, 2012, pages 139–150. ACM, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. A. Filinski. Linear continuations. In R. Sethi, editor, Conference Record of the Nineteenth Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, Albuquerque, New Mexico, USA, January 19-22, 1992, pages 27–38. ACM Press, 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. P. Freyd. Algebraically complete categories. In G. R. Aurelio Carboni, Maria Cristina Pedicchio, editor, Category Theory - Proceedings of the International Conference held in Como, Italy, July 22–28, 1990. Springer, 1990.Google ScholarGoogle Scholar
  21. S. J. Gay and V. T. Vasconcelos. Linear type theory for asynchronous session types. Journal of Functional Programming, 20(01):19–50, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. J. A. Goguen, J. W. Thatcher, E. G. Wagner, and J. B. Wright. Initial algebra semantics and continuous algebras. J. ACM, 24(1):68–95, 1977. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. K. Honda. Types for dyadic interaction. In E. Best, editor, CONCUR ’93, 4th International Conference on Concurrency Theory, Hildesheim, Germany, August 23-26, 1993, Proceedings, volume 715 of Lecture Notes in Computer Science, pages 509–523. Springer, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. K. Honda, V. T. Vasconcelos, and M. Kubo. Language primitives and type discipline for structured communication-based programming. In C. Hankin, editor, ESOP, volume 1381 of Lecture Notes in Computer Science, pages 122–138. Springer, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. N. Kobayashi, B. C. Pierce, and D. N. Turner. Linearity and the picalculus. ACM Trans. Program. Lang. Syst., 21(5):914–947, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. J. Lévy and L. Maranget. Explicit substitutions and programming languages. In Foundations of Software Technology and Theoretical Computer Science, 1999, volume 1738 of LNCS. Springer, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. S. Lindley and J. G. Morris. A semantics for propositions as sessions. In Programming Languages and Systems - 24th European Symposium on Programming, ESOP 2015, Held as Part of the European Joint Conferences on Theory and Practice of Software, ETAPS 2015, London, UK, April 11-18, 2015. Proceedings, pages 560–584, 2015.Google ScholarGoogle Scholar
  28. S. Lindley and J. G. Morris. Lightweight functional session types, 2015.Google ScholarGoogle Scholar
  29. Draft http://homepages.inf.ed.ac.uk/slindley/ papers/fst-draft-february2015.pdf.Google ScholarGoogle Scholar
  30. B. Liskov and L. Shrira. Promises: Linguistic support for efficient asynchronous procedure calls in distributed systems. In Proceedings of the ACM SIGPLAN 1988 Conference on Programming Language Design and Implementation, PLDI ’88, pages 260–267, New York, NY, USA, 1988. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. E. Meijer, M. M. Fokkinga, and R. Paterson. Functional programming with bananas, lenses, envelopes and barbed wire. In J. Hughes, editor, Functional Programming Languages and Computer Architecture, 5th ACM Conference, Cambridge, MA, USA, August 26-30, 1991, Proceedings, volume 523 of Lecture Notes in Computer Science, pages 124–144. Springer, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. K. Takeuchi, K. Honda, and M. Kubo. An interaction-based language and its typing system. In C. Halatsis, D. G. Maritsas, G. Philokyprou, and S. Theodoridis, editors, PARLE ’94: Parallel Architectures and Languages Europe, 6th International PARLE Conference, Athens, Greece, July 4-8, 1994, Proceedings, volume 817 of Lecture Notes in Computer Science, pages 398–413. Springer, 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. The Links Team. Links, 2016. http://groups.inf.ed.ac.uk/ links.Google ScholarGoogle Scholar
  34. B. Toninho, L. Caires, and F. Pfenning. Corecursion and nondivergence in session-typed processes. In Trustworthy Global Computing - 9th International Symposium, TGC 2014, Rome, Italy, September 5-6, 2014. Revised Selected Papers, pages 159–175, 2014.Google ScholarGoogle Scholar
  35. V. T. Vasconcelos, S. J. Gay, and A. Ravara. Type checking a multithreaded functional language with session types. Theor. Comput. Sci., 368(1-2):64–87, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. P. Wadler. Propositions as sessions. J. Funct. Program., 24(2-3):384– 418, 2014.Google ScholarGoogle ScholarCross RefCross Ref

Index Terms

  1. Talking bananas: structural recursion for session types

      Recommendations

      Comments

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in

      Full Access

      • Published in

        cover image ACM SIGPLAN Notices
        ACM SIGPLAN Notices  Volume 51, Issue 9
        ICFP '16
        September 2016
        501 pages
        ISSN:0362-1340
        EISSN:1558-1160
        DOI:10.1145/3022670
        Issue’s Table of Contents
        • cover image ACM Conferences
          ICFP 2016: Proceedings of the 21st ACM SIGPLAN International Conference on Functional Programming
          September 2016
          501 pages
          ISBN:9781450342193
          DOI:10.1145/2951913

        Copyright © 2016 ACM

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 4 September 2016

        Check for updates

        Qualifiers

        • article

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader
      About Cookies On This Site

      We use cookies to ensure that we give you the best experience on our website.

      Learn more

      Got it!