Advertisement

Types for Progress in Actor Programs

  • Minas Charalambides
  • Karl Palmskog
  • Gul AghaEmail author
Chapter
Part of the Lecture Notes in Computer Science book series (LNCS, volume 11665)

Abstract

Properties in the actor model can be described in terms of the message-passing behavior of actors. In this paper, we address the problem of using a type system to capture liveness properties of actor programs. Specifically, we define a simple actor language in which demands for certain types of messages may be generated during execution, in a manner specified by the programmer. For example, we may want to require that each request to an actor eventually results in a reply. The difficulty lies in that such requests can be generated dynamically, alongside the associated requirements for replies. Such replies might be sent in response to intermediate messages that never arrive, but the property may also not hold for more trivial reasons; for instance, when the code of potential senders of the reply omit the required sending command in some branches of a conditional statement. We show that, for a restricted class of actor programs, a system that tracks typestates can statically guarantee that such dynamically generated requirements will eventually be satisfied.

Keywords

Concurrency Actors Liveness Typestate 

Notes

Acknowledgments

We gratefully acknowledge Rocco De Nicola for inspiration, criticism, and enduring influence on our work. We also thank the anonymous reviewers for their comments. This work was supported in part by the National Science Foundation under grants NSF CCF 14-38982, NSF CCF 16-17401 and NSF-CCF-1647432.

