skip to main content
research-article
Free Access

Context-Free Session Type Inference

Published:15 March 2019Publication History
Skip Abstract Section

Abstract

Some interesting communication protocols can be precisely described only by context-free session types, an extension of conventional session types supporting a general form of sequential composition. The complex metatheory of context-free session types, however, hinders the definition of corresponding checking and inference algorithms. In this work, we study a new syntax-directed type system for context-free session types that is easy to embed into a host programming language. We also detail 2 OCaml embeddings that allow us to piggyback on OCaml’s type system to check and infer context-free session types.

References

  1. Amal Ahmed, Matthew Fluet, and Greg Morrisett. 2007. L<sup>3</sup>: A linear language with locations. Fundamenta Informaticae 77, 4 (2007), 397--449. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Arthur Charguéraud and François Pottier. 2008. Functional translation of a calculus of capabilities. In Proceedings of the 13th ACM SIGPLAN International Conference on Functional Programming (ICFP’08). ACM, New York, NY, 213--224. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Bruno Courcelle. 1983. Fundamental properties of infinite trees. Theoretical Computer Science 25 (1983), 95--169.Google ScholarGoogle Scholar
  4. Ornela Dardha, Elena Giachino, and Davide Sangiorgi. 2017. Session types revisited. Information and Computation 256 (2017), 253--286. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Romain Demangeon and Kohei Honda. 2011. Full abstraction in a subtyped pi-calculus with linear types. In Concurrency Theory. Lecture Notes in Computer Science, Vol. 6901. Springer, 280--296. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Gert Florijn. 1995. Object protocols as functional parsers. In Object-Oriented Programming. Lecture Notes in Computer Science, Vol. 952. Springer, 351--373. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Emily P. Friedman. 1976. The inclusion problem for simple languages. Theoretical Computer Science 1, 4 (1976), 297--316.Google ScholarGoogle ScholarCross RefCross Ref
  8. Alain Frisch and Jacques Garrigue. 2010. First-class modules and composable signatures in Objective Caml 3.12. In Proceedings of the ACM SIGPLAN Workshop on Machine Learning.Google ScholarGoogle Scholar
  9. Simon 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
  10. Simon J. Gay and Vasco T. Vasconcelos. 2010. Linear type theory for asynchronous session types. Journal of Functional Programming 20, 1 (2010), 19--50. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Kohei Honda. 1993. Types for dyadic interaction. In Concurrency Theory. Lecture Notes in Computer Science, Vol. 715. Springer, 509--523. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Kohei Honda, Vasco T. Vasconcelos, and Makoto Kubo. 1998. Language primitives and type disciplines for structured communication-based programming In Programming Languages and Systems. Lecture Notes in Computer Science, Vol. 1381. Springer, 122--138. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Raymond Hu and Nobuko Yoshida. 2016. Hybrid session verification through endpoint API generation. In Fundamental Approaches to Software Engineering. Lecture Notes in Computer Science, Vol. 9633. Springer, 401--418.Google ScholarGoogle Scholar
  14. Hans Hüttel, Ivan Lanese, Vasco T. Vasconcelos, Luís Caires, Marco Carbone, Pierre-Malo Deniélou, et al. 2016. Foundations of session types and behavioural contracts. ACM Computing Surveys 49, 1 (2016), 3. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Atsushi Igarashi and Naoki Kobayashi. 2005. Resource usage analysis. ACM Transactions on Programming Languages and Systems 27, 2 (March 2005), 264--313. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. A. J. Kfoury, J. Tiuryn, and P. Urzyczyn. 1993. Type reconstruction in the presence of polymorphic recursion. ACM Transactions on Programming Languages and Systems 15, 2 (1993), 290--311. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Naoki Kobayashi. 2002. Type systems for concurrent programs. In Formal Methods at the Crossroads: From Panacea to Foundational Support. Lecture Notes in Computer Science. Springer, 439--453. Extended version available at http://www.kb.ecei.tohoku.ac.jp/koba/papers/tutorial-type-extended.pdf.Google ScholarGoogle ScholarCross RefCross Ref
  18. Naoki Kobayashi, Benjamin C. Pierce, and David N. Turner. 1999. Linearity and the pi-calculus. ACM Transactions on Programming Languages and Systems 21, 5 (1999), 914--947. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. A. J. Korenjak and J. E. Hopcroft. 1966. Simple deterministic languages. In Proceedings of the 7th Annual Symposium on Switching and Automata Theory (SWAT’66). IEEE, Los Alamitos, CA, 36--46. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. John Launchbury and Simon L. Peyton Jones. 1995. State in Haskell. Lisp and Symbolic Computation 8, 4 (1995), 293--341. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. John C. Mitchell and Gordon D. Plotkin. 1988. Abstract types have existential type. ACM Transactions on Programming Languages and Systems 10, 3 (1988), 470--502. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Eugenio Moggi and Amr Sabry. 2001. Monadic encapsulation of effects: A revised approach (extended version). Journal of Functional Programming 11, 6 (2001), 591--627. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Dimitris Mostrous, Nobuko Yoshida, and Kohei Honda. 2009. Global principal typing in partially commutative asynchronous sessions. In Programming Languages and Systems. Lecture Notes in Computer Science, Vol. 5502. Springer, 316--332. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Oscar Nierstrasz. 1993. Regular types for active objects. In Proceedings of the 8th Annual Conference on Object-Oriented Programming Systems, Languages, and Applications (OOPSLA’93). ACM, New York, NY, 1--15. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Luca Padovani. 2016. FuSe—A Simple Library Implementation of Binary Sessions. Retrieved May 27, 2018 from http://www.di.unito.it/~padovani/Software/FuSe/FuSe.html.Google ScholarGoogle Scholar
  26. Luca Padovani. 2017. A simple library implementation of binary sessions. Journal of Functional Programming 27 (2017), e4.Google ScholarGoogle ScholarCross RefCross Ref
  27. Luca Padovani. 2017. Context-free session type inference. In Programming Languages and Systems. Lecture Notes in Computer Science, Vol. 10201. Springer, 804--830. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. António Ravara and Vasco T. Vasconcelos. 2000. Typing non-uniform concurrent objects. In Concurrency Theory. Lecture Notes in Computer Science, Vol. 1877. Springer, 474--488. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. John H. Reppy. 1999. Concurrent Programming in ML. Cambridge University Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Mario Südholt. 2005. A model of components with non-regular protocols. In Software Composition. Lecture Notes in Computer Science, Vol. 3628. Springer, 99--113. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. Peter Thiemann and Vasco T. Vasconcelos. 2016. Context-free session types. In Proceedings of the 21st International Conference on Functional Programming (ICFP’16). ACM, New York, NY, 462--475. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. Jesse A. Tov. 2012. Practical Programming With Substructural Types. Ph.D. Dissertation. Northeastern University, Boston, MA. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. Jesse A. Tov and Riccardo Pucella. 2010. Stateful contracts for affine types. In Programming Languages and Systems. Lecture Notes in Computer Science, Vol. 6012. Springer, 550--569. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. Jesse A. Tov and Riccardo Pucella. 2011. Practical affine types. In Proceedings of the 38th Annual Symposium on Principles of Programming Languages (POPL’11). ACM, New York, NY, 447--458. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. Philip Wadler. 2014. Propositions as sessions. Journal of Functional Programming 24, 2-3 (2014), 384--418.Google ScholarGoogle ScholarCross RefCross Ref
  36. David Walker and Kevin Watkins. 2001. On regions and linear types. In Proceedings of the 6th International Conference on Functional Programming (ICFP’01). ACM, New York, NY, 181--192. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. Andrew K. Wright and Matthias Felleisen. 1994. A syntactic approach to type soundness. Information and Computation 115, 1 (1994), 38--94. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. Jeremy Yallop and Oleg Kiselyov. 2010. First-class modules: Hidden power and tantalizing promises. In Proceedings of the ACM SIGPLAN Workshop on Machine Learning.Google ScholarGoogle Scholar

Index Terms

  1. Context-Free Session Type Inference

            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 Transactions on Programming Languages and Systems
              ACM Transactions on Programming Languages and Systems  Volume 41, Issue 2
              Special Issue on ESOP 2017 and Regular Papers
              June 2019
              305 pages
              ISSN:0164-0925
              EISSN:1558-4593
              DOI:10.1145/3320016
              Issue’s Table of Contents

              Copyright © 2019 ACM

              Publisher

              Association for Computing Machinery

              New York, NY, United States

              Publication History

              • Published: 15 March 2019
              • Accepted: 1 May 2018
              • Revised: 1 January 2018
              • Received: 1 April 2017
              Published in toplas Volume 41, Issue 2

              Permissions

              Request permissions about this article.

              Request Permissions

              Check for updates

              Qualifiers

              • research-article
              • Research
              • Refereed

            PDF Format

            View or Download as a PDF file.

            PDF

            eReader

            View online with eReader.

            eReader

            HTML Format

            View this article in HTML Format .

            View HTML Format
            About Cookies On This Site

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

            Learn more

            Got it!