Mechanizing Choreographic Programs and Hoare Logic with State Transformers
Timon Böhler, Simon Daniel, David Richter, Pascal Weisenburger, Mira Mezini
Abstract
Choreographic programming is a programming model for developing distributed applications where an entire communication protocol is written as a single program, which a compiler then projects to one process per participant. Choreographic programming abstracts over low-level network communication primitives such as sockets, and provides a high degree of safety guarantees with deadlock freedom ensured by construction. Mechanizing choreographies necessarily deals with both operations specific to distributed programming and standard (local) operations that also occur in non-distributed programs, as well as the typical issues of binding and substitution. We aim to sidestep the latter issues, thereby obtaining a more concise mechanization that focuses on the essential distributed aspects of choreographies. To this end, we use a method recently proposed by Thiemann to elegantly model deadlock-free processes in a dependently typed language: Using state transformers to represent the computations performed by each process. We bring the state transformer model to choreographies, allowing us to reduce the usual mechanization effort around binding and substitution, and to abstract over the details of the "local" aspects of the language. We mechanize in Lean a choreographic language that supports point-to-point communication, broadcasting, recursive procedures, and local stateful methods, allowing each participant to be assigned a different set of methods. We prove soundness and completeness of endpoint projection, establish deadlock freedom for the projected processes, prove confluence, and verify a Hoare logic for choreographies.
Create a lesson
Related papers
Behavioral Analysis of Timed Actors using Syntactic Slice Equivalence
Ali Ataollahi, Fatemeh Ghassemi, Eduard Kamburjan et al.
Exo-GPU: Safe, Imperative, User-schedulable Programming for Tensor Cores
David Zhao Akeley, Yuka Ikarashi, Jonathan Ragan-Kelley
Revisiting Soundness for Occurrence Typing, Semantically
Yuquan Fu, Carlo Angiuli, Sam Tobin-Hochstadt
Opportunistic ZGC: Leveraging Idle Cores for More Effective Concurrent Garbage Collection
Jacob Malloy, Michael R. Jantz, Terry Jones
QuickerChick
Ivan Mladenov, Alperen Keles, Leonidas Lampropoulos
Expressing NumPy Broadcasting via Verb Rank in J
Marcin Żołek