Statically Verified Refinements for Multiparty Protocols

Fangyi Zhou, Francisco Ferreira, Raymond Hu, Rumyana Neykova, Nobuko Yoshida

Research output: Chapter in Book/Report/Conference proceedingConference contribution

3 Citations (Scopus)
33 Downloads (Pure)

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 naive implementation, while guaranteeing safety properties from the underlying theory.

Original languageEnglish
Title of host publicationProceedings of the ACM on Programming Languages,
Place of PublicationNew York, United States
PublisherACM Press
Pages1-30
Number of pages30
Volume4
EditionOOPSLA
DOIs
Publication statusPublished - 13 Nov 2020

Publication series

NameProceedings of the ACM on Programming Languages (PACMPL)
PublisherACM Press
ISSN (Print)2475-1421

Keywords

  • Code Generation
  • Distributed Programming
  • F
  • Multiparty Session Types (MPST)
  • Refinement Types

Fingerprint

Dive into the research topics of 'Statically Verified Refinements for Multiparty Protocols'. Together they form a unique fingerprint.

Cite this