Statically verified refinements for multiparty protocols
Fangyi Zhou, Francisco Ferreira, Raymond Hu, Rumyana Neykova, Nobuko Yoshida
Abstract
With distributed computing becoming ubiquitous in the modern era, safe distributed programming is an open challenge. To address this, multiparty session types (MPST) provide a typing discipline for message-passing concurrency, guaranteeing communication safety properties such as deadlock freedom.
While originally MPST focus on the communication aspects, and employ a simple typing system for communication payloads, communication protocols in the real world usually contain constraints on the payload. We introduce refined multiparty session types (RMPST), an extension of MPST, that express data dependent protocols via refinement types on the data types.
We provide an implementation of RMPST, in a toolchain called Session ⋆ , using Scribble, a toolchain for multiparty protocols, and targeting F ⋆ , a verification-oriented functional programming language. Users can describe a protocol in Scribble and implement the endpoints in F ⋆ using refinement-typed APIs generated from the protocol. The F ⋆ compiler can then statically verify the refinements. Moreover, we use a novel approach of callback-styled API generation, providing static linearity guarantees with the inversion of control. We evaluate our approach with real world examples and show that it has little overhead compared to a naïve implementation, while guaranteeing safety properties from the underlying theory.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Cited by top-tier papers10
- Deadlock-free asynchronous message reordering in rust with multiparty session typesZak Cutner, Nobuko Yoshida, Martin VassorPPoPP 2022 · 28 citations
- Zooid: a DSL for certified multiparty computation: from mechanised metatheory to certified multiparty processesDavid Castro-Perez, Francisco Ferreira, Lorenzo Gheri, Nobuko YoshidaPLDI 2021 · 25 citations
- CAMP: cost-aware multiparty session protocolsDavid Castro-Perez, Nobuko YoshidaOOPSLA 2020 · 16 citations
- Multris: Functional Verification of Multiparty Message Passing in Separation LogicJonas Kastberg Hinrichsen, Jules Jacobs, Robbert KrebbersOOPSLA 2024 · 6 citations
- Hybrid Multiparty Session Types: Compositionality for Protocol Specification through Endpoint ProjectionLorenzo Gheri, Nobuko YoshidaOOPSLA 2023 · 5 citations
Builds on3
- Actris: session-type based reasoning in separation logicJonas Kastberg Hinrichsen, Jesper Bengtson, Robbert KrebbersPOPL 2020 · 44 citations
- Liquidate your assets: reasoning about resource usage in liquid HaskellMartin A. T. Handley, Niki Vazou, Graham HuttonPOPL 2020 · 38 citations
- Label-dependent session typesPeter Thiemann, Vasco T. VasconcelosPOPL 2020 · 14 citations
Related papers
- Top-Down = Bottom-Up: Sound and Complete Characterisations of Liveness by Multiparty Global ProtocolsKai Pischke, Nobuko YoshidaOOPSLA 2026
- A multiparty session typing discipline for fault-tolerant event-driven distributed programmingMalte Viering, Raymond Hu, Patrick Eugster, Lukasz ZiarekOOPSLA 2021 · 13 citations
- A Synthetic Reconstruction of Multiparty Session TypesDavid Castro-Perez, Francisco Ferreira, Sung-Shik JongmansPOPL 2026
- Speak Now: Safe Actor Programming with Multiparty Session TypesSimon Fowler, Raymond HuOOPSLA 2026
- Top-Down or Bottom-Up? Complexity Analyses of Synchronous Multiparty Session TypesThien Udomsrirungruang, Nobuko YoshidaPOPL 2025 · 7 citations
