skip to main content
10.1145/2967973.2968595acmotherconferencesArticle/Chapter ViewAbstractPublication PagesppdpConference Proceedingsconference-collections
research-article

Typechecking protocols with Mungo and StMungo

Published:05 September 2016Publication History

ABSTRACT

We report on two tools that extend Java with support for static type-checking of communication protocols. Our Mungo tool extends Java with typestate definitions, which allow classes to be associated with state machines defining permitted sequences of method calls. A complementary tool, StMungo, takes a communication protocol specified in the Scribble protocol description language, and generates a typestate specification for each endpoint, capturing the permitted sequences of messages along that channel. Endpoint implementations can be validated by Mungo against their typestate definitions and then compiled as usual with javac. We formalise Mungo's typestate inference system and demonstrate the Scribble, Mungo and StMungo toolchain via a typechecked SMTP client that can communicate with a real-world SMTP server.

References

  1. Mungo Webpage. http://www.dcs.gla.ac.uk/research/mungo/.Google ScholarGoogle Scholar
  2. Jonathan Aldrich, Joshua Sunshine, Darpan Saini, and Zachary Sparks. Typestate-oriented programming. In OOPSLA '09, pages 1015--1022. ACM Press, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Chris Allan, Pavel Avgustinov, Aske Simon Christensen, Laurie J. Hendren, Sascha Kuzins, Ondrej Lhoták, Oege de Moor, Damien Sereni, Ganesh Sittampalam, and Julian Tibble. Adding trace matching with free variables to Aspect J. In OOPSLA '05, pages 345--364. ACM Press, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Nels E. Beckman, Kevin Bierhoff, and Jonathan Aldrich. Verifying correct usage of atomic blocks and typestate. In OOPSLA '08, pages 227--244. ACM Press, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Kevin Bierhoff and Jonathan Aldrich. Modular typestate checking of aliased objects. In OOPSLA '07, pages 301--320. ACM Press, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Kevin Bierhoff, Nels E. Beckman, and Jonathan Aldrich. Practical API protocol checking with access permissions. In ECOOP '09, volume 5653 of Springer LNCS, pages 195--219, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Eric Bodden and Laurie J. Hendren. The Clara framework for hybrid typestate analysis. Software Tools for Technology Transfer, 14(3):307--326, 2012.Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Viviana Bono, Chiara Messa, and Luca Padovani. Typing copyless message passing. In ESOP '11, volume 6602 of Springer LNCS, pages 57--76, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Sara Capecchi, Mario Coppo, Mariangiola Dezani-Ciancaglini, Sophia Drossopoulou, and Elena Giachino. Amalgamating sessions and methods in object-oriented languages with generics. Theoret. Comp. Sci., 410:142--167, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Marco Carbone, Kohei Honda, and Nobuko Yoshida. Structured interactional exceptions in session types. In CONCUR'08, volume 5201 of Springer LNCS, pages 402--417, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Silvia Crafa and Luca Padovani. The chemical approach to typestate-oriented programming. In OOPSLA '15, pages 917--934. ACM Press, 2015. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Robert DeLine and Manuel Fähndrich. Enforcing high-level protocols in low-level software. In PLDI '01, pages 59--69. ACM Press, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Robert DeLine and Manuel Fähndrich. Typestates for objects. In ECOOP '04, volume 3086 of Springer LNCS, pages 465--490, 2004.Google ScholarGoogle Scholar
  14. Mariangiola Dezani-Ciancaglini, Sophia Drossopoulou, Dimitris Mostrous, and Nobuko Yoshida. Objects and session types. Information and Computation, 207(5):595--641, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Mariangiola Dezani-Ciancaglini, Elena Giachino, Sophia Drossopoulou, and Nobuko Yoshida. Bounded session types for object oriented languages. In FMCO '06, volume 4709 of Springer LNCS, pages 207--245, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Mariangiola Dezani-Ciancaglini, Dimitris Mostrous, Nobuko Yoshida, and Sophia Drossopolou. Session types for object-oriented languages. In ECOOP '06, volume 4067 of Springer LNCS, pages 328--352, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Mariangiola Dezani-Ciancaglini, Nobuko Yoshida, Alexander Ahern, and Sophia Drossopolou. A distributed object-oriented language with session types. In TGC '05, volume 3705 of Springer LNCS, pages 299--318, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Manuel Fähndrich, Mark Aiken, Chris Hawblitzel, Orion Hodson, Galen Hunt, James R. Larus, and Steven Levi. Language support for fast and reliable message-based communication in Singularity OS. In EuroSys '06, pages 177--190. ACM Press, 2006.Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Manuel Fähndrich and Robert DeLine. Adoption and focus: Practical linear types for imperative programming. In PLDI '02, pages 13--24. ACM Press, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Ronald Garcia, Éric Tanter, Roger Wolff, and Jonathan Aldrich. Foundations of typestate-oriented programming. ACM Trans. Program. Lang. Syst., 36(4):12:1--12:44, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Simon J. Gay and Malcolm J. Hole. Subtyping for session types in the pi calculus. Acta Informatica, 42(2/3):191--225, 2005.Google ScholarGoogle ScholarCross RefCross Ref
  22. Simon J. Gay and Vasco T. Vasconcelos. Linear type theory for asynchronous session types. Journal of Functional Programming, 20(1):19--50, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Simon J. Gay, Vasco T. Vasconcelos, António Ravara, Nils Gesbert, and Alexandre Z. Caldeira. Modular session types for distributed object-oriented programming. In POPL '10, pages 299--312. ACM Press, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Görel Hedin. An introductory tutorial on Jast Add attribute grammars. In Generative and Transformational Techniques in Software Engineering III, volume 6491 of Springer LNCS, pages 166--200, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. K. Honda, N. Yoshida, and M. Carbone. Multiparty asynchronous session types. In POPL '08, pages 273--284. ACM Press, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Raymond Hu, Dimitrios Kouzapas, Olivier Pernet, Nobuko Yoshida, and Kohei Honda. Type-safe eventful sessions in Java. In ECOOP '10, volume 6183 of Springer LNCS, pages 329--353, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Raymond Hu and Nobuko Yoshida. Hybrid session verification through endpoint API generation. In FASE '16, volume 9633 of Springer LNCS, pages 401--418, 2016.Google ScholarGoogle Scholar
  28. Raymond Hu, Nobuko Yoshida, and Kohei Honda. Session-based distributed programming in Java. In ECOOP '08, volume 5142 of Springer LNCS, pages 516--541, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Idris language homepage. www.idris-lang.org.Google ScholarGoogle Scholar
  30. Dimitrios Kouzapas, Ornela Dardha, Roly Perera, and Simon J. Gay. Typechecking protocols with Mungo and StMungo (long version). http://www.dcs.gla.ac.uk/research/mungo/papers/mungo.pdf.Google ScholarGoogle Scholar
  31. Message Passing Forum. MPI: A message-passing interface standard. Technical report, University of Tennessee, 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. Filipe Militão, Jonathan Aldrich, and Luís Caires. Aliasing control with view-based typestate. In FTfJP '10. ACM Press, 2010.Google ScholarGoogle Scholar
  33. Matthias Neubauer and Peter Thiemann. An implementation of session types. In PADL '04, volume 3057 of Springer LNCS, pages 56--70, 2004.Google ScholarGoogle Scholar
  34. Rumyana Neykova and Nobuko Yoshida. Multiparty session actors. In COORDINATION '14, volume 8459 of Springer LNCS, pages 131--146, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. Rumyana Neykova, Nobuko Yoshida, and Raymond Hu. SPY: local verification of global protocols. In RV '13, volume 8174 of Springer LNCS, pages 358--363, 2013.Google ScholarGoogle Scholar
  36. Nicholas Ng, José Gabriel de Figueiredo Coutinho, and Nobuko Yoshida. Protocols by default - safe MPI code generation based on session types. In CC '15, volume 9031 of Springer LNCS, pages 212--232, 2015.Google ScholarGoogle Scholar
  37. Nicholas Ng, Nobuko Yoshida, and Kohei Honda. Multiparty session C: safe parallel programming with message optimisation. In TOOLS '12, volume 7304 of Springer LNCS, pages 202--218, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. Nicholas Ng, Nobuko Yoshida, Olivier Pernet, Raymond Hu, and Yiannos Kryftis. Safe parallel programming with Session Java. In COORDINATION '11, volume 6721 of Springer LNCS, pages 110--126, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. Riccardo Pucella and Jesse A. Tov. Haskell session types with (almost) no class. In Proceedings of the 1st ACM SIGPLAN Symposium on Haskell, pages 25--36. ACM Press, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. Rust language homepage. www.rust-lang.org.Google ScholarGoogle Scholar
  41. Scribble project homepage. www.scribble.org.Google ScholarGoogle Scholar
  42. Extended simple mail transfer protocol, RFC 5321. https://tools.ietf.org/html/rfc5321.Google ScholarGoogle Scholar
  43. Robert E. Strom and Shaula Yemini. Typestate: A programming language concept for enhancing software reliability. IEEE Trans. Softw. Eng., 12(1):157--171, 1986. Google ScholarGoogle ScholarDigital LibraryDigital Library
  44. Joshua Sunshine, Karl Naden, Sven Stork, Jonathan Aldrich, and Éric Tanter. First-class state change in Plaid. In OOPSLA '11, pages 713--732. ACM Press, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  45. Roger Wolff, Ronald Garcia, Eric Tanter, and Jonathan Aldrich. Gradual typestate. In ECOOP '11, volume 6813 of Springer LNCS, pages 459--483, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  46. Nobuko Yoshida, Raymond Hu, Rumyana Neykova, and Nicholas Ng. The Scribble protocol language. In TGC '13, volume 8358 of Springer LNCS, pages 22--41, 2013.Google ScholarGoogle Scholar

Index Terms

  1. Typechecking protocols with Mungo and StMungo

            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
            • Published in

              cover image ACM Other conferences
              PPDP '16: Proceedings of the 18th International Symposium on Principles and Practice of Declarative Programming
              September 2016
              249 pages
              ISBN:9781450341486
              DOI:10.1145/2967973
              • Conference Chair:
              • James Cheney,
              • Program Chair:
              • Germán Vidal

              Copyright © 2016 ACM

              Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

              Publisher

              Association for Computing Machinery

              New York, NY, United States

              Publication History

              • Published: 5 September 2016

              Permissions

              Request permissions about this article.

              Request Permissions

              Check for updates

              Qualifiers

              • research-article

              Acceptance Rates

              PPDP '16 Paper Acceptance Rate17of37submissions,46%Overall Acceptance Rate230of486submissions,47%

            PDF Format

            View or Download as a PDF file.

            PDF

            eReader

            View online with eReader.

            eReader