References

  1. 1.
    Abd Alrahman, Y., De Nicola, R., Loreti, M.: A behavioural theory for interactions in collective-adaptive systems. CoRR abs/1711.09762 (2017). http://arxiv.org/abs/1711.09762
  2. 2.
    Agha, G., Mason, I.A., Smith, S.F., Talcott, C.L.: A foundation for actor computation. J. Funct. Program. 7(1), 1–72 (1997).  https://doi.org/10.1017/S095679689700261XMathSciNetCrossRefzbMATHGoogle Scholar
  3. 3.
    Agha, G., Thati, P.: An algebraic theory of actors and its application to a simple object-based language. In: Owe, O., Krogdahl, S., Lyche, T. (eds.) From Object-Orientation to Formal Methods. LNCS, vol. 2635, pp. 26–57. Springer, Heidelberg (2004).  https://doi.org/10.1007/978-3-540-39993-3_4CrossRefzbMATHGoogle Scholar
  4. 4.
    Agha, G.A.: ACTORS - A Model of Concurrent Computation in Distributed Systems. MIT Press, Cambridge (1990)Google Scholar
  5. 5.
    Alpern, B., Schneider, F.B.: Defining liveness. Inf. Process. Lett. 21(4), 181–185 (1985).  https://doi.org/10.1016/0020-0190(85)90056-0MathSciNetCrossRefzbMATHGoogle Scholar
  6. 6.
    Bettini, L., Coppo, M., D’Antoni, L., De Luca, M., Dezani-Ciancaglini, M., Yoshida, N.: Global progress in dynamically interleaved multiparty sessions. In: van Breugel, F., Chechik, M. (eds.) CONCUR 2008. LNCS, vol. 5201, pp. 418–433. Springer, Heidelberg (2008).  https://doi.org/10.1007/978-3-540-85361-9_33CrossRefGoogle Scholar
  7. 7.
    Boreale, M., Bruni, R., De Nicola, R., Loreti, M.: Sessions and pipelines for structured service programming. In: Barthe, G., de Boer, F.S. (eds.) FMOODS 2008. LNCS, vol. 5051, pp. 19–38. Springer, Heidelberg (2008).  https://doi.org/10.1007/978-3-540-68863-1_3CrossRefGoogle Scholar
  8. 8.
    Carbone, M., Dardha, O., Montesi, F.: Progress as compositional lock-freedom. In: Kühn, E., Pugliese, R. (eds.) COORDINATION 2014. LNCS, vol. 8459, pp. 49–64. Springer, Heidelberg (2014).  https://doi.org/10.1007/978-3-662-43376-8_4CrossRefGoogle Scholar
  9. 9.
    Carbone, M., Honda, K., Yoshida, N.: Structured communication-centred programming for web services. In: De Nicola, R. (ed.) ESOP 2007. LNCS, vol. 4421, pp. 2–17. Springer, Heidelberg (2007).  https://doi.org/10.1007/978-3-540-71316-6_2CrossRefzbMATHGoogle Scholar
  10. 10.
    Carbone, M., Honda, K., Yoshida, N.: Structured communication-centered programming for web services. ACM Trans. Program. Lang. Syst. 34(2), 8:1–8:78 (2012).  https://doi.org/10.1145/2220365.2220367CrossRefGoogle Scholar
  11. 11.
    Carbone, M., Montesi, F.: Deadlock-freedom-by-design: multiparty asynchronous global programming. In: Symposium on Principles of Programming Languages, pp. 263–274 (2013).  https://doi.org/10.1145/2429069.2429101
  12. 12.
    Castagna, G., De Nicola, R., Varacca, D.: Semantic subtyping for the pi-calculus. Theor. Comput. Sci. 398(1–3), 217–242 (2008).  https://doi.org/10.1016/j.tcs.2008.01.049MathSciNetCrossRefzbMATHGoogle Scholar
  13. 13.
    Charalambides, M.: Actor Programming with Static Guarantees. Ph.D. thesis, Urbana, Illinois (2018). http://hdl.handle.net/2142/101036
  14. 14.
    Charalambides, M., Dinges, P., Agha, G.: Parameterized concurrent multi-party session types. In: International Workshop on Foundations of Coordination Languages and Self Adaptation, pp. 16–30 (2012).  https://doi.org/10.4204/EPTCS.91.2CrossRefGoogle Scholar
  15. 15.
    Charalambides, M., Dinges, P., Agha, G.A.: Parameterized, concurrent session types for asynchronous multi-actor interactions. Sci. Comput. Program. 115–116, 100–126 (2016).  https://doi.org/10.1016/j.scico.2015.10.006CrossRefGoogle Scholar
  16. 16.
    Charalambides, M., Palmskog, K., Agha, G.: Types for progress in actor programs. In: Proceedings of the Workshop on Actors and Active Objects, Torino, Italy (2017)Google Scholar
  17. 17.
    De Nicola, R., Ferrari, G.L., Pugliese, R.: KLAIM: a kernel language for agents interaction and mobility. IEEE Trans. Softw. Eng. 24(5), 315–330 (1998).  https://doi.org/10.1109/32.685256CrossRefGoogle Scholar
  18. 18.
    De Nicola, R., et al.: From flow logic to static type systems for coordination languages. Sci. Comput. Program. 75(6), 376–397 (2010).  https://doi.org/10.1016/j.scico.2009.07.009MathSciNetCrossRefzbMATHGoogle Scholar
  19. 19.
    De Nicola, R., Loreti, M.: A modal logic for Klaim. In: Rus, T. (ed.) AMAST 2000. LNCS, vol. 1816, pp. 339–354. Springer, Heidelberg (2000).  https://doi.org/10.1007/3-540-45499-3_25CrossRefGoogle Scholar
  20. 20.
    Deniélou, P., Yoshida, N.: Dynamic multirole session types. In: Symposium on Principles of Programming Languages, pp. 435–446 (2011).  https://doi.org/10.1145/1926385.1926435
  21. 21.
    Dezani-Ciancaglini, M., Mostrous, D., Yoshida, N., Drossopoulou, S.: Session types for object-oriented languages. In: Thomas, D. (ed.) ECOOP 2006. LNCS, vol. 4067, pp. 328–352. Springer, Heidelberg (2006).  https://doi.org/10.1007/11785477_20CrossRefGoogle Scholar
  22. 22.
    Francez, N.: Fairness. Texts and Monographs in Computer Science. Springer, Heidelberg (1986).  https://doi.org/10.1007/978-1-4612-4886-6CrossRefzbMATHGoogle Scholar
  23. 23.
    Gay, S.J., Hole, M.: Subtyping for session types in the pi calculus. Acta Inf. 42(2–3), 191–225 (2005).  https://doi.org/10.1007/s00236-005-0177-zMathSciNetCrossRefzbMATHGoogle Scholar
  24. 24.
    Honda, K.: Types for dyadic interaction. In: International Conference on Concurrency Theory, pp. 509–523 (1993).  https://doi.org/10.1007/3-540-57208-2_35CrossRefGoogle Scholar
  25. 25.
    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, pp. 122–138. Springer, Heidelberg (1998).  https://doi.org/10.1007/BFb0053567CrossRefGoogle Scholar
  26. 26.
    Honda, K., Yoshida, N., Carbone, M.: Multiparty asynchronous session types. In: Symposium on Principles of Programming Languages, pp. 273–284 (2008).  https://doi.org/10.1145/1328438.1328472
  27. 27.
    Honda, K., Yoshida, N., Carbone, M.: Multiparty asynchronous session types. J. ACM 63(1), 9:1–9:67 (2016).  https://doi.org/10.1145/2827695MathSciNetCrossRefzbMATHGoogle Scholar
  28. 28.
    Akka, Lightbend Inc. http://akka.io
  29. 29.
    Scala, École Polytechnique Fédérale (EPFL) Lausanne, Switzerland: The scala programming language. https://www.scala-lang.org/
  30. 30.
    Kobayashi, N.: A partially deadlock-free typed process calculus. ACM Trans. Program. Lang. Syst. 20(2), 436–482 (1998).  https://doi.org/10.1145/276393.278524CrossRefGoogle Scholar
  31. 31.
    Kobayashi, N.: A type system for lock-free processes. Inf. Comput. 177(2), 122–159 (2002).  https://doi.org/10.1006/inco.2002.3171MathSciNetCrossRefzbMATHGoogle Scholar
  32. 32.
    Kobayashi, N., Saito, S., Sumii, E.: An implicitly-typed deadlock-free process calculus. In: Palamidessi, C. (ed.) CONCUR 2000. LNCS, vol. 1877, pp. 489–504. Springer, Heidelberg (2000).  https://doi.org/10.1007/3-540-44618-4_35CrossRefGoogle Scholar
  33. 33.
    Lamport, L.: Proving the correctness of multiprocess programs. IEEE Trans. Softw. Eng. 3(2), 125–143 (1977).  https://doi.org/10.1109/TSE.1977.229904MathSciNetCrossRefzbMATHGoogle Scholar
  34. 34.
    Milner, R., Parrow, J., Walker, D.: A calculus of mobile processes. I. Inf. Comput. 100(1), 1–40 (1992).  https://doi.org/10.1016/0890-5401(92)90008-4MathSciNetCrossRefzbMATHGoogle Scholar
  35. 35.
    Nielson, H.R., Nielson, F.: Flow logic: a multi-paradigmatic approach to static analysis. In: Mogensen, T.Æ., Schmidt, D.A., Sudborough, I.H. (eds.) The Essence of Computation. LNCS, vol. 2566, pp. 223–244. Springer, Heidelberg (2002).  https://doi.org/10.1007/3-540-36377-7_11CrossRefGoogle Scholar
  36. 36.
    Padovani, L.: From lock freedom to progress using session types. In: Workshop on Programming Language Approaches to Concurrency and Communication-cEntric Software, pp. 3–19 (2013).  https://doi.org/10.4204/EPTCS.137.2CrossRefGoogle Scholar
  37. 37.
    Pierce, B.C., Sangiorgi, D.: Typing and subtyping for mobile processes. Math. Struct. Comput. Sci. 6(5), 409–453 (1996)MathSciNetCrossRefGoogle Scholar
  38. 38.
    Puntigam, F.: Coordination requirements expressed in types for active objects. In: Akşit, M., Matsuoka, S. (eds.) ECOOP 1997. LNCS, vol. 1241, pp. 367–388. Springer, Heidelberg (1997).  https://doi.org/10.1007/BFb0053387CrossRefGoogle Scholar
  39. 39.
    Puntigam, F.: Concurrent Object-Oriented Programming with Process Types. Habilitationsschrift. Der Andere Verlag, Osnabrück, Germany (2000)Google Scholar
  40. 40.
    Puntigam, F., Peter, C.: Types for active objects with static deadlock prevention. Fundam. Inform. 48(4), 315–341 (2001)MathSciNetzbMATHGoogle Scholar
  41. 41.
    Strom, R.E., Yemini, S.: Typestate: a programming language concept for enhancing software reliability. IEEE Trans. Softw. Eng. 12(1), 157–171 (1986).  https://doi.org/10.1109/TSE.1986.6312929CrossRefzbMATHGoogle Scholar
  42. 42.
    Sumii, E., Kobayashi, N.: A generalized deadlock-free process calculus. Electron. Notes Theor. Comput. Sci. 16(3), 225–247 (1998).  https://doi.org/10.1016/S1571-0661(04)00144-6MathSciNetCrossRefzbMATHGoogle Scholar
  43. 43.
    Takeuchi, K., Honda, K., Kubo, M.: An interaction-based language and its typing system. In: Halatsis, C., Maritsas, D., Philokyprou, G., Theodoridis, S. (eds.) PARLE 1994. LNCS, vol. 817, pp. 398–413. Springer, Heidelberg (1994).  https://doi.org/10.1007/3-540-58184-7_118CrossRefGoogle Scholar
  44. 44.
    W3C: Extensible Markup Language. https://www.w3.org/XML/
  45. 45.
    W3C: The Web Services Choreography Description Language, November 2005. http://www.w3.org/TR/ws-cdl-10/
  46. 46.
    Yoshida, N., Deniélou, P.-M., Bejleri, A., Hu, R.: Parameterised multiparty session types. In: Ong, L. (ed.) FoSSaCS 2010. LNCS, vol. 6014, pp. 128–145. Springer, Heidelberg (2010).  https://doi.org/10.1007/978-3-642-12032-9_10CrossRefGoogle Scholar
  47. 47.
    Yoshida, N., Vasconcelos, V.T.: Language primitives and type discipline for structured communication-based programming revisited: two systems for higher-order session communication. Electron. Notes Theor. Comput. Sci. 171(4), 73–93 (2007).  https://doi.org/10.1016/j.entcs.2007.02.056CrossRefGoogle Scholar

Copyright information

© Springer Nature Switzerland AG 2019

Authors and Affiliations

  1. 1.University of Illinois at Urbana-ChampaignUrbanaUSA

Personalised recommendations