Types for Progress in Actor Programs

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


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.


Concurrency Actors Liveness Typestate 



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.


  1. 1.
    Abd Alrahman, Y., De Nicola, R., Loreti, M.: A behavioural theory for interactions in collective-adaptive systems. CoRR abs/1711.09762 (2017).
  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). 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). 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). 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). 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). 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). 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). 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). 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).
  12. 12.
    Castagna, G., De Nicola, R., Varacca, D.: Semantic subtyping for the pi-calculus. Theor. Comput. Sci. 398(1–3), 217–242 (2008). Scholar
  13. 13.
    Charalambides, M.: Actor Programming with Static Guarantees. Ph.D. thesis, Urbana, Illinois (2018).
  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). 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). 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). 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). 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). Scholar
  20. 20.
    Deniélou, P., Yoshida, N.: Dynamic multirole session types. In: Symposium on Principles of Programming Languages, pp. 435–446 (2011).
  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). Scholar
  22. 22.
    Francez, N.: Fairness. Texts and Monographs in Computer Science. Springer, Heidelberg (1986). Scholar
  23. 23.
    Gay, S.J., Hole, M.: Subtyping for session types in the pi calculus. Acta Inf. 42(2–3), 191–225 (2005). Scholar
  24. 24.
    Honda, K.: Types for dyadic interaction. In: International Conference on Concurrency Theory, pp. 509–523 (1993). 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). Scholar
  26. 26.
    Honda, K., Yoshida, N., Carbone, M.: Multiparty asynchronous session types. In: Symposium on Principles of Programming Languages, pp. 273–284 (2008).
  27. 27.
    Honda, K., Yoshida, N., Carbone, M.: Multiparty asynchronous session types. J. ACM 63(1), 9:1–9:67 (2016). Scholar
  28. 28.
    Akka, Lightbend Inc.
  29. 29.
    Scala, École Polytechnique Fédérale (EPFL) Lausanne, Switzerland: The scala programming language.
  30. 30.
    Kobayashi, N.: A partially deadlock-free typed process calculus. ACM Trans. Program. Lang. Syst. 20(2), 436–482 (1998). Scholar
  31. 31.
    Kobayashi, N.: A type system for lock-free processes. Inf. Comput. 177(2), 122–159 (2002). 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). Scholar
  33. 33.
    Lamport, L.: Proving the correctness of multiprocess programs. IEEE Trans. Softw. Eng. 3(2), 125–143 (1977). Scholar
  34. 34.
    Milner, R., Parrow, J., Walker, D.: A calculus of mobile processes. I. Inf. Comput. 100(1), 1–40 (1992). 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). 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). 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). 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). Scholar
  42. 42.
    Sumii, E., Kobayashi, N.: A generalized deadlock-free process calculus. Electron. Notes Theor. Comput. Sci. 16(3), 225–247 (1998). 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). Scholar
  44. 44.
    W3C: Extensible Markup Language.
  45. 45.
    W3C: The Web Services Choreography Description Language, November 2005.
  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). 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). Scholar

Copyright information

© Springer Nature Switzerland AG 2019

Authors and Affiliations

  1. 1.University of Illinois at Urbana-ChampaignUrbanaUSA

Personalised recommendations