Abstract
Effect and session type systems are two expressive behavioural type systems. The former is usually developed in the context of the lambda-calculus and its variants, the latter for the pi-calculus. In this paper we explore their relative expressive power. Firstly, we give an embedding from PCF, augmented with a parameterised effect system, into a session-typed pi-calculus (session calculus), showing that session types are powerful enough to express effects. Secondly, we give a reverse embedding, from the session calculus back into PCF, by instantiating PCF with concurrency primitives and its effect system with a session-like effect algebra; effect systems are powerful enough to express sessions. The embedding of session types into an effect system is leveraged to give a new implementation of session types in Haskell, via an effect system encoding. The correctness of this implementation follows from the second embedding result. We also discuss various extensions to our embeddings.
- Samson Abramsky, Radha Jagadeesan, and Pasquale Malacaria. Full abstraction for PCF. TCS, 163:409–470, 2000. Google Scholar
Digital Library
- Robert Atkey. Parameterised notions of computation. Journal of Functional Programming, 19(3-4):335–376, 2009. Google Scholar
Digital Library
- Andrej Bauer and Matija Pretnar. Programming with algebraic effects and handlers. JLAMP, 84(1):108–123, 2015.Google Scholar
- Martin Berger, Kohei Honda, and Nobuko Yoshida. Sequentiality and the π-calculus. In Proc. TLCA’01, volume 2044 of LNCS, pages 29– 45, 2001. Google Scholar
Digital Library
- Martin Berger, Kohei Honda, and Nobuko Yoshida. Genericity and the pi-calculus. Acta Inf., 42(2-3):83–141, 2005. Google Scholar
Digital Library
- Lu´ıs Caires, Jorge A. Pérez, Frank Pfenning, and Bernardo Toninho. Behavioral polymorphism and parametricity in session-based communication. In ESOP, volume 7792 of LNCS, pages 330–349. Springer, 2013. Google Scholar
Digital Library
- Lu´ıs Caires and Frank Pfenning. Session types as intuitionistic linear propositions. In CONCUR, volume 6269 of LNCS, pages 222–236. Springer, 2010. Google Scholar
Digital Library
- Sara Capecchi, Elena Giachino, and Nobuko Yoshida. Global escape in multiparty sessions. MSCS, 29:1–50, 2015.Google Scholar
- Marco Carbone, Kohei Honda, and Nobuko Yoshida. Structured interactional exceptions in session types. In CONCUR, volume 5201 of LNCS, pages 402–417. Springer, 2008. Google Scholar
Digital Library
- Marco Carbone, Kohei Honda, and Nobuko Yoshida. Structured communication-centered programming for web services. TOPLAS, 34:8:1–8:78, 2012. Google Scholar
Digital Library
- Tzu-Chun Chen, Mariangiola Dezani-Ciancaglini, and Nobuko Yoshida. On the preciseness of subtyping in session types. In PPDP’14, pages 146–135. ACM Press, 2014. Google Scholar
Digital Library
- Ezgi C ¸ ic¸ek, Deepak Garg, and Umut Acar. Refinement types for incremental computational complexity. In ESOP, pages 406–431. Springer, 2015.Google Scholar
- Nils Anders Danielsson. Lightweight semiformal time complexity analysis for purely functional data structures. In ACM SIGPLAN Notices, volume 43, pages 133–144. ACM, 2008. Google Scholar
Digital Library
- Ornela Dardha, Elena Giachino, and Davide Sangiorgi. Session types revisited. In PPDP’12, pages 139–150. ACM, 2012. Google Scholar
Digital Library
- Romain Demangeon and Kohei Honda. Full abstraction in a subtyped pi-calculus with linear types. In CONCUR, volume 6901 of LNCS, pages 280–296. Springer, 2011. Google Scholar
Digital Library
- Romain Demangeon, Kohei Honda, Raymond Hu, Rumyana Neykova, and Nobuko Yoshida. Practical interruptible conversations: Distributed dynamic verification with multiparty session types and Python. Formal Methods in System Design, 46(3):197–225, 2015. Google Scholar
Digital Library
- Richard A Eisenberg, Dimitrios Vytiniotis, Simon Peyton Jones, and Stephanie Weirich. Closed type families with overlapping equations. In Proceedings of POPL 2014, pages 671–684, 2014. Google Scholar
Digital Library
- Andrezej Filinski. Controlling effects. Technical report, DTIC Document, 1996.Google Scholar
- Simon Gay and Malcolm Hole. Subtyping for Session Types in the Pi-Calculus. Acta Informatica, 42(2/3):191–225, 2005. Google Scholar
Digital Library
- David K. Gifford and John M. Lucassen. Integrating functional and imperative programming. In LFP’86, pages 28–38. ACM, 1986. Google Scholar
Digital Library
- Jean-Yves Girard, Yves Lafont, and Paul Taylor. Proofs and Types, volume 7 of Cambridge Tracts in Theoretical Computer Science. CUP, 1989. Google Scholar
Digital Library
- Kohei Honda, Vasco T. Vasconcelos, and Makoto Kubo. Language primitives and type disciplines for structured communication-based programming. In ESOP’98, volume 1381 of LNCS, pages 22–138. Springer, 1998. Google Scholar
Digital Library
- Kohei Honda and Nobuko Yoshida. On reduction-based process semantics. TCS, 151(2):437–486, 1995. Google Scholar
Digital Library
- Kohei Honda and Nobuko Yoshida. A uniform type structure for secure information flow. TOPLAS, 29(6), 2007. Google Scholar
Digital Library
- Kohei Honda, Nobuko Yoshida, and Marco Carbone. Multiparty Asynchronous Session Types. In POPL, pages 273–284. ACM, 2008. Google Scholar
Digital Library
- a full version will appear in JACM.Google Scholar
- Martin Hyland and Luke Ong. On full abstraction for PCF. Inf. & Comp., 163:285––408, 2000. Google Scholar
Digital Library
- Keigo Imai, Shoji Yuen, and Kiyoshi Agusa. Session Type Inference in Haskell. In Proc. of PLACES, volume 69 of EPTCS, pages 74–91, 2010.Google Scholar
- Pierre Jouvelot and David K. Gifford. Communication Effects for Message-Based Concurrency. Technical report, MIT, 1989.Google Scholar
- Ohad Kammar and Gordon D Plotkin. Algebraic foundations for effect-dependent optimisations. In ACM SIGPLAN Notices, volume 47, pages 349–360. ACM, 2012. Google Scholar
Digital Library
- Shin-ya Katsumata. Parametric effect monads and semantics of effect systems. In POPL, pages 633–646. ACM, 2014. Google Scholar
Digital Library
- Naoki Kobayashi, Benjamin C. Pierce, and David N. Turner. Linearity and the Pi-Calculus. TOPLAS, 21(5):914–947, September 1999. Google Scholar
Digital Library
- Sam Lindley and Garrett Morris. A semantics for propositions as sessions. In ESOP, pages 560–584. Springer, 2015.Google Scholar
- Robin Milner. Functions as processes. MSCS, 2(2):119–141, 1992.Google Scholar
- Eugenio Moggi. Notions of computation and monads. Inf. Comput., 93(1):55–92, 1991. Google Scholar
Digital Library
- Dimitris Mostrous and Nobuko Yoshida. Session typing and asynchronous subtyping for the higher-order π-calculus. Inf. Comput., 241:227–263, 2015. Google Scholar
Digital Library
- Alan Mycroft, Dominic Orchard, and Tomas Petricek. Effect systems revisited– control-flow algebra and semantics. volume 9560 of LNCS. Springer, 2016.Google Scholar
- Matthias Neubauer and Peter Thiemann. An Implementation of Session Types. In PADL, volume 3057 of LNCS, pages 56–70. Springer, 2004.Google Scholar
- Flemming Nielson and Hanne Riis Nielson. Type and effect systems. In Correct System Design, pages 114–136. Springer, 1999. Google Scholar
Digital Library
- Dominic Orchard and Tomas Petricek. Embedding effect systems in Haskell. In Haskell Symposium, pages 13–24, 2014. Google Scholar
Digital Library
- Dominic Orchard, Tomas Petricek, and Alan Mycroft. The semantic marriage of monads and effects. arXiv:1401.5391, 2014.Google Scholar
- Dominic Orchard and Nobuko Yoshida. Effects as Sessions, Sessions as Effects (with appendices). Technical Report 2015/5, Department of Computing, Imperial College London, UK, 2015. http://www.doc. ic.ac.uk/research/technicalreports/2015/DTR15-5.pdf.Google Scholar
- Dominic Orchard and Nobuko Yoshida. Using session types as an effect system. In Post-proceedings of PLACES, EPTCS, 2015.Google Scholar
- Jorge A. Pérez, Lu´ıs Caires, Frank Pfenning, and Bernardo Toninho. Linear logical relations and observational equivalences for sessionbased concurrency. Inf. Comput., 239:254–302, 2014.Google Scholar
Digital Library
- Benjamin Pierce and Davide Sangiorgi. Typing and subtyping for mobile processes. MSCS, 6(5):409–454, 1996.Google Scholar
- Benjamin Pierce and Davide Sangiorgi. Behavioral equivalence in the polymorphic pi-calculus. Journal of ACM, 47(3):531–584, 2000. Google Scholar
Digital Library
- Gordon Plotkin and John Power. Algebraic operations and generic effects. Applied Categorical Structures, 11(1):69–94, 2003.Google Scholar
Cross Ref
- Riccardo Pucella and Jesse A. Tov. Haskell session types with (almost) no class. In Proc. of Haskell symposium ’08, pages 25–36. ACM, 2008. Google Scholar
Digital Library
- Matthew Sackman and Susan Eisenbach. Session Types in Haskell (Updating Message Passing for the 21st Century), 2008. Technical report, Imperial College London.Google Scholar
- Davide Sangiorgi and David Walker. The π-Calculus: a Theory of Mobile Processes. Cambridge University Press, 2001. Google Scholar
Digital Library
- Jean-Pierre Talpin and Pierre Jouvelot. The type and effect discipline. In Proc. LICS’92, pages 162–173, 1992.Google Scholar
Cross Ref
- Bernardo Toninho, Lu´ıs Caires, and Frank Pfenning. Functions as Session-Typed Processes. In FoSSaCs, LNCS, pages 346–360. Springer, 2012. Google Scholar
Digital Library
- Bernardo Toninho, Lu´ıs Caires, and Frank Pfenning. Higher-order processes, functions, and sessions: A monadic integration. In ESOP, volume 7792 of LNCS, pages 350–369. Springer, 2013. Google Scholar
Digital Library
- Philip Wadler. Propositions as sessions. J. Funct. Program., 24(2- 3):384–418, 2014.Google Scholar
Cross Ref
- Philip Wadler and Peter Thiemann. The marriage of effects and monads. ACM Trans. Comput. Logic, 4:1–32, January 2003. Google Scholar
Digital Library
- Brent A Yorgey, Stephanie Weirich, Julien Cretin, Simon Peyton Jones, Dimitrios Vytiniotis, and José Pedro Magalh˜aes. Giving Haskell a promotion. In Proc. of TLDI, pages 53–66. ACM, 2012. Google Scholar
Digital Library
- Nobuko Yoshida, Martin Berger, and Kohei Honda. Strong normalisation in the pi -calculus. Inf. Comput., 191(2):145–202, 2004. Google Scholar
Digital Library
- Nobuko Yoshida and Vasco Thudichum Vasconcelos. Language primitives and type discipline for structured communication-based programming revisited: Two systems for higher-order session communication. Electr. Notes Theor. Comput. Sci., 171(4):73–93, 2007. Google Scholar
Digital Library
Index Terms
Effects as sessions, sessions as effects
Recommendations
Effects as sessions, sessions as effects
POPL '16: Proceedings of the 43rd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming LanguagesEffect and session type systems are two expressive behavioural type systems. The former is usually developed in the context of the lambda-calculus and its variants, the latter for the pi-calculus. In this paper we explore their relative expressive ...
Recursive type generativity
Proceedings of the tenth ACM SIGPLAN international conference on Functional programmingExistential types provide a simple and elegant foundation for understanding generative abstract data types, of the kind supported by the Standard ML module system. However, in attempting to extend ML with support for recursive modules, we have found ...
Recursive type generativity
ICFP '05: Proceedings of the tenth ACM SIGPLAN international conference on Functional programmingExistential types provide a simple and elegant foundation for understanding generative abstract data types, of the kind supported by the Standard ML module system. However, in attempting to extend ML with support for recursive modules, we have found ...






Comments