Skip to main content

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

  • Conference paper
  • First Online:

Part of the book series: Lecture Notes in Computer Science ((LNTCS,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.

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Notes

  1. 1.

    The procedure is still at an experimental stage; we do not discuss it here.

  2. 2.

    While most of the examples do not require the use of restriction, we limit the scope of channels to help the comprehension of the reader.

  3. 3.

    The subject variables of a sound process is indeed a set.

  4. 4.

    When convenient, we will say “type disentangle” to mean resolution of a (typed) wait-for sequential deadlock.

References

  1. Milner, R., Parrow, J., Walker, D.: A calculus of mobile processes, parts I and II. Inf. Comput. 100(1), 1–77 (1992)

    Article  MATH  MathSciNet  Google Scholar 

  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. 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. 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. 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. Dezani-Ciancaglini, M., Drossopoulou, S., Mostrous, D., Yoshida, N.: Objects and session types. Inf. Comput. 207(5), 595–641 (2009)

    Article  MATH  MathSciNet  Google Scholar 

  7. Gay, S.J., Hole, M.J.: Subtyping for session types in the pi calculus. Acta Informatica 42(2/3), 191–225 (2005)

    Article  MATH  MathSciNet  Google Scholar 

  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. 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)

    Chapter  Google Scholar 

  10. Giunti, M., Vasconcelos, V.T.: Linearity, session types and the pi calculus. Math. Struct. Comput. Sci. (2013, in press)

    Google Scholar 

  11. Kobayashi, N., Pierce, B.C., Turner, D.N.: Linearity and the pi-calculus. ACM Trans. Program. Lang. Syst. 21(5), 914–947 (1999)

    Article  Google Scholar 

  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)

    Chapter  Google Scholar 

  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)

    Chapter  Google Scholar 

  14. Caires, L., Vieira, H.T.: Conversation types. Theoret. Comput. Sci. 411(51–52), 4399–4440 (2010)

    Article  MATH  MathSciNet  Google Scholar 

  15. Wadler, P.: Propositions as sessions. In: ICFP, pp. 273–286. ACM (2012)

    Google Scholar 

  16. Carbone, M., Montesi, F.: Deadlock-freedom-by-design: multiparty asynchronous global programming. In: POPL, pp. 263–274. ACM Press (2013)

    Google Scholar 

  17. Coffman, E.G., Elphick, M., Shoshani, A.: System deadlocks. ACM Comput. Surv. 3(2), 67–78 (1971)

    Article  MATH  Google Scholar 

  18. Knapp, E.: Deadlock detection in distributed databases. ACM Comput. Surv. 19(4), 303–328 (1987)

    Article  Google Scholar 

  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. Milner, R.: Communicating and Mobile Systems: The Pi-Calculus. Cambridge University Press, New York (1999)

    MATH  Google Scholar 

  21. Barendregt, H.: The Lambda Calculus - Its Syntax and Semantics, 1st edn. North-Holland, Amsterdam (1981, revised 1984)

    Google Scholar 

  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. Giunti, M.: Algorithmic type checking for a pi-calculus with name matching and session types. J. Logic Algebraic Program. 82(8), 263–281 (2013)

    Article  MATH  MathSciNet  Google Scholar 

  24. Nestmann, U., Pierce, B.C.: Decoding choice encodings. Inf. Comput. 163(1), 1–59 (2000)

    Article  MATH  MathSciNet  Google Scholar 

Download references

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.

Author information

Authors and Affiliations

Authors

Corresponding authors

Correspondence to Marco Giunti or António Ravara .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2014 Springer International Publishing Switzerland

About this paper

Cite this paper

Giunti, M., Ravara, A. (2014). Towards Static Deadlock Resolution in the \(\pi \)-Calculus. In: Abadi, M., Lluch Lafuente, A. (eds) Trustworthy Global Computing. TGC 2013. Lecture Notes in Computer Science(), vol 8358. Springer, Cham. https://doi.org/10.1007/978-3-319-05119-2_9

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-05119-2_9

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-05118-5

  • Online ISBN: 978-3-319-05119-2

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics