Statically verified refinements for multiparty protocols
File(s)2009.06541v1.pdf (624.97 KB)
Working paper
Author(s)
Zhou, Fangyi
Ferreira, Francisco
Hu, Raymond
Neykova, Rumyana
Yoshida, Nobuko
Type
Working Paper
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 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\"ive implementation, while guaranteeing safety
properties from the underlying theory.
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\"ive implementation, while guaranteeing safety
properties from the underlying theory.
Date Issued
2020-09-14
Citation
2020
Publisher
arXiv
Copyright Statement
© 2020 The Author(s)
Sponsor
Engineering & Physical Science Research Council (E
Engineering & Physical Science Research Council (E
Engineering & Physical Science Research Council (EPSRC)
Engineering & Physical Science Research Council (EPSRC)
Engineering & Physical Science Research Council (EPSRC)
Engineering & Physical Science Research Council (E
Engineering & Physical Science Research Council (EPSRC)
Engineering & Physical Science Research Council (E
Engineering & Physical Science Research Council (EPSRC)
Identifier
http://arxiv.org/abs/2009.06541v1
Grant Number
ERI 025567 (EP/K034413/1)
PO 20131167
EP/K011715/1
EP/N027833/1
EP/P010040/1
20103649
EP/T006544/1
4214176 / RFA 20601
EP/T014709/1
Subjects
cs.PL
cs.PL
cs.DC
Notes
Conditionally Accepted by OOPSLA' 20. Full version with appendix
Publication Status
Published