Abstract

Compositional methods are central to the development and verification of software systems. They allow breaking down large systems into smaller components, while enabling reasoning about the behaviour of the composed system. For concurrent and communicating systems, compositional techniques based on behavioural type systems have received much attention. By abstracting communication protocols as types, these type systems can statically check that programs interact with channels according to a certain protocol, whether the intended messages are exchanged in a certain order. In this paper, we put on our coalgebraic spectacles to investigate session types, a widely studied class of behavioural type systems. We provide a syntax-free description of session-based concurrency as states of coalgebras. As a result, we rediscover type equivalence, duality, and subtyping relations in terms of canonical coinductive presentations. In turn, this coinductive presentation makes it possible to elegantly derive a decidable type system with subtyping for pi -calculus processes, in which the states of a coalgebra will serve as channel protocols. Going full circle, we exhibit a coalgebra structure on an existing session type system, and show that the relations and type system resulting from our coalgebraic perspective agree with the existing ones.

Highlights

  • Communication protocols enable interactions between humans and computers alike, yet different scientific communities rely on different descriptions of protocols: one community may use textual descriptions, another uses diagrams, and yet another may use types

  • We show in this paper that our coalgebraic view of protocols can guarantee correct process composition, and allows us to reason about key notions in the world of session types, type equivalence, duality and subtyping, while being completely independent of protocol and process representations

  • We have developed a new, language-independent foundation for session types by relying on coalgebras

Read more

Summary

Introduction

Communication protocols enable interactions between humans and computers alike, yet different scientific communities rely on different descriptions of protocols: one community may use textual descriptions, another uses diagrams, and yet another may use types. Q has been declared as a data state that expects an integer to be exchanged (label int) Having added these transitions to our toolbox, we can present the two types T and U as session coalgebras. The last step needs some justification but it will turn out that we can appeal to a standard definition of coinduction in terms of greatest fixed points This demonstrates that our coalgebraic view on session types makes the definition of duality truly natural and straightforward. It is surprisingly simple to express U in our coalgebraic view: we introduce a new state label “un” (unrestricted), which expresses that states reachable from this state can be used arbitrarily as protocols across different processes connecting to a channel that follow the protocol given by those states.

Session Types
Session Coalgebra
Alternative Presentation of Session Coalgebras
Coalgebra of Session Types
Bisimulation
Duality
Parallelizability
Simulation and Subtyping
Decidability
Typing Rules
A Session π-calculus
Algorithmic Type Checking
Concluding Remarks
Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call