Skip to main content

Extending PlusCal for Modeling Distributed Algorithms

  • Conference paper
  • First Online:
Integrated Formal Methods (iFM 2023)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 14300))

Included in the following conference series:

  • 335 Accesses

Abstract

PlusCal is a language for describing algorithms at a high level of abstraction. The PlusCal translator generates a TLA+ specification that can be verified using the TLA+ model checkers or proof assistant. We describe Distributed PlusCal, an extension of PlusCal that is intended to facilitate the description of distributed algorithms. Distributed PlusCal adds two orthogonal concepts to PlusCal: (i) processes can consist of several threads that share process-local variables, and (ii) Distributed PlusCal provides communication channels with associated primitives for sending and receiving messages. The existing PlusCal translator has been extended to support these concepts, and we report on initial experience with the use of Distributed PlusCal.

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

Access this chapter

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    A state assigns a value to each variable.

  2. 2.

    TLA+ formulas are invariant under finite stuttering, and in particular specifications always allow for stuttering transitions.

  3. 3.

    The complete translation is presented in Fig. 4 at the end of this section.

  4. 4.

    Following the PlusCal convention that the keyword can also be written , we also allow the plural forms for and .

  5. 5.

    https://github.com/tlaplus/tlaplus.

  6. 6.

    https://github.com/DistributedPlusCal/DistributedPlusCal.

  7. 7.

    https://github.com/tlaplus/Examples/tree/master/specifications.

  8. 8.

    As is standard in finite-state model checking, finite bounds have to be introduced for variables that could grow indefinitely such as clocks or ballots.

References

  1. Barnes, J.: Programming in Ada 2012. Cambridge University Press, USA (2014)

    Book  Google Scholar 

  2. Cousineau, D., Doligez, D., Lamport, L., Merz, S., Ricketts, D., Vanzetto, H.: TLATLA\(^+\) proofs. In: Giannakopoulou, D., Méry, D. (eds.) FM 2012. LNCS, vol. 7436, pp. 147–154. Springer, Heidelberg (2012). https://doi.org/10.1007/978-3-642-32759-9_14

    Chapter  Google Scholar 

  3. Donovan, A.A.A., Kernighan, B.W.: The Go Programming Language. Addison-Wesley Professional, 1st edn. (2015)

    Google Scholar 

  4. Hackett, F., Hosseini, S., Costa, R., Do, M., Beschastnikh, I.: Compiling distributed system models with PGo. In: Aamodt, T.M., Enright Jerger, N.D., Swift, M.M. (eds.) Proceedings of 28th ACM International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS), Vancouver, Canada, pp. 159–175. ACM (2023)

    Google Scholar 

  5. Hawblitzel, C. et al.: Ironfleet: proving practical distributed systems correct. In: Miller, E.L., Hand, S. (eds.), Proceedings of the 25th Symposium on Operating Systems Principles (SOSP), Monterey, CA, U.S.A., pp. 1–17, ACM (2015)

    Google Scholar 

  6. Konnov, I., Kukovec, J., Tran, T.-H.: TLA\(^+\) model checking made symbolic. In: Proceedings of the ACM on Programming Languages, vol. 3(OOPSLA), pp. 123:1–123:30 (2019)

    Google Scholar 

  7. Konnov, I., Kuppe, M., Merz, S.: Specification and verification with the TLA\(^{+}\) Trifecta: TLC, Apalache, and TLAPS. In: Margaria, T., Steffen, B. (eds.) 11th International Symposium On Leveraging Applications of Formal Methods, Verification and Validation (ISoLA 2022), Rhodes, Greece, vol. 13701. LNCS, pp. 88–105. Springer (2022). https://doi.org/10.1007/978-3-031-19849-6_6

  8. Lamport, L.: Time, clocks, and the ordering of events in a distributed system. Commun. ACM 21(7), 558–565 (1978)

    Article  Google Scholar 

  9. Lamport, L.: The part-time parliament. ACM Trans. Comput. Syst. 16(2), 133–169 (1998)

    Article  Google Scholar 

  10. Lamport, L.: Specifying Systems: The TLA\(^+\) Language and Tools for Hardware and Software Engineers. Addison-Wesley, USA (2002)

    Google Scholar 

  11. Lamport, L.: The PlusCal algorithm language. In: Leucker, M., Morgan, C. (eds.) ICTAC 2009. LNCS, vol. 5684, pp. 36–60. Springer, Heidelberg (2009). https://doi.org/10.1007/978-3-642-03466-4_2

    Chapter  Google Scholar 

  12. Liu, Y.A., Stoller, S.D., Lin, B.: From clarity to efficiency for distributed algorithms. ACM Trans. Program. Lang. Syst., 39(3), 12:1–12:41 (2017)

    Google Scholar 

  13. Message Passing Interface Forum. MPI: A Message-Passing Interface Standard Version 4.0 (June 2021)

    Google Scholar 

  14. Rahli, V., Guaspari, D., Bickford, M., Constable, R.L.: Eventml: specification, verification, and implementation of crash-tolerant state machine replication systems. Sci. Comput. Program. 148, 26–48 (2017)

    Article  Google Scholar 

  15. Wilcox, J.R., et al.: Verdi: a framework for implementing and formally verifying distributed systems. In: Grove, D., Blackburn, S.M. (eds.) 36th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI), Portand, OR, U.S.A., pp. 357–368. ACM (2015)

    Google Scholar 

  16. Yu, Y., Manolios, P., Lamport, L.: Model checking TLA+ specifications. In: Pierre, L., Kropf, T. (eds.) CHARME 1999. LNCS, vol. 1703, pp. 54–66. Springer, Heidelberg (1999). https://doi.org/10.1007/3-540-48153-2_6

    Chapter  Google Scholar 

  17. Zeller, P., Bieniusa, A., Ferreira, C.: Teaching practical realistic verification of distributed algorithms in Erlang with TLA+. In: Bieniusa, A., Fördós, V. (eds.) Erlang Workshop, pp. 14–23. ACM (2020)

    Google Scholar 

Download references

Acknowledgments

We would like to thank several Master students, and in particular Heba Alkayed, who contributed to earlier versions of Distributed PlusCal.

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2024 The Author(s), under exclusive license to Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Cirstea, H., Merz, S. (2024). Extending PlusCal for Modeling Distributed Algorithms. In: Herber, P., Wijs, A. (eds) Integrated Formal Methods. iFM 2023. Lecture Notes in Computer Science, vol 14300. Springer, Cham. https://doi.org/10.1007/978-3-031-47705-8_17

Download citation

  • DOI: https://doi.org/10.1007/978-3-031-47705-8_17

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-031-47704-1

  • Online ISBN: 978-3-031-47705-8

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics