Skip to main content

Reasoning About Choreographic Programs

  • Conference paper
  • First Online:
Coordination Models and Languages (COORDINATION 2023)

Abstract

Choreographic programming is a paradigm where a concurrent or distributed system is developed in a top-down fashion. Programs, called choreographies, detail the desired interactions between processes, and can be compiled to distributed implementations based on message passing. Choreographic languages usually guarantee deadlock-freedom and provide an operational correspondence between choreographies and their compiled implementations, but until now little work has been done on verifying other properties.

This paper presents a Hoare-style logic for reasoning about the behaviour of choreographies, and illustrate its usage in representative examples. We show that this logic is sound and complete, and discuss decidability of its judgements. Using existing results from choreographic programming, we show that any functional correctness property proven for a choreography also holds for its compiled implementation.

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 59.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 79.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.

    For this reason, the set of labels is often fixed to be a two-element set, one for each branch of a choice.

  2. 2.

    This disallows choreographies where e.g. each procedure \(X_i\) calls procedure \(X_{i+1}\), which do not occur in practice.

References

  1. Apt, K.R., Francez, N., de Roever, W.P.: A proof system for communicating sequential processes. ACM Trans. Program. Lang. Syst. 2(3), 359–385 (1980). https://doi.org/10.1145/357103.357110

  2. Apt, K.R., Olderog, E.: Fifty years of Hoare’s logic. CoRR abs/1904.03917 (2019)

    Google Scholar 

  3. Apt, K.R., Olderog, E.-R., Boer, F.S.: Verification of sequential and concurrent programs, vol. 2. Springer (2009). https://doi.org/10.1007/978-1-84882-745-5

  4. Bocchi, L., Honda, K., Tuosto, E., Yoshida, N.: A theory of design-by-contract for distributed multiparty interactions. In: Gastin, P., Laroussinie, F. (eds.) CONCUR 2010. LNCS, vol. 6269, pp. 162–176. Springer, Heidelberg (2010). https://doi.org/10.1007/978-3-642-15375-4_12

    Chapter  MATH  Google Scholar 

  5. 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). https://doi.org/10.1007/978-3-642-15375-4_16

    Chapter  Google Scholar 

  6. Carbone, M., Montesi, F.: Deadlock-freedom-by-design: multiparty asynchronous global programming. In: Giacobazzi, R., Cousot, R. (eds.) Procs. POPL, pp. 263–274. ACM (2013). https://doi.org/10.1145/2429069.2429101

  7. Carbone, M., Montesi, F., Schürmann, C.: Choreographies, logically. Distributed Computing 31(1), 51–67 (2017). https://doi.org/10.1007/s00446-017-0295-1

  8. Cruz-Filipe, L., Graversen, E., Lugovic, L., Montesi, F., Peressotti, M.: Functional choreographic programming. In: Seidl, H., Liu, Z., Pasareanu, C.S. (eds.) Theoretical Aspects of Computing – ICTAC 2022. ICTAC 2022. Lecture Notes in Computer Science, vol. 13572, pp. 212–237. Springer, Cham (2022). https://doi.org/10.1007/978-3-031-17715-6_15

  9. Cruz-Filipe, L., Montesi, F.: Procedural choreographic programming. In: Bouajjani, A., Silva, A. (eds.) FORTE 2017. LNCS, vol. 10321, pp. 92–107. Springer, Cham (2017). https://doi.org/10.1007/978-3-319-60225-7_7

    Chapter  Google Scholar 

  10. Cruz-Filipe, L., Montesi, F.: A core model for choreographic programming. Theor. Comput. Sci. 802, 38–66 (2020). https://doi.org/10.1016/j.tcs.2019.07.005

    Article  MathSciNet  MATH  Google Scholar 

  11. Cruz-Filipe, L., Montesi, F., Peressotti, M.: Certifying choreography compilation. In: Cerone, A., Ölveczky, P.C. (eds.) ICTAC 2021. LNCS, vol. 12819, pp. 115–133. Springer, Cham (2021). https://doi.org/10.1007/978-3-030-85315-0_8

    Chapter  Google Scholar 

  12. Cruz-Filipe, L., Montesi, F., Peressotti, M.: Formalising a Turing-complete choreographic language in Coq. In: Cohen, L., Kaliszyk, C. (eds.) Procs. ITP. LIPIcs, vol. 193, pp. 1–18. Schloss Dagstuhl - Leibniz-Zentrum für Informatik (2021). https://doi.org/10.4230/LIPIcs.ITP.2021.15

  13. Dalla Preda, M., Gabbrielli, M., Giallorenzo, S., Lanese, I., Mauro, J.: Dynamic choreographies: theory and implementation. Log. Methods Comput. Sci. 13(2), 1–57 (2017). https://doi.org/10.23638/LMCS-13(2:1)2017

  14. Diffie, W., Hellman, M.E.: New directions in cryptography. IEEE Trans. Inf. Theory 22(6), 644–654 (1976). https://doi.org/10.1109/TIT.1976.1055638

    Article  MathSciNet  MATH  Google Scholar 

  15. Gastin, P., Laroussinie, F. (eds.): CONCUR 2010. LNCS, vol. 6269. Springer, Heidelberg (2010). https://doi.org/10.1007/978-3-642-15375-4

  16. Giallorenzo, S., Montesi, F., Peressotti, M.: Choreographies as objects. CoRR abs/2005.09520 (2020), https://arxiv.org/abs/2005.09520

  17. Giallorenzo, S., Montesi, F., Peressotti, M., Richter, D., Salvaneschi, G., Weisenburger, P.: Multiparty languages: the choreographic and multitier cases (pearl). In: Møller, A., Sridharan, M. (eds.) Proceedings ECOOP. LIPIcs, vol. 194, pp. 1–27. Schloss Dagstuhl - Leibniz-Zentrum für Informatik (2021). https://doi.org/10.4230/LIPIcs.ECOOP.2021.22

  18. Hirsch, A.K., Garg, D.: Pirouette: higher-order typed functional choreographies. Proc. ACM Program. Lang. 6(POPL), 1–27 (2022). https://doi.org/10.1145/3498684

  19. Hoare, C.: An axiomatic basis for computer programming. Commun. ACM 12(10), 576–580 (1969). https://doi.org/10.1145/363235.363259

    Article  MATH  Google Scholar 

  20. Jongmans, S., van den Bos, P.: A predicate transformer for choreographies - computing preconditions in choreographic programming. In: Sergey, I. (eds.) Programming Languages and Systems. ESOP 2022. Lecture Notes in Computer Science, vol. 13240, pp. 520–547. Springer, Cham (2022). https://doi.org/10.1007/978-3-030-99336-8_19

  21. Leesatapornwongsa, T., Lukman, J.F., Lu, S., Gunawi, H.S.: Taxdc: A taxonomy of non-deterministic concurrency bugs in datacenter distributed systems. In: Conte, T., Zhou, Y. (eds.) Procs. ASPLOS, pp. 517–530. ACM (2016). https://doi.org/10.1145/2872362.2872374

  22. Levin, G., Gries, D.: A proof technique for communicating sequential processes. Acta Informatica 15, 281–302 (1981). https://doi.org/10.1007/BF00289266

    Article  MathSciNet  MATH  Google Scholar 

  23. López, H.A., Nielson, F., Nielson, H.R.: Enforcing availability in failure-aware communicating systems. In: Albert, E., Lanese, I. (eds.) FORTE 2016. LNCS, vol. 9688, pp. 195–211. Springer, Cham (2016). https://doi.org/10.1007/978-3-319-39570-8_13

    Chapter  MATH  Google Scholar 

  24. Melgratti, H.C., Padovani, L.: Chaperone contracts for higher-order sessions. Proc. ACM Program. Lang. 1(ICFP), 1–29 (2017). https://doi.org/10.1145/3110279

  25. Meyer, B.: Applying “design by contract.” Computer 25(10), 40–51 (1992). https://doi.org/10.1109/2.161279

  26. Montesi, F.: Choreographic programming, Ph. D. Thesis, IT University of Copenhagen (2013)

    Google Scholar 

  27. Montesi, F.: Introduction to Choreographies. Cambridge University Press (2023)

    Google Scholar 

  28. Montesi, F., Yoshida, N.: Compositional choreographies. In: D’Argenio, P.R., Melgratti, H. (eds.) CONCUR 2013. LNCS, vol. 8052, pp. 425–439. Springer, Heidelberg (2013). https://doi.org/10.1007/978-3-642-40184-8_30

    Chapter  Google Scholar 

  29. Needham, R.M., Schroeder, M.D.: Using encryption for authentication in large networks of computers. Commun. ACM 21(12), 993–999 (1978). https://doi.org/10.1145/359657.359659

    Article  MATH  Google Scholar 

  30. Toninho, B., Caires, L., Pfenning, F.: Dependent session types via intuitionistic linear type theory. In: Schneider-Kamp, P., Hanus, M. (eds.) Procs. PPDP, pp. 161–172. ACM (2011). https://doi.org/10.1145/2003476.2003499

  31. Waye, L., Chong, S., Dimoulas, C.: Whip: higher-order contracts for modern services. Proc. ACM Program. Lang. 1(ICFP), 1–28 (2017). https://doi.org/10.1145/3110280

Download references

Acknowledgements

This work was partially supported by Villum Fonden, grant nr 29518.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Eva Graversen .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2023 IFIP International Federation for Information Processing

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Cruz-Filipe, L., Graversen, E., Montesi, F., Peressotti, M. (2023). Reasoning About Choreographic Programs. In: Jongmans, SS., Lopes, A. (eds) Coordination Models and Languages. COORDINATION 2023. Lecture Notes in Computer Science, vol 13908. Springer, Cham. https://doi.org/10.1007/978-3-031-35361-1_8

Download citation

  • DOI: https://doi.org/10.1007/978-3-031-35361-1_8

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-031-35360-4

  • Online ISBN: 978-3-031-35361-1

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics