Statically Verified Refinements for Multiparty Protocols

09/14/2020
by   Fangyi Zhou, et al.
0

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 multiparty protocol description toolchain, 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.

READ FULL TEXT
research
01/22/2021

A Decentralized Analysis of Multiparty Protocols

Protocols provide the unifying glue in concurrent and distributed softwa...
research
05/10/2023

Designing Asynchronous Multiparty Protocols with Crash-Stop Failures

Session types provide a typing discipline for message-passing systems. H...
research
05/13/2020

Multiparty Session Programming with Global Protocol Combinators

Multiparty Session Types (MPST) is a typing discipline for communication...
research
04/28/2022

Stay Safe under Panic: Affine Rust Programming with Multiparty Session Types

Communicating systems comprise diverse software components across networ...
research
03/07/2023

Real-World Choreographic Programming: An Experience Report

Choreographic programming is a programming paradigm, whereby the overall...
research
01/12/2021

Communication-Safe Web Programming in TypeScript with Routed Multiparty Session Types

Modern web programming involves coordinating interactions between browse...
research
06/29/2022

Verified Causal Broadcast with Liquid Haskell

Protocols to ensure that messages are delivered in causal order are a ub...

Please sign up or login with your details

Forgot password? Click here to reset