Automatic Verification of Erlang-Style Concurrency

  • Emanuele D’Osualdo
  • Jonathan Kochems
  • C. -H. Luke Ong
Part of the Lecture Notes in Computer Science book series (LNCS, volume 7935)

Abstract

This paper presents an approach to verify safety properties of Erlang-style, higher-order concurrent programs automatically. Inspired by Core Erlang, we introduce λActor, a prototypical functional language with pattern-matching algebraic data types, augmented with process creation and asynchronous message-passing primitives. We formalise an abstract model of λActor programs called Actor Communicating System (ACS) which has a natural interpretation as a vector addition system, for which some verification problems are decidable. We give a parametric abstract interpretation framework for λActor and use it to build a polytime computable, flow-based, abstract semantics of λActor programs, which we then use to bootstrap the ACS construction, thus deriving a more accurate abstract model of the input program.

We evaluate the method which we implemented in the prototype Soter. We find that in practice our abstraction technique is accurate enough to verify an interesting range of safety properties. Though the ACS coverability problem is Expspace-complete, Soter can analyse non-trivial programs in a matter of seconds.

Keywords

Erlang Infinite-state Systems Verification Petri Nets 

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    Agha, G.: Actors: a model of concurrent computation in distributed systems. MIT Press, Cambridge (1986)Google Scholar
  2. 2.
    Armstrong, J.: Erlang. CACM 53(9), 68 (2010)CrossRefGoogle Scholar
  3. 3.
    Armstrong, J., Virding, R., Williams, M.: Concurrent programming in Erlang. Prentice Hall (1993)Google Scholar
  4. 4.
    Bouajjani, A., Esparza, J., Touili, T.: A generic approach to the static analysis of concurrent programs with procedures. ACM SIGPLAN Notices 38, 62–73 (2003)CrossRefGoogle Scholar
  5. 5.
    Carlsson, R.: An introduction to Core Erlang. In: Proceedings of the PLI 2001 Erlang Workshop (2001)Google Scholar
  6. 6.
    Carlsson, R., Sagonas, K., Wilhelmsson, J.: Message analysis for concurrent programs using message passing. ACM TOPLAS (2006)Google Scholar
  7. 7.
    Christakis, M., Sagonas, K.: Static detection of race conditions in erlang. In: Carro, M., Peña, R. (eds.) PADL 2010. LNCS, vol. 5937, pp. 119–133. Springer, Heidelberg (2010)CrossRefGoogle Scholar
  8. 8.
    Christakis, M., Sagonas, K.: Detection of asynchronous message passing errors using static analysis. In: Rocha, R., Launchbury, J. (eds.) PADL 2011. LNCS, vol. 6539, pp. 5–18. Springer, Heidelberg (2011)CrossRefGoogle Scholar
  9. 9.
    Colby, C.: Analyzing the communication topology of concurrent programs. In: PEPM, pp. 202–213 (1995)Google Scholar
  10. 10.
    D’Osualdo, E., Kochems, J., Ong, C.-H.L.: Verifying Erlang-style concurrency automatically. Technical report, University of Oxford DCS Technical Report (2011), http://mjolnir.cs.ox.ac.uk/soter/cpmrs.pdf
  11. 11.
    D’Osualdo, E., Kochems, J., Ong, C.-H.L.: Soter: an automatic safety verifier for Erlang. In: AGERE! 2012, pp. 137–140. ACM (2012)Google Scholar
  12. 12.
    D’Osualdo, E., Kochems, J., Ong, C.-H.L.: Automatic verification of Erlang-style concurrency. CoRR, abs/1303.2201 (2013), http://arxiv.org/abs/1303.2201
  13. 13.
    Feret, J.: Abstract interpretation of mobile systems. Journal of Logic and Algebraic Programming 63(1), 59–130 (2005)MathSciNetMATHCrossRefGoogle Scholar
  14. 14.
    Finkel, A., Schnoebelen, P.: Well-structured transition systems everywhere! Theoretical Computer Science 256(1-2), 63–92 (2001)MathSciNetMATHCrossRefGoogle Scholar
  15. 15.
    Fredlund, L., Svensson, H.: McErlang: a model checker for a distributed functional programming language. In: ICFP, pp. 125–136 (2007)Google Scholar
  16. 16.
    Ganty, P., Majumdar, R.: Algorithmic verification of asynchronous programs. TOPLAS 34(1) (2012)Google Scholar
  17. 17.
    Garoche, P.-L., Pantel, M., Thirioux, X.: Static safety for an actor dedicated process calculus by abstract interpretation. In: Gorrieri, R., Wehrheim, H. (eds.) FMOODS 2006. LNCS, vol. 4037, pp. 78–92. Springer, Heidelberg (2006)CrossRefGoogle Scholar
  18. 18.
    Huch, F.: Verification of Erlang programs using abstract interpretation and model checking. In: ICFP, pp. 261–272 (1999)Google Scholar
  19. 19.
    Jhala, R., Majumdar, R.: Interprocedural analysis of asynchronous programs. In: POPL 2007, pp. 339–350. ACM, New York (2007)Google Scholar
  20. 20.
    Kaiser, A., Kroening, D., Wahl, T.: Efficient coverability analysis by proof minimization. In: Koutny, M., Ulidowski, I. (eds.) CONCUR 2012. LNCS, vol. 7454, pp. 500–515. Springer, Heidelberg (2012), www.cprover.org/bfc/ CrossRefGoogle Scholar
  21. 21.
    Kobayashi, N., Nakade, M., Yonezawa, A.: Static analysis of communication for asynchronous concurrent programming languages. In: Mycroft, A. (ed.) SAS 1995. LNCS, vol. 983, pp. 225–242. Springer, Heidelberg (1995)CrossRefGoogle Scholar
  22. 22.
    Lindahl, T., Sagonas, K.: Practical type inference based on success typings. In: PPDP, pp. 167–178 (2006)Google Scholar
  23. 23.
    Long, Z., Calin, G., Majumdar, R., Meyer, R.: Language-Theoretic abstraction refinement. In: de Lara, J., Zisman, A. (eds.) FASE. LNCS, vol. 7212, pp. 362–376. Springer, Heidelberg (2012)Google Scholar
  24. 24.
    Marlow, S., Wadler, P.: A practical subtyping system for Erlang. In: ICFP, pp. 136–149 (1997)Google Scholar
  25. 25.
    Meyer, R.: On boundedness in depth in the π-calculus. In: Fifth Ifip International Conference On Theoretical Computer Science, pp. 477–489 (2008)Google Scholar
  26. 26.
    Midtgaard, J., Jensen, T.: A calculational approach to control-flow analysis by abstract interpretation. In: Alpuente, M., Vidal, G. (eds.) SAS 2008. LNCS, vol. 5079, pp. 347–362. Springer, Heidelberg (2008)CrossRefGoogle Scholar
  27. 27.
    Might, M., Van Horn, D.: A family of abstract interpretations for static analysis of concurrent higher-order programs. In: Yahav, E. (ed.) SAS. LNCS, vol. 6887, pp. 180–197. Springer, Heidelberg (2011)Google Scholar
  28. 28.
    Milner, R.: A calculus of communicating systems, vol. 92. Springer, Heidelberg (1980)MATHCrossRefGoogle Scholar
  29. 29.
    Nyström, S.: A soft-typing system for Erlang. In: ACM Sigplan Erlang Workshop, pp. 56–71 (2003)Google Scholar
  30. 30.
    Ong, C.-H.L., Ramsay, S.J.: Verifying higher-order functional programs with pattern-matching algebraic data types. In: POPL, pp. 587–598 (2011)Google Scholar
  31. 31.
    Park, Y.G., Goldberg, B.: Escape analysis on lists. ACM SIGPLAN Notices 27, 116–127 (1992)CrossRefGoogle Scholar
  32. 32.
    Pike, R.: Concurrency and message passing in Newsqueak. Google Talks Archive, http://youtu.be/hB05UFqOtFA
  33. 33.
    Rackoff, C.: The covering and boundedness problems for vector addition systems. Theoretical Computer Science 6, 223–231 (1978)MathSciNetMATHCrossRefGoogle Scholar
  34. 34.
    Reppy, J.H., Xiao, Y.: Specialization of CML message-passing primitives. In: POPL, pp. 315–326 (2007)Google Scholar
  35. 35.
    Shivers, O.: Control-Flow Analysis of Higher-Order Languages. PhD thesis, Carnegie Mellon University (1991)Google Scholar
  36. 36.
    Van Horn, D., Might, M.: Abstracting abstract machines. In: ICFP, pp. 51–62 (2010)Google Scholar
  37. 37.
    Venet, A.: Abstract interpretation of the pi-calculus. In: LOMAPS, pp. 51–75 (1996)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2013

Authors and Affiliations

  • Emanuele D’Osualdo
    • 1
  • Jonathan Kochems
    • 1
  • C. -H. Luke Ong
    • 1
  1. 1.University of OxfordUK

Personalised recommendations