Skip to main content

A Guide to Rely/Guarantee Thinking

  • Conference paper
  • First Online:
Engineering Trustworthy Software Systems (SETSS 2017)

Abstract

Designing concurrent shared-variable programs is difficult. The Rely-Guarantee concept provides a compositional approach to the challenge. This paper reviews some recent developments in the approach, offers worked examples and relates the approach to other research.

This work was supported by Australian Research Council (ARC) Discovery Project DP130102901 and the UK EPSRC “Taming Concurrency” and “Strata” research grants.

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

Access this chapter

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

Institutional subscriptions

Notes

  1. 1.

    This operator was originally devised by us to allow guarantees to be expressed as a separate command, which is then combined with the rest of the specification using weak conjunction. Weak conjunction has since found wider use as a general composition operator.

  2. 2.

    For brevity, it is assumed here that \(Pr(x)\) is always defined—undefinedness is considered in [CJ07] but it has little bearing on the concurrency aspects of the application.

  3. 3.

    Generalising to an arbitrary number of threads presents no conceptual difficulties but also offers no further insight.

  4. 4.

    As observed in Sect. 1.3, achieving rely and/or guarantee conditions is often linked with data reification, for instance, viewing \(min\{ot, et\}\) as a representation of the abstract variable t.

  5. 5.

    Compare Law 17 (introduce-multi-parallel) and Law 16 (introduce-parallel) in Sect. 2.7.

  6. 6.

    Published as a book [Mid93].

  7. 7.

    SAGL [FFS07] has a similar scope.

  8. 8.

    The negative flavour of this adjective was probably intentional.

