Effect-Polymorphic Behaviour Inference for Deadlock Checking

  • Ka I Pun
  • Martin Steffen
  • Volker Stolz
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 8702)


We present a constraint-based effect inference algorithm for deadlock checking. The static analysis is developed for a concurrent calculus with higherorder functions and dynamic lock creation. The analysis is context-sensitive and locks are summarised based on their creation-site. The resulting effects can be checked for deadlocks using state space exploration. We use a specific deadlocksensitive simulation relation to show that the effects soundly over-approximate the behaviour of a program, in particular that deadlocks in the program are preserved in the effects.


Type Inference Effect Inference Simulation Relation Deadlock Detection Fresh Variable 
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.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Agarwal, R., Wang, L., Stoller, S.D.: Detecting potential deadlocks with static analysis and run-time monitoring. In: Ur, S., Bin, E., Wolfsthal, Y. (eds.) Haifa Verification Conf. 2005. LNCS, vol. 3875, pp. 191–207. Springer, Heidelberg (2006)Google Scholar
  2. 2.
    Amtoft, T., Nielson, H.R., Nielson, F.: Type and Effect Systems: Behaviours for Concurrency. Imperial College Press (1999)Google Scholar
  3. 3.
    Boyapati, C., Lee, R., Rinard, M.: Ownership types for safe programming: Preventing data races and deadlocks. In: OOPSLA 2002, Seattle, USA. ACM (2002); SIGPLAN NoticesGoogle Scholar
  4. 4.
    Coffman Jr., E.G., Elphick, M., Shoshani, A.: System deadlocks. Computing Surveys 3(2) (1971)Google Scholar
  5. 5.
    Damas, L.: Type Assignment in Programming Languages. PhD thesis, Laboratory for Foundations of Computer Science, University of Edinburgh, CST-33-85 (1985)Google Scholar
  6. 6.
    Damas, L., Milner, R.: Principal type-schemes for functional programming languages. In: Ninth POPL, Albuquerque, NM. ACM (1982)Google Scholar
  7. 7.
    Dijkstra, E.W.: Cooperating sequential processes. Technical Report EWD-123, TU Eindhoven (1965)Google Scholar
  8. 8.
    Hindley, J.R.: The principal type-scheme of an object in combinatory logic. Transactions of the AMS 146 (1969)Google Scholar
  9. 9.
    Kidd, N., Reps, T.W., Dolby, J., Vaziri, M.: Finding concurrency-related bugs using random isolation. STTT 13(6) (2011)Google Scholar
  10. 10.
    Kobayashi, N.: A new type system for deadlock-free processes. In: Baier, C., Hermanns, H. (eds.) CONCUR 2006. LNCS, vol. 4137, pp. 233–247. Springer, Heidelberg (2006)CrossRefGoogle Scholar
  11. 11.
    Mossin, C.: Flow Analysis of Typed Higher-Order Programs. PhD thesis, DIKU, University of Copenhagen, Denmark. Technical Report DIKU-TR-97/1 (1997)Google Scholar
  12. 12.
    Naik, M., Park, C.-S., Sen, K., Gay, D.: Effective static deadlock detection. In: 31st International Conference on Software Engineering (ICSE 2009). IEEE (2009)Google Scholar
  13. 13.
    Pun, K.I., Steffen, M., Stolz, V.: Deadlock checking by a behavioral effect system for lock handling. J. of Logic and Algebraic Programming 81(3) (2012)Google Scholar
  14. 14.
    Pun, K.I., Steffen, M., Stolz, V.: Lock-polymorphic behaviour inference for deadlock checking. Tech. report 436, UiO, IFI (2013) (submitted for Journal Publication)Google Scholar
  15. 15.
    Suenaga, K.: Type-based deadlock-freedom verification for non-block-structured lock primitives and mutable references. In: Ramalingam, G. (ed.) APLAS 2008. LNCS, vol. 5356, pp. 155–170. Springer, Heidelberg (2008)CrossRefGoogle Scholar
  16. 16.
    Talpin, J.-P., Jouvelot, P.: Polymorphic Type, Region and Effect Inference. J. of Functional Programming 2(3) (1992)Google Scholar
  17. 17.
    Vasconcelos, V., Martins, F., Cogumbreiro, T.: Type inference for deadlock detection in a multithreaded polymorphic typed assembly language. In: PLACES 2009. EPTCS, vol. 17 (2009)Google Scholar

Copyright information

© Springer International Publishing Switzerland 2014

Authors and Affiliations

  • Ka I Pun
    • 1
  • Martin Steffen
    • 1
  • Volker Stolz
    • 1
  1. 1.Department of InformaticsUniversity of OsloNorway

Personalised recommendations