Advertisement

Hybrid Session Verification Through Endpoint API Generation

  • Raymond Hu
  • Nobuko Yoshida
Part of the Lecture Notes in Computer Science book series (LNCS, volume 9633)

Abstract

This paper proposes a new hybrid session verification methodology for applying session types directly to mainstream languages, based on generating protocol-specific endpoint APIs from multiparty session types. The API generation promotes static type checking of the behavioural aspect of the source protocol by mapping the state space of an endpoint in the protocol to a family of channel types in the target language. This is supplemented by very light run-time checks in the generated API that enforce a linear usage discipline on instances of the channel types. The resulting hybrid verification guarantees the absence of protocol violation errors during the execution of the session. We implement our methodology for Java as an extension to the Scribble framework, and use it to specify and implement compliant clients and servers for real-world protocols such as HTTP and SMTP.

Keywords

State Channel Type Check Session Type Session Object Initiation Exchange 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

References

  1. 1.
    Bocchi, L., Chen, T.-C., Demangeon, R., Honda, K., Yoshida, N.: Monitoring networks through multiparty session types. In: Beyer, D., Boreale, M. (eds.) FORTE 2013 and FMOODS 2013. LNCS, vol. 7892, pp. 50–65. Springer, Heidelberg (2013)CrossRefGoogle Scholar
  2. 2.
    Caires, L., Pfenning, F.: Session types as intuitionistic linear propositions. In: Gastin, P., Laroussinie, F. (eds.) CONCUR 2010. LNCS, vol. 6269, pp. 222–236. Springer, Heidelberg (2010)CrossRefGoogle Scholar
  3. 3.
    Chen, T., Dezani-Ciancaglini, M., Yoshida, N.: On the preciseness of subtyping in session types. In: PPDP 2014, pp. 135–146. ACM (2014)Google Scholar
  4. 4.
    Coppo, M., Dezani-Ciancaglini, M., Padovani, L., Yoshida, N.: A gentle introduction to multiparty asynchronous session types. In: Bernardo, M., Johnsen, E.B. (eds.) Formal Methods for Multicore Programming. Lecture Notes in Computer Science, vol. 9104, pp. 146–178. Springer, Switzerland (2015)Google Scholar
  5. 5.
    Coppo, M., Dezani-Ciancaglini, M., Yoshida, N., Padovani, L.: Global progress for dynamically interleaved multiparty sessions. Math. Struct. Comput. Sci. 760, 1–65 (2015)MathSciNetCrossRefzbMATHGoogle Scholar
  6. 6.
    Dardha, O., Giachino, E., Sangiorgi, D.: Session types revisited. In: PPDP 2012, pp. 139–150. ACM Press (2012)Google Scholar
  7. 7.
    Demangeon, R., Honda, K.: Full abstraction in a subtyped pi-Calculus with linear types. In: Katoen, J.-P., König, B. (eds.) CONCUR 2011. LNCS, vol. 6901, pp. 280–296. Springer, Heidelberg (2011)CrossRefGoogle Scholar
  8. 8.
    Demangeon, R., Honda, K., Hu, R., Neykova, R., Yoshida, N.: Practical interruptible conversations: distributed dynamic verification with multiparty session types and Python. In: Formal Methods in System Design, pp. 1–29 (2015)Google Scholar
  9. 9.
    Deniélou, P.-M., Yoshida, N.: Multiparty session types meet communicating automata. In: Seidl, H. (ed.) Programming Languages and Systems. LNCS, vol. 7211, pp. 194–213. Springer, Heidelberg (2012)CrossRefGoogle Scholar
  10. 10.
    Deniélou, P.-M., Yoshida, N.: Multiparty compatibility in communicating automata: characterisation and synthesis of global session types. In: Fomin, F.V., Freivalds, R., Kwiatkowska, M., Peleg, D. (eds.) ICALP 2013, Part II. LNCS, vol. 7966, pp. 174–186. Springer, Heidelberg (2013)Google Scholar
  11. 11.
    Gay, S., Hole, M.: Subtyping for session types in the Pi-Calculus. Acta Informatica 42(2/3), 191–225 (2005)MathSciNetCrossRefzbMATHGoogle Scholar
  12. 12.
    Gay, S., Vasconcelos, V.T.: Linear type theory for asynchronous session types. J. Funct. Program. 20(1), 19–50 (2010)MathSciNetCrossRefzbMATHGoogle Scholar
  13. 13.
    Gay, S., Vasconcelos, V.T., Ravara, A., Gesbert, N., Caldeira, A.Z.: Modular session types for distributed object-oriented programming. In: POPL 2010, pp. 299–312. ACM (2010)Google Scholar
  14. 14.
    Honda, K., Vasconcelos, V.T., Kubo, M.: Language primitives and type discipline for structured communication-based programming. In: Hankin, C. (ed.) ESOP 1998. LNCS, vol. 1381, p. 122. Springer, Heidelberg (1998)CrossRefGoogle Scholar
  15. 15.
    Honda, K., Yoshida, N., Carbone, M.: Multiparty asynchronous session types. In: POPL 2008, pp. 273–284. ACM (2008). (Full version to appear in JACM)Google Scholar
  16. 16.
    Hu, R., Kouzapas, D., Pernet, O., Yoshida, N., Honda, K.: Type-safe eventful sessions in Java. In: D’Hondt, T. (ed.) ECOOP 2010. LNCS, vol. 6183, pp. 329–353. Springer, Heidelberg (2010)CrossRefGoogle Scholar
  17. 17.
    Hu, R., Yoshida, N., Honda, K.: Session-based distributed programming in Java. In: Vitek, J. (ed.) ECOOP 2008. LNCS, vol. 5142, pp. 516–541. Springer, Heidelberg (2008)CrossRefGoogle Scholar
  18. 18.
    IETF. Simple Mail Transfer Protocol. https://tools.ietf.org/html/rfc5321
  19. 19.
  20. 20.
    Lange, J., Tuosto, E., Yoshida, N.: From communicating machines to graphical choreographies. In: POPL 2015, pp. 221–232. ACM Press (2015)Google Scholar
  21. 21.
    Lindley, S., Morris, J.G.: A semantics for propositions as sessions. In: Vitek, J. (ed.) ESOP 2015. LNCS, vol. 9032, pp. 560–584. Springer, Heidelberg (2015)CrossRefGoogle Scholar
  22. 22.
  23. 23.
    Lopez, H.A., Marques, E.R.B., Martins, F., Ng, N., Santos, C., Vasconcelos, V.T., Yoshida, N.: Protocol-based verification of message-passing parallel programs. In: OOPSLA 2015, pp. 280–298. ACM (2015)Google Scholar
  24. 24.
    Mostrous, D., Vasconcelos, V.T.: Affine sessions. In: Kühn, E., Pugliese, R. (eds.) COORDINATION 2014. LNCS, vol. 8459, pp. 115–130. Springer, Heidelberg (2014)CrossRefGoogle Scholar
  25. 25.
    Mostrous, D., Yoshida, N.: Session typing and asynchronous subtyping for the higher-order \(\pi \)-calculus. Inf. Comput. 241, 227–263 (2015)MathSciNetCrossRefzbMATHGoogle Scholar
  26. 26.
  27. 27.
    Neubauer, M., Thiemann, P.: An implementation of session types. In: Jayaraman, B. (ed.) PADL 2004. LNCS, vol. 3057, pp. 56–70. Springer, Heidelberg (2004)CrossRefGoogle Scholar
  28. 28.
    Neykova, R., Bocchi, L., Yoshida, N.: Timed runtime monitoring for multiparty conversations. In: BEAT 2014, EPTCS, vol. 162, pp. 19–26 (2014)Google Scholar
  29. 29.
    Neykova, R., Yoshida, N.: Multiparty session actors. In: Kühn, E., Pugliese, R. (eds.) COORDINATION 2014. LNCS, vol. 8459, pp. 131–146. Springer, Heidelberg (2014)CrossRefGoogle Scholar
  30. 30.
    Ng, N., de Figueiredo Coutinho, J.G., Yoshida, N.: Protocols by default. In: Franke, B. (ed.) CC 2015. LNCS, vol. 9031, pp. 212–232. Springer, Heidelberg (2015)CrossRefGoogle Scholar
  31. 31.
    Ng, N., Yoshida, N., Honda, K.: Multiparty session C: safe parallel programming with message optimisation. In: Furia, C.A., Nanz, S. (eds.) TOOLS 2012. LNCS, vol. 7304, pp. 202–218. Springer, Heidelberg (2012)CrossRefGoogle Scholar
  32. 32.
    Padovani, L.: A Simple Library Implementation of Binary Sessions (Unpublished). https://hal.archives-ouvertes.fr/hal-01216310
  33. 33.
    Pfenning, F., Griffith, D.: Polarized substructural session types. In: Pitts, A. (ed.) FOSSACS 2015. LNCS, vol. 9034, pp. 3–22. Springer, Heidelberg (2015)CrossRefGoogle Scholar
  34. 34.
    Pucella, R., Tov, J.A.: Haskell session types with (almost) no class. In: Haskell 2008, pp. 25–36. ACM (2008)Google Scholar
  35. 35.
    Sackman, M., Eisenbach, S.: Session types in haskell (Unpublished). http://pubs.doc.ic.ac.uk/session-types-in-haskell/
  36. 36.
    Scalas, A., Yoshida, N.: Lightweight session types in Scala (Unpublished). http://www.doc.ic.ac.uk/research/technicalreports/2015/#7
  37. 37.
    Scribble homepage. http://www.scribble.org
  38. 38.
  39. 39.
    Sivaramakrishnan, K.C., Nagaraj, K., Ziarek, L., Eugster, P.: Efficient session type guided distributed interaction. In: Clarke, D., Agha, G. (eds.) COORDINATION 2010. LNCS, vol. 6116, pp. 152–167. Springer, Heidelberg (2010)CrossRefGoogle Scholar
  40. 40.
    Toninho, B., Caires, L., Pfenning, F.: Higher-order processes, functions, and sessions: a monadic integration. In: Felleisen, M., Gardner, P. (eds.) ESOP 2013. LNCS, vol. 7792, pp. 350–369. Springer, Heidelberg (2013)CrossRefGoogle Scholar
  41. 41.
    Wadler, P.: Proposition as sessions. In: ICFP 2012, pp. 273–286 (2012)Google Scholar
  42. 42.
    Survey on languages based on behavioural types. http://www.di.unito.it/~padovani/BETTY/BETTY_WG3_state_of_art.pdf
  43. 43.
    Yoshida, N., Hu, R., Neykova, R., Ng, N.: The scribble protocol language. In: Abadi, M., Lluch Lafuente, A. (eds.) TGC 2013. LNCS, vol. 8358, pp. 22–41. Springer, Heidelberg (2014)CrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2016

Authors and Affiliations

  1. 1.Imperial College LondonLondonUK

Personalised recommendations