Advertisement

Formal Aspects of Computing

, Volume 30, Issue 1, pp 163–192 | Cite as

A semantics comparison workbench for a concurrent, asynchronous, distributed programming language

  • Claudio Corrodi
  • Alexander Heußner
  • Christopher M. Poskitt
Original Article

Abstract

A number of high-level languages and libraries have been proposed that offer novel and simple to use abstractions for concurrent, asynchronous, and distributed programming. The execution models that realise them, however, often change over time—whether to improve performance, or to extend them to new language features—potentially affecting behavioural and safety properties of existing programs. This is exemplified by Scoop, a message-passing approach to concurrent object-oriented programming that has seen multiple changes proposed and implemented, with demonstrable consequences for an idiomatic usage of its core abstraction. We propose a semantics comparison workbench for Scoop with fully and semi-automatic tools for analysing and comparing the state spaces of programs with respect to different execution models or semantics. We demonstrate its use in checking the consistency of properties across semantics by applying it to a set of representative programs, and highlighting a deadlock-related discrepancy between the principal execution models of Scoop. Furthermore, we demonstrate the extensibility of the workbench by generalising the formalisation of an execution model to support recently proposed extensions for distributed programming. Our workbench is based on a modular and parameterisable graph transformation semantics implemented in the Groove tool. We discuss how graph transformations are leveraged to atomically model intricate language abstractions, how the visual yet algebraic nature of the model can be used to ascertain soundness, and highlight how the approach could be applied to similar languages.

Keywords

