Skip to main content
QUICK REVIEW

[Paper Review] A Language for the Declarative Composition of Concurrent Protocols

Luı́s Cruz-Filipe, Fabrizio Montesi|arXiv (Cornell University)|Feb 11, 2016
Logic, programming, and type systemsComputer Science19 references6 citations
TL;DR

This paper introduces Procedural Choreographies (PC), a new language model for declarative, correct-by-construction composition of concurrent protocols. PC enables safe, modular protocol composition through procedure-based choreographies that are mechanically synthesized into deadlock-free processes, addressing the critical gap in existing models where protocol composition remains unchecked and error-prone.

ABSTRACT

A recent study of bugs in real-world concurrent and distributed systems found that, while implementations of individual protocols tend to be robust, the composition of multiple protocols and its interplay with internal computation is the culprit for most errors. Multiparty Session Types and Choreographic Programming are methodologies for developing correct-by-construction concurrent and distributed software, based on global descriptions of communication flows. However, protocol composition is either limited or left unchecked. Inspired by these two methodologies, in this work we present a new language model for the safe composition of protocols, called Procedural Choreographies (PC). Protocols in PC are procedures, parameterised on the processes that enact them. Procedures define communications declaratively using global descriptions, and programs are written by invoking and composing these procedures. An implementation in terms of a process model is then mechanically synthesised, guaranteeing correctness and deadlock-freedom. We study PC in the settings of synchronous and asynchronous communications, and illustrate its expressivity with some representative examples.

Motivation & Objective

  • To address the growing problem of concurrency bugs caused not by individual protocol implementations, but by their composition in real-world systems.
  • To overcome the limitations of existing choreographic and session-type models, which lack procedural abstraction and support for arbitrary protocol composition.
  • To provide a declarative, modular framework for specifying and composing concurrent protocols that guarantees correctness and deadlock-freedom in the synthesized implementations.
  • To enable reusable, black-box protocol libraries through parameterized procedures that encapsulate communication and computation.
  • To support flexible network topologies and connection reuse, moving beyond the rigid session model of prior work.

Proposed method

  • PC defines protocols as first-class procedures parameterized on the processes that enact them, enabling modular and composable protocol design.
  • Global communication flows are specified declaratively using a 'choreographic' description from a global viewpoint, similar to multiparty session types.
  • An End-Point Projection (EPP) mechanism mechanically synthesizes local process code from the global choreography, ensuring type safety and correctness.
  • The model supports both synchronous and asynchronous communication, with support for connection reuse and dynamic connection establishment.
  • PC inherits deadlock-freedom and communication safety from session-type theory, proven via an EPP theorem (Theorem 4.1).
  • The language supports arbitrary composition through procedure calls, overcoming the limitations of prior choreographic models that lack procedural abstraction.

Experimental results

Research questions

  • RQ1How can concurrent protocol composition be made safe and modular in a way that preserves the programmer’s intent on ordering and atomicity?
  • RQ2Can a declarative language model support arbitrary composition of protocol executions while ensuring correctness and deadlock-freedom?
  • RQ3How can procedural abstraction be integrated into choreographic programming to enable reusable, black-box protocol libraries?
  • RQ4What are the implications of connection reuse and dynamic connectivity for efficient and flexible distributed systems?
  • RQ5How can the model be extended to support fault tolerance and integration with legacy code?

Key findings

  • PC enables the first declarative, modular composition of concurrent protocols through parameterized procedures, overcoming the lack of procedural abstraction in prior choreographic models.
  • The mechanical synthesis of process code via End-Point Projection guarantees that all generated implementations are correct-by-construction and deadlock-free.
  • PC supports flexible network topologies by requiring only actual communicating processes to be connected, unlike prior models that assume complete communication graphs.
  • Protocol executions in PC can reuse existing connections, enabling more efficient implementations and supporting dynamic connection establishment.
  • The model supports both synchronous and asynchronous communication, with implicit parallelism capturing most use cases of explicit parallel operators.
  • The approach effectively addresses the root cause of most real-world concurrency bugs—interactions between multiple protocols—by ensuring safe composition from the start.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.