Mechanizing Choreographic Programs and Hoare Logic with State Transformers
2026-08-17 • Programming Languages
Programming Languages
AI summaryⓘ
The authors work on choreographic programming, a way to write distributed system communications as a single program that ensures safety like no deadlocks. They use a method involving state transformers to simplify the complex parts of how these programs are modeled, focusing on the distributed side rather than local programming details. Their approach is implemented in the Lean proof assistant where they create and verify a language supporting various communication types and check properties like soundness, completeness, and deadlock freedom.
choreographic programmingdistributed systemsdeadlock freedomstate transformersdependent typesendpoint projectionLean theorem proverHoare logicbinding and substitutionconfluence
Authors
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.