Advertisement

Towards Static Deadlock Resolution in the \(\pi \)-Calculus

  • Marco GiuntiEmail author
  • António RavaraEmail author
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 8358)

Abstract

Static analysis techniques based on session types discern concurrent programs that ensure the fidelity of protocol sessions – for each input (output) end point of a session there is exactly an output (input) end point available – being expressive enough to represent the standard \(\pi \)-calculus and several typing disciplines. More advanced type systems, enforcing properties as deadlock-freedom or even progress, sensibly reduce the set of typed processes, thus mining the expressiveness of the analysis. Herein, we propose a first step towards a compromise solution to this problem: a session based type checking algorithm that releases some deadlocks (when co-actions on the same channel occur in sequence in a thread). This procedure may help the software development process: the typing algorithm detects a deadlock, but instead of rejecting the code, fixes it by looking into the session types and producing new safe code that obeys the protocols and is deadlock-free.

Keywords

Type System Parallel Composition Program Transformation Typing Context Type Check 
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.

Notes

Acknowledgments

This work is partially supported by the Portuguese Fundação para a Ciência e a Tecnologia via project “CITI/FCT/UNL 2011-2012” — grant PEst-OE/EEI/UI0527/2011 and project “Liveness, statically” — grant PTDC/EIA-CCO/117513/2010, and by the COST Action IC1201: Behavioural Types for Reliable Large-Scale Software Systems (BETTY). We would like to thank Adrian Francalanza for fruitful discussions and illuminating examples, and the anonymous reviewers for their careful reading and constructive criticisms.

References

  1. 1.
    Milner, R., Parrow, J., Walker, D.: A calculus of mobile processes, parts I and II. Inf. Comput. 100(1), 1–77 (1992)CrossRefzbMATHMathSciNetGoogle Scholar
  2. 2.
    Honda, K.: Types for dyadic interaction. In: Best, E. (ed.) CONCUR 1993. LNCS, vol. 715, pp. 509–523. Springer, Heidelberg (1993)Google Scholar
  3. 3.
    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)Google Scholar
  4. 4.
    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)Google Scholar
  5. 5.
    Dezani-Ciancaglini, M., de’Liguoro, U.: Sessions and session types: an overview. In: Laneve, C., Su, J. (eds.) WS-FM 2009. LNCS, vol. 6194, pp. 1–28. Springer, Heidelberg (2010)Google Scholar
  6. 6.
    Dezani-Ciancaglini, M., Drossopoulou, S., Mostrous, D., Yoshida, N.: Objects and session types. Inf. Comput. 207(5), 595–641 (2009)CrossRefzbMATHMathSciNetGoogle Scholar
  7. 7.
    Gay, S.J., Hole, M.J.: Subtyping for session types in the pi calculus. Acta Informatica 42(2/3), 191–225 (2005)CrossRefzbMATHMathSciNetGoogle Scholar
  8. 8.
    Yoshida, N., Vasconcelos, V.T.: Language primitives and type discipline for structured communication-based programming revisited: two systems for higher-order session communication. In: SecReT. ENTCS, vol. 171(4), pp. 73–93 (2007)Google Scholar
  9. 9.
    Giunti, M., Vasconcelos, V.T.: A linear account of session types in the pi calculus. In: Gastin, P., Laroussinie, F. (eds.) CONCUR 2010. LNCS, vol. 6269, pp. 432–446. Springer, Heidelberg (2010)CrossRefGoogle Scholar
  10. 10.
    Giunti, M., Vasconcelos, V.T.: Linearity, session types and the pi calculus. Math. Struct. Comput. Sci. (2013, in press)Google Scholar
  11. 11.
    Kobayashi, N., Pierce, B.C., Turner, D.N.: Linearity and the pi-calculus. ACM Trans. Program. Lang. Syst. 21(5), 914–947 (1999)CrossRefGoogle Scholar
  12. 12.
    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)CrossRefGoogle Scholar
  13. 13.
    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
  14. 14.
    Caires, L., Vieira, H.T.: Conversation types. Theoret. Comput. Sci. 411(51–52), 4399–4440 (2010)CrossRefzbMATHMathSciNetGoogle Scholar
  15. 15.
    Wadler, P.: Propositions as sessions. In: ICFP, pp. 273–286. ACM (2012)Google Scholar
  16. 16.
    Carbone, M., Montesi, F.: Deadlock-freedom-by-design: multiparty asynchronous global programming. In: POPL, pp. 263–274. ACM Press (2013)Google Scholar
  17. 17.
    Coffman, E.G., Elphick, M., Shoshani, A.: System deadlocks. ACM Comput. Surv. 3(2), 67–78 (1971)CrossRefzbMATHGoogle Scholar
  18. 18.
    Knapp, E.: Deadlock detection in distributed databases. ACM Comput. Surv. 19(4), 303–328 (1987)CrossRefGoogle Scholar
  19. 19.
    Giunti, M.: (LockRes: a session type checker resolving deadlocks) http://ctp.di.fct.unl.pt/~mgiunti/lockres. The web page contains the SML/NJ prototype of the algorithm presented in this paper and the technical report.
  20. 20.
    Milner, R.: Communicating and Mobile Systems: The Pi-Calculus. Cambridge University Press, New York (1999)zbMATHGoogle Scholar
  21. 21.
    Barendregt, H.: The Lambda Calculus - Its Syntax and Semantics, 1st edn. North-Holland, Amsterdam (1981, revised 1984)Google Scholar
  22. 22.
    Walker, D.: Substructural type systems. In: Pierce, B.C. (ed.) Advanced Topics in Types and Programming Languages, pp. 3–44. MIT Press, Cambridge (2005)Google Scholar
  23. 23.
    Giunti, M.: Algorithmic type checking for a pi-calculus with name matching and session types. J. Logic Algebraic Program. 82(8), 263–281 (2013)CrossRefzbMATHMathSciNetGoogle Scholar
  24. 24.
    Nestmann, U., Pierce, B.C.: Decoding choice encodings. Inf. Comput. 163(1), 1–59 (2000)CrossRefzbMATHMathSciNetGoogle Scholar

Copyright information

© Springer International Publishing Switzerland 2014

Authors and Affiliations

  1. 1.CITI and DI-FCTUniversidade Nova de LisboaLisbonPortugal

Personalised recommendations