References

  1. Armstrong, A.: Formal analysis of concurrent programs. Ph.D. thesis, University of Sheffield (2016)

    Google Scholar 

  2. Bornat, R., Amjad, H.: Inter-process buffers in separation logic with rely-guarantee. Formal Aspects Comput. 22(6), 735–772 (2010)

    Article  Google Scholar 

  3. Bornat, R., Amjad, H.: Explanation of two non-blocking shared-variable communication algorithms. Formal Aspects Comput. 25(6), 893–931 (2013)

    Article  MathSciNet  Google Scholar 

  4. Buechi, M.: Safe language mechanisms for modularization and concurrency. Ph.D. thesis, Turku (2000)

    Google Scholar 

  5. Back, R.-J.R., von Wright, J.: Refinement Calculus: A Systematic Introduction. Springer, New York (1998). https://doi.org/10.1007/978-1-4612-1674-2

    Book  MATH  Google Scholar 

  6. Colvin, R.J., Hayes, I.J., Meinicke, L.A.: Designing a semantic model for a wide-spectrum language with concurrency. Formal Aspects Comput. 29, 853–875 (2016)

    Article  MathSciNet  Google Scholar 

  7. Collette, P., Jones, C.B.: Enhancing the tractability of rely/guarantee specifications in the development of interfering operations (Chap. 10). In: Plotkin, G., Stirling, C., Tofte, M. (eds.) Proof, Language and Interaction, pp. 277–307. MIT Press (2000)

    Google Scholar 

  8. Coleman, J.W., Jones, C.B.: A structural proof of the soundness of rely/guarantee rules. J. Logic Comput. 17(4), 807–841 (2007)

    Article  MathSciNet  Google Scholar 

  9. Chandy, K.M., Misra, J.: Parallel Program Design: A Foundation. Addison-Wesley, Boston (1988)

    MATH  Google Scholar 

  10. Collette, P.: Design of compositional proof systems based on assumption-commitment specifications - application to UNITY. Ph.D. thesis, Louvain-la-Neuve, June 1994

    Google Scholar 

  11. Coleman, J.W.: Constructing a tractable reasoning framework upon a fine-grained structural operational semantics. Ph.D. thesis, Newcastle University, January 2008

    Google Scholar 

  12. Dodds, M., Feng, X., Parkinson, M., Vafeiadis, V.: Deny-guarantee reasoning. In: Castagna, G. (ed.) ESOP 2009. LNCS, vol. 5502, pp. 363–377. Springer, Heidelberg (2009). https://doi.org/10.1007/978-3-642-00590-9_26

    Chapter  Google Scholar 

  13. Dias, D.M.: Mechanising an algebraic rely-guarantee refinement calculus. Ph.D. thesis, School of Computing, Newcastle University (2017)

    Google Scholar 

  14. Dingel, J.: Systematic parallel programming. Ph.D. thesis, Carnegie Mellon University (2000). CMU-CS-99-172

    Google Scholar 

  15. de Roever, W.-P.: Concurrency Verification: Introduction to Compositional and Noncompositional Methods. Cambridge University Press, Cambridge (2001)

    MATH  Google Scholar 

  16. Dinsdale-Young, T., Dodds, M., Gardner, P., Parkinson, M.J., Vafeiadis, V.: Concurrent abstract predicates. In: D’Hondt, T. (ed.) ECOOP 2010. LNCS, vol. 6183, pp. 504–528. Springer, Heidelberg (2010). https://doi.org/10.1007/978-3-642-14107-2_24

    Chapter  Google Scholar 

  17. Feng, X., Ferreira, R., Shao, Z.: On the relationship between concurrent separation logic and assume-guarantee reasoning. In: De Nicola, R. (ed.) ESOP 2007. LNCS, vol. 4421, pp. 173–188. Springer, Heidelberg (2007). https://doi.org/10.1007/978-3-540-71316-6_13

    Chapter  MATH  Google Scholar 

  18. Floyd, R.W.: Assigning meanings to programs. In: Proceedings of Symposia in Applied Mathematics: Mathematical Aspects of Computer Science, vol. 19, pp. 19–32 (1967)

    Google Scholar 

  19. Hayes, I.J.: Generalised rely-guarantee concurrency: an algebraic foundation. Formal Aspects Comput. 28(6), 1057–1078 (2016)

    Article  MathSciNet  Google Scholar 

  20. Hayes, I.J., Burns, A., Dongol, B., Jones, C.B.: Comparing degrees of non-determinism in expression evaluation. Comput. J. 56(6), 741–755 (2013)

    Article  Google Scholar 

  21. Hayes, I.J., Colvin, R.J., Meinicke, L.A., Winter, K., Velykis, A.: An algebra of synchronous atomic steps. In: Fitzgerald, J., Heitmeyer, C., Gnesi, S., Philippou, A. (eds.) FM 2016. LNCS, vol. 9995, pp. 352–369. Springer, Cham (2016). https://doi.org/10.1007/978-3-319-48989-6_22

    Chapter  Google Scholar 

  22. Henderson, N.: Formal modelling and analysis of an asynchronous communication mechanism. Ph.D. thesis, University of Newcastle upon Tyne (2004)

    Google Scholar 

  23. Hayes, I.J., Jones, C.B., Colvin, R.J.: Laws and semantics for rely-guarantee refinement. Technical report CS-TR-1425, Newcastle University, July 2014

    Google Scholar 

  24. Hayes, I.J., Meinicke, L.A., Winter, K., Colvin, R.J.: A synchronous program algebra: a basis for reasoning about shared-memory and event-based concurrency (2018). Formal Aspects of Computing. Online 6 August 2018

    Google Scholar 

  25. Hoare, C.A.R.: An axiomatic basis for computer programming. Commun. ACM, 12(10), 576–580, 583 (1969)

    Article  Google Scholar 

  26. Hoare, T., van Staden, S., Möller, B., Struth, G., Zhu, H.: Developments in concurrent Kleene algebra. J. Log. Algebraic Methods Program. 85(4), 617–636 (2016)

    Article  MathSciNet  Google Scholar 

  27. Jones, C.B., Hayes, I.J.: Possible values: exploring a concept for concurrency. J. Log. Algebraic Methods Program. 85(5, Part 2), 972–984 (2016). Articles dedicated to Prof. J. N. Oliveira on the occasion of his 60th birthday

    Article  MathSciNet  Google Scholar 

  28. Jones, C.B., Hayes, I.J., Colvin, R.J.: Balancing expressiveness in formal approaches to concurrency. Formal Aspects Comput. 27(3), 475–497 (2015)

    Article  MathSciNet  Google Scholar 

  29. Jones, C.B., Hayes, I.J., Jackson, M.A.: Deriving specifications for systems that are connected to the physical world. In: Jones, C.B., Liu, Z., Woodcock, J. (eds.) Formal Methods and Hybrid Real-Time Systems. LNCS, vol. 4700, pp. 364–390. Springer, Heidelberg (2007). https://doi.org/10.1007/978-3-540-75221-9_16

    Chapter  Google Scholar 

  30. Jones, C.B.: Development methods for computer programs including a notion of interference. Ph.D. thesis, Oxford University, June 1981. Available as: Oxford University Computing Laboratory (now Computer Science) Technical Monograph PRG-25

    Google Scholar 

  31. Jones, C.B.: Specification and design of (parallel) programs. In: Proceedings of IFIP 1983, pp. 321–332. North-Holland (1983)

    Google Scholar 

  32. Jones, C.B.: Tentative steps toward a development method for interfering programs. ACM ToPLaS 5(4), 596–619 (1983)

    Article  Google Scholar 

  33. Jones, C.B.: From problem frames to HJJ (and its known unknowns) (Chap. 16). In: Nuseibeh, B., Zave, P. (eds.) Software Requirements and Design: The Work of Michael Jackson, pp. 357–372. Good Friends Publishing Company (2010)

    Google Scholar 

  34. Jones, C.B., Pierce, K.G.: Elucidating concurrent algorithms via layers of abstraction and reification. Formal Aspects Comput. 23(3), 289–306 (2011)

    Article  MathSciNet  Google Scholar 

  35. Jones, C.B., Velykis, A., Yatapanage, N.: General lessons from a rely/guarantee development. In: Larsen, K.G., Sokolsky, O., Wang, J. (eds.) SETTA 2017. LNCS, vol. 10606, pp. 3–22. Springer, Cham (2017). https://doi.org/10.1007/978-3-319-69483-2_1

    Chapter  Google Scholar 

  36. Jones, C.B., Yatapanage, N.: Reasoning about separation using abstraction and reification. In: Calinescu, R., Rumpe, B. (eds.) SEFM 2015. LNCS, vol. 9276, pp. 3–19. Springer, Cham (2015). https://doi.org/10.1007/978-3-319-22969-0_1

    Chapter  MATH  Google Scholar 

  37. Kozen, D.: Kleene algebra with tests. ACM Trans. Prog. Lang. Syst. 19(3), 427–443 (1997)

    Article  Google Scholar 

  38. Liang, H.: Refinement verification of concurrent programs and its applications. Ph.D. thesis, USTC, China (2014)

    Google Scholar 

  39. Lahav, O., Vafeiadis, V.: Explaining relaxed memory models with program transformations. In: Fitzgerald, J., Heitmeyer, C., Gnesi, S., Philippou, A. (eds.) FM 2016. LNCS, vol. 9995, pp. 479–495. Springer, Cham (2016). https://doi.org/10.1007/978-3-319-48989-6_29

    Chapter  Google Scholar 

  40. Middelburg, C.A.: Syntax and semantics of VVSL: a language for structured VDM specifications. Ph.D. thesis, PTT Research, Leidschendam, Department of Applied Computer Science, September 1990

    Google Scholar 

  41. Middelburg, C.A.: Logic and Specification: Extending VDM-SL for Advanced Formal Specification. Chapman and Hall, Boca Raton (1993)

    Google Scholar 

  42. Morgan, C.: Programming from Specifications. Prentice-Hall, Upper Saddle River (1990)

    MATH  Google Scholar 

  43. Moszkowski, B.C.: Executing Temporal Logic Programs. Cambridge University Press, Cambridge (1986)

    MATH  Google Scholar 

  44. O’Hearn, P.W.: Resources, concurrency and local reasoning. Theor. Comput. Sci. 375(1–3), 271–307 (2007)

    Article  MathSciNet  Google Scholar 

  45. Owicki, S.: Axiomatic proof techniques for parallel programs. Ph.D. thesis, Department of Computer Science, Cornell University (1975)

    Google Scholar 

  46. Pierce, K.: Enhancing the useability of rely-guaranteee conditions for atomicity refinement. Ph.D. thesis, Newcastle University (2009)

    Google Scholar 

  47. Prensa Nieto, L.: Verification of parallel programs with the Owicki-Gries and rely-guarantee methods in Isabelle/HOL. Ph.D. thesis, Institut für Informatic der Technischen Universitaet München (2001)

    Google Scholar 

  48. Reynolds, J.C.: Separation logic: a logic for shared mutable data structures. In: IEEE Symposium on Logic in Computer Science (LICS), pp. 55–74. IEEE Computer Society (2002)

    Google Scholar 

  49. Schellhorn, G., Tofan, B., Ernst, G., Pfähler, J., Reif, W.: RGITL: a temporal logic framework for compositional reasoning about interleaved programs. Ann. Math. Artif. Intell. 71(1–3), 131–174 (2014)

    Article  MathSciNet  Google Scholar 

  50. Schellhorn, G., Tofan, B., Ernst, G., Reif, W.: Interleaved programs and rely-guarantee reasoning with ITL. In: TIME, pp. 99–106 (2011)

    Google Scholar 

  51. Stølen, K.: Development of parallel programs on shared data-structures. Ph.D. thesis, Manchester University (1990). Available as UMCS-91-1-1

    Google Scholar 

  52. Sanán, D., Zhao, Y., Hou, Z., Zhang, F., Tiu, A., Liu, Y.: CSimpl: a rely-guarantee-based framework for verifying concurrent programs. In: Legay, A., Margaria, T. (eds.) TACAS 2017. LNCS, vol. 10205, pp. 481–498. Springer, Heidelberg (2017). https://doi.org/10.1007/978-3-662-54577-5_28

    Chapter  Google Scholar 

  53. Vafeiadis, V.: Modular fine-grained concurrency verification. Ph.D. thesis, University of Cambridge (2007)

    Google Scholar 

  54. Wickerson, J.: Concurrent verification for sequential programs. Ph.D. thesis, Cambridge (2013)

    Google Scholar 

  55. Xu, Q.: A theory of state-based parallel programming. Ph.D. thesis, Oxford University (1992)

    Google Scholar 

Download references

Acknowledgements

This research was supported by Australian Research Council (ARC) Discovery Grant DP130102901 “Understanding concurrent programs using rely-guarantee thinking” and the UK EPSRC “Taming Concurrency” and “Strata” research grants. Thanks are due to Robert Colvin, Diego Machado Dias, Larissa Meinicke, Patrick Meiring, Andrius Velykis, Kirsten Winter and Nisansala Yatapanage for feedback on ideas presented in this paper. The authors are particularly grateful to the anonymous reviewers for detailed and constructive comments.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Ian J. Hayes .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2018 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Hayes, I.J., Jones, C.B. (2018). A Guide to Rely/Guarantee Thinking. In: Bowen, J., Liu, Z., Zhang, Z. (eds) Engineering Trustworthy Software Systems. SETSS 2017. Lecture Notes in Computer Science(), vol 11174. Springer, Cham. https://doi.org/10.1007/978-3-030-02928-9_1

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-02928-9_1

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-02927-2

  • Online ISBN: 978-3-030-02928-9

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics