Session types can fully model complex asynchronous processes

On the Expressiveness of Asynchronous Processes with Nested Session Types

Programming LanguagesDistributed, Parallel, and Cluster Computing

Summary

Communication protocols must be correct to avoid errors, but traditional types used to check these protocols only handle simple patterns. The authors study Nested Session Types (NSTs), which can describe more complex and nested communication sequences. They show that the corresponding process model, ASP, is powerful enough to perform any computation a Turing machine can, by representing counters and instructions through NSTs. This means NSTs capture very complex communication behaviors that were not previously possible with basic session types.

What this means in practice

  • For protocol designers: Design and verify communication protocols that require complex nested behaviors using assured, type-based correctness.
  • For programming language developers: Develop type systems that guarantee correctness of asynchronous message-passing with more expressive protocol specifications.

A theory result. No direct application yet.

Authors

Sjors Wortelboer, Dan Frumin, Jorge A. Pérez

Abstract

Session types are a type-based approach to correct message-passing programs, where types specify protocols for channels and type checking guarantees communication correctness. Traditional session types express regular protocols only, which leaves out many protocols found in practice. Aiming at overcoming this limitation, Nested Session Types (NSTs) can specify nested recursive protocols. NSTs are known to be characterised by one-counter machines and deterministic context-free languages. In this paper, we study the expressiveness of ASP (Asynchronous Session Processes), the process model associated with NSTs as introduced by Das et al. We prove that AST is Turing complete by giving a correct encoding of two-counter machines into typed processes. Our encoding uses a non-trivial state-aware representation of counters and instructions that is neatly governed by NSTs.