Concurrent asynchronous programming Distributed programming with message passing Operational semantics Runtime semantics Graph transformation systems Verification/analysis parameterised by semantics Concurrency abstractions Object-oriented programming Software engineering Scoop Groove 

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Agh86.
    Agha G (1986) ACTORS: a model of concurrent computation in distributed systems. MIT Press, CambridgeGoogle Scholar
  2. AVW96.
    Armstrong J, Virding R, Williams M (1996) Concurrent Programming in ERLANG, 2nd edn. Prentice Hall, Upper Saddle RiverGoogle Scholar
  3. BCC+05.
    Burdy L, Cheon Y, Cok DR, Ernst MD, Kiniry JR, Leavens GT, Leino KRM, Poll E (2005) An overview of JML tools and applications.. Int J Softw Tools Technol Transf 7(3): 212–232CrossRefGoogle Scholar
  4. BPJ07.
    Brooke PJ, Paige RF, Jacob JL (2007) A CSP model of Eiffel’s SCOOP. Formal Aspects Comput 19(4): 487–512CrossRefMATHGoogle Scholar
  5. BR15a.
    Backes P, Reineke J (2015) Analysis of infinite-state graph transformation systems by cluster abstraction. In: Proceedings of VMCAI 2015, LNCS, vol 8931. Springer, pp. 135–152Google Scholar
  6. BR15b.
    Bogdanas D, Rosu G (2015) K-Java: A complete semantics of Java. In: Proceeding of POPL 2015. ACM, pp 445–456Google Scholar
  7. CDFR04.
    Corradini A., Dotti F.L., Foss L, Ribeiro L (2004) Translating Java code to graph transformation systems. In: Proceedings of ICGT 2004. LNCS, vol 3256. Springer, pp. 383–398Google Scholar
  8. CHP16.
    Corrodi C, Heußner A, Poskitt CM (2016) A graph-based semantics workbench for concurrent asynchronous programs. In: Proceedings of FASE 2016. LNCS, vol 9633. Springer, pp 31–48Google Scholar
  9. CM17.
    Caltais G, Meyer B (2017) On the verification of SCOOP programs. Sci Comput Program 133: 194–215CrossRefGoogle Scholar
  10. Cod17.
  11. CS10.
    Christakis M, Sagonas K (2010) Static detection of race conditions in Erlang. In: Proceedings of PADL 2010. Springer, pp 119–133Google Scholar
  12. DDF+05.
    Dotti FL, Duarte LM, Foss L, Ribeiro L, Russi D, dos Santos OM (2005) An environment for the development of concurrent object-based applications. In: Proceedings of GraBaTs 2004. ENTCS, vol 127. Elsevier, pp 3–13Google Scholar
  13. DGM14.
    Desai A, Garg P, Madhusudan P (2014) Natural proofs for asynchronous programs using almost-synchronous reductions. In: Proceedings of OOPLA 2014. ACM, pp 709–725Google Scholar
  14. Dow17.
    Downey Allen B (October 2017) The Little Book of Semaphores. http://greenteapress.com/semaphores/. Accessed: Oct 2017
  15. DSZ12.
    Delzanno G, Sangnier A, Zavattaro G (2012) Verification of ad hoc networks with node and communication failures. In: Proceedings of FMOODS/FORTE 2012. LNCS, vol 7273. Springer, pp 235–250Google Scholar
  16. EEPT06.
    Ehrig H, Ehrig K, Prange U, Taentzer G (2006) Fundamentals of Algebraic Graph Transformation Monographs in Theoretical Computer Science. An EATCS Series. Springer, BerlinMATHGoogle Scholar
  17. EifDoc.
    Eiffel Documentation: Concurrent Eiffel with SCOOP. https://www.eiffel.org/doc/solutions/Concurrent%20programming%20with%20SCOOP. Accessed.: Oct 2017.
  18. FFR07.
    Ferreira APL, Foss L, Ribeiro L (2007) Formal verification of object-oriented graph grammars specifications. In: Proceedings of GT-VC 2006. ENTCS, vol 175. Elsevier, pp 101–114Google Scholar
  19. FR05.
    Ferreira APL, Ribeiro L (2005) A graph-based semantics for object-oriented programming constructs. In: Proceedings of CTCS 2004. ENTCS, vol 122. Elsevier, pp 89–104Google Scholar
  20. GCD.
    Grand Central Dispatch (GCD) Reference. https://developer.apple.com/reference/dispatch. Accessed: Oct 2017.
  21. GdMR+12.
    Ghamarian AH, de Mol M, Rensink A, Zambon E, Zimakova M (2012) Modelling and analysis using GROOVE. Int J Softw Tools Technol Transf 14(1): 15–40CrossRefGoogle Scholar
  22. GHR15.
    Geeraerts G, Heußner A, Raskin JF (2015) On the verification of concurrent, asynchronous programs with waiting queues. ACM Trans Embed Comput Syst 14(3): 58CrossRefGoogle Scholar
  23. HKV97.
    Higham L, Kawash J, Verwaal N (1997) Defining and comparing memory consistency models. In: Proceedings of PDCS 1997. pp 349–356Google Scholar
  24. HP09.
    Habel A, Pennemann KH (2009) Correctness of high-level transformation systems relative to nested conditions. Math Struct Comput Sci 19(2): 245–296MathSciNetCrossRefMATHGoogle Scholar
  25. HPCM15.
    Heußner A, Poskitt CM, Corrodi C, Morandi B (2015) Towards practical graph-based verification for an object-oriented concurrency model. In: Proceeding of GaM 2015. EPTCS, vol 181. pp 32–47Google Scholar
  26. JOA05.
    Johnsen EB, Owe O, Axelsen EW (2005) A run-time environment for concurrent objects with asynchronous method calls. In: Proceedings of WRLA 2004. ENTCS, vol 117. Elsevier, pp 375–392Google Scholar
  27. JOY06.
    Johnsen EB, Owe O, Yu IC (2006) Creol: A type-safe object-oriented model for distributed concurrent systems. Theor Comput Sci, 365(1-2): 23–66MathSciNetCrossRefMATHGoogle Scholar
  28. KQCM09.
    Kitchin D, Quark A, Cook WR, Misra J (2009) The Orc programming language. In: Proceedings of FMOODS/FORTE 2009. LNCS, vol 5522. Springer, pp 1–25Google Scholar
  29. LSR12.
    Lucanu D, Serbanuta T-F, Rosu G (2012) \({\mathbb{K}}\) framework distilled. In: Proceedings of WRLA 2012. LNCS, vol 7571. Springer, pp 31–53Google Scholar
  30. MAM10.
    Mador-Haim S, Alur R, Martin MMK (2010) Generating litmus tests for contrasting memory consistency models. In: Proceedings of CAV 2010. LNCS, vol 6174. Springer, pp 273–287Google Scholar
  31. Mes92.
    Meseguer J (1992) Conditioned rewriting logic as a united model of concurrency. Theor Comput Sci 96(1): 73–155CrossRefMATHGoogle Scholar
  32. Mes12.
    Meseguer J (2012) Twenty years of rewriting logic. J Log Algeb Program 81(7-8): 721–781MathSciNetCrossRefMATHGoogle Scholar
  33. Mey93.
    Meyer B (1993) Systematic concurrent object-oriented programming. Commun ACM (CACM) 36(9): 56–80CrossRefGoogle Scholar
  34. Mey97.
    Meyer Bertrand (1997) Object-Oriented Software Construction. Prentice Hall, 2nd editionGoogle Scholar
  35. MHMS+12.
    Mador-Haim S, Maranget L, Sarkar S, Memarian K, Alglave J, Owens S, Alur R, Martin MMK, Sewell P, Williams D (2012) An axiomatic memory model for power multiprocessors. In: Proceedings of CAV 2012. LNCS, vol 7385. Springer, pp 495–512Google Scholar
  36. MNM12.
    Morandi B, Nanz S, Meyer B (2012) Who is accountable for asynchronous exceptions? In: Proceedings of APSEC 2012. IEEE, pp 462–471Google Scholar
  37. MNM14.
    Morandi B, Nanz S, Meyer B (2014) Safe and efficient data sharing for message-passing concurrency. In: Proceedings of COORDINATION 2014. LNCS, vol 8459. Springer, pp 99–114Google Scholar
  38. MSNM13.
    Morandi B, Schill M, Nanz S, Meyer B (2013) Prototyping a concurrency model. In: Proceedings of ACSD 2013. IEEE, pp 170–179Google Scholar
  39. Nie07.
    Nienaltowski P (2007) Practical framework for contract-based concurrent object-oriented programming. Doctoral dissertation, ETH ZürichGoogle Scholar
  40. NMS16.
    Nienhuis K, Memarian K, Sewell P (2016) An operational semantics for C/C++11 concurrency. In: Proceedings of OOPSLA 2016. ACM, pp 111–128Google Scholar
  41. OTHS09.
    Ostroff JS, Torshizi FA, Huang HF, Schoeller B (2009) Beyond contracts for concurrency. Formal Aspects Comput 21(4): 319–346CrossRefMATHGoogle Scholar
  42. PcR15.
    Park D, Ştefănescu A, Roşu G (2015) KJS: A complete formal semantics of JavaScript. In Proceedings of PLDI 2015. ACM, pp 346–356Google Scholar
  43. Plu12.
    Plump D (2012) The design of GP 2. In: Proceedings of WRS 2011, Electronic Proceedings in Theoretical Computer Science, vol 82. pp 1–16Google Scholar
  44. PP12.
    Poskitt CM, Plump D (2012) Hoare-style verification of graph programs. Fundamenta Informaticae 118(1-2): 135–175MathSciNetMATHGoogle Scholar
  45. PP14.
    Poskitt CM, Plump D (2014) Verifying monadic second-order properties of graph programs. In: Proceedings of ICGT 2014. LNCS, vol 8571. Springer, pp 33–48Google Scholar
  46. Ren10.
    Rensink A (2010) The edge of graph transformation—graphs for behavioural specification. In: Graph transformations and model-driven engineering, LNCS, vol 5765. Springer, Berlin, pp 6–32Google Scholar
  47. Repo.
  48. Roz97.
    Rozenberg G (eds) (1997) Handbook of graph grammars and computing by graph transformation: volume I. Foundations. World Scientific, SingaporeGoogle Scholar
  49. RS10.
    Rosu G, Serbanuta T-F (2010) An overview of the K semantic framework. J Log Algebraic Program 79(6): 397–434MathSciNetCrossRefMATHGoogle Scholar
  50. RZ09.
    Rensink A, Zambon E (2009) A type graph model for Java programs. In: Proceedings of FMOODS 2009. LNCS, vol 5522. Springer, pp 237–242Google Scholar
  51. Sch16.
    Schill M (2016) Unified interference-free parallel, concurrent and distributed programming, Dissertation, ETH Zürich, No. 24002.Google Scholar
  52. SFBE10.
    Svensson H, Fredlund L-Å, Benac Earle C (2010) A unified semantics for future Erlang. In: Proceedings of the 9th ACM SIGPLAN Workshop on Erlang, Erlang ’10. ACM, pp 23–32Google Scholar
  53. SM16.
    Summers AJ, Müller P (2016) Actor services. In: Proceedings of ESOP 2016. LNCS, vol 9632. Springer, pp 699–726Google Scholar
  54. SPM16.
    Schill M, Poskitt CM, Meyer B (2016) An interference-free programming model for network objects. In: Proceedings of COORDINATION 2016. LNCS, vol 9686. Springer, pp 227–244Google Scholar
  55. SR12.
    Serbanuta Traian-Florin, Rosu Grigore (2012) A truly concurrent semantics for the K framework based on graph transformations. In Proc. ICGT 2012, volume 7562 of LNCS, pages 294–310. SpringerGoogle Scholar
  56. TFNM11.
    Tschannen J, Furia CA, Nordio M, Meyer B (2011) Usable verification of object-oriented programs by combining static and dynamic techniques. In: Proceedings of SEFM 2011. LNCS, vol 7041. Springer, pp 382–398Google Scholar
  57. TOPC09.
    Torshizi F A, Ostroff J S, Paige R F, Chechik M (2009) The SCOOP concurrency model in Java-like languages. In: Proceedings of CPA 2009. Concurrent systems engineering series, vol 67. IOS Press, pp 7–27Google Scholar
  58. WBSC17.
    Wickerson J, Batty M, Sorensen T, Constantinides GA (2017) Automatically comparing memory consistency models. In: Proceedings of POPL 2017. ACM, pp 190–204Google Scholar
  59. WNM10.
    West S, Nanz S, Meyer B (2010) A modular scheme for deadlock prevention in an object-oriented programming model. In: Proceedings of ICFEM 2010. LNCS, vol 6447. Springer, pp 597–612Google Scholar
  60. WNM15.
    West S, Nanz S, Meyer B (2015) Efficient and reasonable object-oriented concurrency. In: Proceedings of ESEC/FSE 2015. ACM, pp 734–744Google Scholar
  61. WWW.
  62. ZR11.
    Zambon E, Rensink A (2011) Using graph transformations and graph abstractions for software verification. In: Proceedings of ICGT-DS 2010. ECEASST, vol 38Google Scholar
  63. ZR14.
    Zambon E, Rensink A (2014) Solving the N-Queens problem with GROOVE—towards a compendium of best practices. In: Proceedings of GT-VMT 2014. ECEASST, vol 67Google Scholar

Copyright information

© British Computer Society 2017

Authors and Affiliations

  1. 1.Software Composition GroupUniversity of BernBernSwitzerland
  2. 2.Software Technologies Research GroupUniversity of BambergBambergGermany
  3. 3.Singapore University of Technology and DesignSingaporeSingapore

Personalised recommendations