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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
A state assigns a value to each variable.
- 2.
TLA+ formulas are invariant under finite stuttering, and in particular specifications always allow for stuttering transitions.
- 3.
The complete translation is presented in Fig. 4 at the end of this section.
- 4.
Following the PlusCal convention that the keyword
can also be written
, we also allow the plural forms for
and
.
- 5.
- 6.
- 7.
- 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
Barnes, J.: Programming in Ada 2012. Cambridge University Press, USA (2014)
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
Donovan, A.A.A., Kernighan, B.W.: The Go Programming Language. Addison-Wesley Professional, 1st edn. (2015)
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)
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)
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)
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
Lamport, L.: Time, clocks, and the ordering of events in a distributed system. Commun. ACM 21(7), 558–565 (1978)
Lamport, L.: The part-time parliament. ACM Trans. Comput. Syst. 16(2), 133–169 (1998)
Lamport, L.: Specifying Systems: The TLA\(^+\) Language and Tools for Hardware and Software Engineers. Addison-Wesley, USA (2002)
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
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)
Message Passing Interface Forum. MPI: A Message-Passing Interface Standard Version 4.0 (June 2021)
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)
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)
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
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)
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
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2024 The Author(s), under exclusive license to Springer Nature Switzerland AG
About this paper
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)