skip to main content
research-article
Open Access

Label-dependent session types

Published:20 December 2019Publication History
Skip Abstract Section

Abstract

Session types have emerged as a typing discipline for communication protocols. Existing calculi with session types come equipped with many different primitives that combine communication with the introduction or elimination of the transmitted value.

We present a foundational session type calculus with a lightweight operational semantics. It fully decouples communication from the introduction and elimination of data and thus features a single communication reduction, which acts as a rendezvous between senders and receivers. We achieve this decoupling by introducing label-dependent session types, a minimalist value-dependent session type system with subtyping. The system is sufficiently powerful to simulate existing functional session type systems. Compared to such systems, label-dependent session types place fewer restrictions on the code. We further introduce primitive recursion over natural numbers at the type level, thus allowing to describe protocols whose behaviour depends on numbers exchanged in messages. An algorithmic type checking system is introduced and proved equivalent to its declarative counterpart. The new calculus showcases a novel lightweight integration of dependent types and linear typing, with has uses beyond session type systems.

Skip Supplemental Material Section

Supplemental Material

a67-thiemann.webm

References

  1. Danel Ahman, Cédric Fournet, Catalin Hritcu, Kenji Maillard, Aseem Rastogi, and Nikhil Swamy. 2018. Recalling a Witness: Foundations and Applications of Monotonic State. PACMPL 2, POPL (2018), 65:1–65:30.Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. David Aspinall and Adriana B. Compagnoni. 2001. Subtyping Dependent Types. Theoretical Computer Science 266, 1-2 (2001), 273–309. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Robert Atkey. 2018. Syntax and Semantics of Quantitative Type Theory. In LICS. ACM, 56–65.Google ScholarGoogle Scholar
  4. Pedro Baltazar, Dimitris Mostrous, and Vasco Thudichum Vasconcelos. 2012. Linearly Refined Session Types. In LINEARITY (EPTCS), Vol. 101. 38–49.Google ScholarGoogle Scholar
  5. Jean-Philippe Bernardy, Mathieu Boespflug, Ryan R. Newton, Simon Peyton Jones, and Arnaud Spiwack. 2018. Linear Haskell: Practical Linearity in a Higher-Order Polymorphic Language. PACMPL 2, POPL (2018), 5:1–5:29.Google ScholarGoogle Scholar
  6. Eduardo Bonelli, Adriana B. Compagnoni, and Elsa L. Gunter. 2004. Correspondence Assertions for Process Synchronization in Concurrent Communications. Electr. Notes Theor. Comput. Sci. 97 (2004), 175–195. Google ScholarGoogle ScholarCross RefCross Ref
  7. Edwin Brady. 2013. Idris, A General-Purpose Dependently Typed Programming Language: Design and Implementation. J. Funct. Program. 23, 5 (2013), 552–593. Google ScholarGoogle ScholarCross RefCross Ref
  8. Edwin Brady. 2017. Type-driven Development of Concurrent Communicating Systems. Computer Science (AGH) 18, 3 (2017). Google ScholarGoogle ScholarCross RefCross Ref
  9. Luís Caires and Frank Pfenning. 2010. Session Types as Intuitionistic Linear Propositions. In CONCUR (LNCS), Vol. 6269. Springer, Paris, France, 222–236.Google ScholarGoogle Scholar
  10. Luís Caires, Frank Pfenning, and Bernardo Toninho. 2016. Linear logic propositions as session types. Mathematical Structures in Computer Science 26, 3 (2016), 367–423. Google ScholarGoogle ScholarCross RefCross Ref
  11. Chris Casinghino, Vilhelm Sjöberg, and Stephanie Weirich. 2014. Combining Proofs and Programs in a Dependently Typed Language. In POPL, Suresh Jagannathan and Peter Sewell (Eds.). ACM, 33–46. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Giuseppe Castagna, Mariangiola Dezani-Ciancaglini, Elena Giachino, and Luca Padovani. 2009. Foundations of Session Types. In Principles and Practice of Declarative Programming, PPDP 2009, António Porto and Francisco J. López-Fraguas (Eds.). ACM, Coimbra, Portugal, 219–230.Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Giuseppe Castagna, Tommaso Petrucciani, and Kim Nguyen. 2016. Set-Theoretic Types for Polymorphic Variants. In ICFP. ACM, 378–391.Google ScholarGoogle Scholar
  14. Iliano Cervesato and Frank Pfenning. 1996. A Linear Logical Framework. In LICS. IEEE Computer Society, 264–275.Google ScholarGoogle Scholar
  15. Tzu-Chun Chen, Mariangiola Dezani-Ciancaglini, Alceste Scalas, and Nobuko Yoshida. 2017. On the Preciseness of Subtyping in Session Types. Logical Methods in Computer Science 13, 2 (2017).Google ScholarGoogle Scholar
  16. Ugo Dal Lago and Marco Gaboardi. 2011. Linear Dependent Types and Relative Completeness. Logical Methods in Computer Science 8, 4 (2011).Google ScholarGoogle Scholar
  17. Ugo Dal Lago and Barbara Petit. 2012. Linear Dependent Types in a Call-By-Value Scenario. In PPDP. ACM, 115–126.Google ScholarGoogle Scholar
  18. Ornela Dardha, Elena Giachino, and Davide Sangiorgi. 2012. Session Types Revisited. In PPDP. ACM, 139–150.Google ScholarGoogle Scholar
  19. Mariangiola Dezani-Ciancaglini, Sophia Drossopoulou, Dimitris Mostrous, and Nobuko Yoshida. 2009. Objects and Session Types. Information and Computation 207, 5 (2009), 595–641.Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Joshua Dunfield and Neelakantan R. Krishnaswami. 2013. Complete and easy bidirectional typechecking for higher-rank polymorphism. In ICFP. ACM, 429–442.Google ScholarGoogle Scholar
  21. Francisco Ferreira and Brigitte Pientka. 2014. Bidirectional Elaboration of Dependently Typed Programs. In PPDP. ACM, 161–174.Google ScholarGoogle Scholar
  22. Jacques Garrigue. 1998. Programming with Polymorphic Variants. In In ACM Workshop on ML.Google ScholarGoogle Scholar
  23. Simon J. Gay and Malcolm Hole. 2005. Subtyping for Session Types in the Pi Calculus. Acta Informatica 42, 2-3 (2005), 191–225.Google ScholarGoogle ScholarCross RefCross Ref
  24. Simon J. Gay and Vasco Thudichum Vasconcelos. 2010. Linear Type Theory for Asynchronous Session Types. J. Funct. Program. 20, 1 (2010), 19–50.Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Simon J. Gay, Vasco T. Vasconcelos, António Ravara, Nils Gesbert, and Alexandre Z. Caldeira. 2010. Modular Session Types for Distributed Object-Oriented Programming, See [ POPL 2010 2010 ], 299–312. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Matthew A. Goto, Radha Jagadeesan, Alan Jeffrey, Corin Pitcher, and James Riely. 2016. An Extensible Approach to Session Polymorphism. Mathematical Structures in Computer Science 26, 3 (2016), 465–509.Google ScholarGoogle ScholarCross RefCross Ref
  27. Robert Harper. 2016. Practical Foundations for Programming Languages (second ed.). Cambridge University Press.Google ScholarGoogle Scholar
  28. Kohei Honda. 1993. Types for Dyadic Interaction. In Proceedings of 4th International Conference on Concurrency Theory (LNCS), Eike Best (Ed.). Springer, 509–523.Google ScholarGoogle ScholarCross RefCross Ref
  29. Kohei Honda, Aybek Mukhamedov, Gary Brown, Tzu-Chun Chen, and Nobuko Yoshida. 2011. Scribbling Interactions with a Formal Foundation. In ICDCIT 2011 (LNCS), Vol. 6536. Springer, Bhubaneshwar, India, 55–75.Google ScholarGoogle ScholarCross RefCross Ref
  30. Kohei Honda, Vasco Thudichum Vasconcelos, and Makoto Kubo. 1998. Language Primitives and Type Discipline for Structured Communication-Based Programming. In Proc. 7th ESOP (LNCS), Chris Hankin (Ed.), Vol. 1381. Springer, Lisbon, Portugal, 122–138.Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. Kohei Honda, Nobuko Yoshida, and Marco Carbone. 2008. Multiparty Asynchronous Session Types. In Proc. 35th ACM Symp. POPL, Phil Wadler (Ed.). ACM Press, San Francisco, CA, USA, 273–284.Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. Kohei Honda, Nobuko Yoshida, and Marco Carbone. 2016. Multiparty Asynchronous Session Types. J. ACM 63, 1 (2016), 9:1–9:67. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. Raymond Hu, Nobuko Yoshida, and Kohei Honda. 2008. Session-Based Distributed Programming in Java. In 22nd ECOOP (LNCS), Jan Vitek (Ed.), Vol. 5142. Springer, Paphos, Cyprus, 516–541.Google ScholarGoogle Scholar
  34. Atsushi Igarashi, Peter Thiemann, Vasco T. Vasconcelos, and Philip Wadler. 2017. Gradual Session Types. Proc. ACM Program. Lang. 1, ICFP, Article 38 (Sept. 2017), 28 pages. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. Naoki Kobayashi. 2002. Type Systems for Concurrent Programs. In 10th Anniversary Colloquium of UNU/IIST (Lecture Notes in Computer Science), Vol. 2757. Springer, 439–453.Google ScholarGoogle Scholar
  36. Naoki Kobayashi, Benjamin C. Pierce, and David N. Turner. 1996. Linearity and the pi-calculus. In Proc. 1996 ACM Symp. POPL. ACM Press, St. Petersburg Beach, FL, USA, 358–371.Google ScholarGoogle Scholar
  37. Neelakantan R. Krishnaswami, Pierre Pradic, and Nick Benton. 2015. Integrating Linear and Dependent Types. In POPL. ACM, 17–30.Google ScholarGoogle Scholar
  38. Sam Lindley and J. Garrett Morris. 2014. Sessions as Propositions. In Proceedings 7th Workshop on Programming Language Approaches to Concurrency and Communication-cEntric Software, PLACES 2014, Grenoble, France, 12 April 2014. (EPTCS), Alastair F. Donaldson and Vasco T. Vasconcelos (Eds.), Vol. 155. 9–16. Google ScholarGoogle ScholarCross RefCross Ref
  39. Sam Lindley and J. Garrett Morris. 2016. Talking Bananas: Structural Recursion for Session Types. In ICFP. ACM, 434–447.Google ScholarGoogle Scholar
  40. Karl Mazurak and Steve Zdancewic. 2010. Lolliproc: to concurrency from classical linear logic via curry-howard and control. In ICFP. ACM, 39–50.Google ScholarGoogle Scholar
  41. Conor McBride. 2016. I Got Plenty o’ Nuttin’. In A List of Successes That Can Change the World - Essays Dedicated to Philip Wadler on the Occasion of His 60th Birthday (LNCS), Sam Lindley, Conor McBride, Philip W. Trinder, and Donald Sannella (Eds.), Vol. 9600. Springer, 207–233. Google ScholarGoogle ScholarCross RefCross Ref
  42. J. Garrett Morris and James McKinna. 2019. Abstracting Extensible Data Types: or, Rows by Any Other Name. PACMPL 3, POPL (2019), 12:1–12:28. https://dl.acm.org/citation.cfm?id=3290325Google ScholarGoogle Scholar
  43. Susumu Nishimura. 1998. Static Typing for Dynamic Messages. In Proc. 25th ACM Symp. POPL, Luca Cardelli (Ed.). ACM Press, San Diego, CA, USA, 266–278. Google ScholarGoogle ScholarDigital LibraryDigital Library
  44. Luca Padovani. 2017a. Context-Free Session Type Inference. In ESOP (Lecture Notes in Computer Science), Vol. 10201. Springer, 804–830.Google ScholarGoogle Scholar
  45. Luca Padovani. 2017b. A Simple Library Implementation of Binary Sessions. J. Funct. Program. 27 (2017), e4. Google ScholarGoogle ScholarCross RefCross Ref
  46. Benjamin C. Pierce and David N. Turner. 2000. Local Type Inference. ACM TOPLAS 22, 1 (2000), 1–44. Google ScholarGoogle ScholarDigital LibraryDigital Library
  47. POPL 2010 2010. Proc. 37th ACM Symp. POPL. ACM Press, Madrid, Spain.Google ScholarGoogle Scholar
  48. Davide Sangiorgi. 1998. An Interpretation of Typed Objects into Typed pi-Calculus. Inf. Comput. 143, 1 (1998), 34–73.Google ScholarGoogle ScholarDigital LibraryDigital Library
  49. Alceste Scalas and Nobuko Yoshida. 2016. Lightweight Session Programming in Scala. In ECOOP (LIPIcs), Vol. 56. Schloss Dagstuhl - Leibniz-Zentrum fuer Informatik, 21:1–21:28.Google ScholarGoogle Scholar
  50. Rui Shi and Hongwei Xi. 2013. A Linear Type System for Multicore Programming in ATS. Science of Computer Programming 78, 8 (2013), 1176–1192. Google ScholarGoogle ScholarDigital LibraryDigital Library
  51. Vilhelm Sjöberg, Chris Casinghino, Ki Yung Ahn, Nathan Collins, Harley D. Eades III, Peng Fu, Garrin Kimmell, Tim Sheard, Aaron Stump, and Stephanie Weirich. 2012. Irrelevance, Heterogeneous Equality, and Call-by-value Dependent Type Systems. In Proceedings Fourth Workshop on Mathematically Structured Functional Programming, MSFP 2012, Tallinn, Estonia, 25 March 2012. (EPTCS), James Chapman and Paul Blain Levy (Eds.), Vol. 76. 112–162. Google ScholarGoogle ScholarCross RefCross Ref
  52. Nikhil Swamy, Juan Chen, Cédric Fournet, Pierre-Yves Strub, Karthikeyan Bhargavan, and Jean Yang. 2013. Secure Distributed Programming With Value-Dependent Types. J. Funct. Program. 23, 4 (2013), 402–451. Google ScholarGoogle ScholarCross RefCross Ref
  53. Kaku Takeuchi, Kohei Honda, and Makoto Kubo. 1994. An Interaction-Based Language and its Typing System. In 6th International PARLE Conference, C. Halatsis, D. Maritsas, G. Philokyprou, and S. Theodoridis (Eds.). LNCS, Vol. 817. Springer, Athens, Greece, 398–413.Google ScholarGoogle ScholarCross RefCross Ref
  54. Peter Thiemann and Vasco T. Vasconcelos. 2019. Label-Dependent Session Types. CoRR abs/1911.00705 (2019). http: //arxiv.org/abs/1911.00705 extended version.Google ScholarGoogle Scholar
  55. Bernardo Toninho, Luís Caires, and Frank Pfenning. 2011. Dependent Session Types via Intuitionistic Linear Type Theory. In PPDP, Peter Schneider-Kamp and Michael Hanus (Eds.). ACM, Odense, Denmark, 161–172.Google ScholarGoogle Scholar
  56. Bernardo Toninho and Nobuko Yoshida. 2018. Depending on Session-Typed Processes. In FoSSaCS (Lecture Notes in Computer Science), Vol. 10803. Springer, 128–145.Google ScholarGoogle Scholar
  57. Vasco T. Vasconcelos. 2012. Fundamentals of Session Types. Information and Control 217 (2012), 52–70.Google ScholarGoogle ScholarDigital LibraryDigital Library
  58. Vasco T. Vasconcelos, António Ravara, and Simon J. Gay. 2006. Type Checking a Multithreaded Functional Language with Session Types. Theoretical Computer Science 368, 1-2 (2006), 64–87.Google ScholarGoogle ScholarDigital LibraryDigital Library
  59. Vasco Thudichum Vasconcelos and Mario Tokoro. 1993. A Typing System for a Calculus of Objects. In ISOTAS (Lecture Notes in Computer Science), Vol. 742. Springer, 460–474.Google ScholarGoogle Scholar
  60. Philip Wadler. 2012. Propositions as Sessions. In ICFP’12, Robby Bruce Findler (Ed.). ACM, Copenhagen, Denmark, 273–286.Google ScholarGoogle Scholar
  61. David Walker. 2005. Substructural Type Systems. In Advanced Topics in Types and Programming Languages, Benjamin C. Pierce (Ed.). MIT Press, Chapter 1.Google ScholarGoogle Scholar
  62. Hanwen Wu and Hongwei Xi. 2017. Dependent Session Types. http://arxiv.org/abs/1704.07004. (2017). arXiv CoRR.Google ScholarGoogle Scholar

Index Terms

  1. Label-dependent 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 Proceedings of the ACM on Programming Languages
          Proceedings of the ACM on Programming Languages  Volume 4, Issue POPL
          January 2020
          1984 pages
          EISSN:2475-1421
          DOI:10.1145/3377388
          Issue’s Table of Contents

          Copyright © 2019 Owner/Author

          Publisher

          Association for Computing Machinery

          New York, NY, United States

          Publication History

          • Published: 20 December 2019
          Published in pacmpl Volume 4, Issue POPL

          Permissions

          Request permissions about this article.

          Request Permissions

          Check for updates

          Qualifiers

          • research-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!