Abstract 1 Introduction 2 Preliminaries 3 Lite SISO-tree refinement 4 Subtyping Sets of Session Trees 5 Subtyping sets of session trees using type graphs 6 Implementation 7 Related Work 8 Conclusion References

Abstract Subtyping for
Asynchronous Multiparty Sessions

Laura Bocchi ORCID University of Kent, Canterbury, UK Andy King ORCID University of Kent, Canterbury, UK Maurizio Murgia ORCID Gran Sasso Science Institute, L’Aquila, Italy Simon Thompson ORCID University of Kent, Canterbury, UK
Abstract

Session subtyping answers the question of whether a program in a communicating system can be safely substituted for another, when their communication behaviour is described by session types. Asynchronous session subtyping is undecidable, even for two participants, hence the interest in sound, but incomplete, subtyping algorithms. Asynchronous multiparty subtyping can be formulated by decomposing session types into single input and output types which preclude, respectively, external and internal choice. This paper shows how abstract interpretation can sit atop this approach and how it leads to an algorithm that can prove subtyping for intricate communication patterns.

Keywords and phrases:
asynchrony, session subtyping, automata, abstract interpretation
Copyright and License:
[Uncaptioned image] © Laura Bocchi, Andy King, Maurizio Murgia, and Simon Thompson; licensed under Creative Commons License CC-BY 4.0
2012 ACM Subject Classification:
Theory of computation Program reasoning
; Theory of computation Process calculi
Funding:
This work was supported by EPSRC project EP/T014512/1 (STARDUST) and the PRIN 2022 PNRR project DeLiCE (F53D23009130001).
Editors:
Patricia Bouyer and Jaco van de Pol

1 Introduction

A significant challenge in message-passing concurrency is ensuring that each process in the system adheres to a desired protocol and is free from communication errors. Session types have proved to be powerful in addressing this challenge: they provide a theory for designing protocols with desirable behavioural guarantees, and are directly applicable to programming languages (notably Java [31], Python [22], Rust [33], Go [34] and Erlang [24, 37]) via static type-checking, runtime monitoring, or API generation. Session types were initially proposed for binary sessions involving only two roles (aka participants) [29], and were later extended to multiparty sessions, to allow for many roles [30]. Multiparty session types produce, via automated projection from a global protocol, a safe (by construction) realisation given as a collection of local types, one for each role. In this work we use this as a starting point: a collection of local types whose communications are safe in the sense that no role will ever: (1) get stuck (until it terminates); and (2) receive an unexpected message.

To illustrate protocol realisation, consider the three local types below: a server S, a client C, and a logger L, where s, c, and l denote the respective roles. The server can initially receive two kinds of messages from the client: c?next for more feeds or c?stop for termination. Feed requests are served with a feed (c!feed) and waiting for further requests. The logging process gets regular updates by the server and sends a final summary to the client:

S=(c?next.l!next.c!feed.S+c?stop.l!stop)C=(s!next.s?feed.C+s!stop.l?sum)L=(s?next.L+s?stop.c!sum)

We omit formalities on the semantics for the purposes of this introduction, and instead use color coding to hint at the correspondence between pairs of send/receive actions. This correspondence ensures that, in a system (S,C,L) behaving as the parallel composition of the three local types, no role ever gets stuck or receives an unexpected message.111Session types also accompany labels with payloads of type String, Int, higher-order, etc. We omit these details in our presentation as they are not relevant to subtyping.

A fundamental problem in the application of session types is checking whether the implementation of one component in a distributed system can be substituted for another, without compromising safety of the overarching protocol. This problem can be addressed at the level of types and formulated as session subtyping [13, 21, 25, 26, 27]. Session subtyping establishes a preorder relation on local types: C is a subtype of C, written CC, if a program with type C can be safely substituted by a program with type C. Specifically, given a safe protocol (S,C,L), CC ensures that (S,C,L) is also safe. For example, consider the variant C=s!next.(s?feed.s!stop.l?sum+s?else) of C given earlier. With respect to C, C has: (1) less send options (initially it can only select next, and after receiving one feed it can only select stop), (2) more receive options (the additional option s?else). This notion of substitutability is covariant on send actions and contravariant on receive actions [25]. In fact, one can verify CC, which ensures that if (S,C,L) is safe then so is (S,C,L).

Asynchronous session types are particularly interesting due to the use of FIFO channels in distributed systems and languages such as Go and Rust. When considering asynchronous session types, channels are unidirectional and unbounded (hence two are used for each pair of roles, one in each direction). For example, the asynchronous protocol (S,C,L) behaves as the parallel composition of 3 roles communicating over 6 unidirectional channels, where a send action enqueues a message to a channel and a receive action dequeues it.

Establishing whether subtyping holds is non-trivial, especially when communication is asynchronous. Recent work [27] has provided, for the first time, a sound and complete definition of Multiparty Asynchronous session Subtyping (MAS). This definition of session subtyping is sound and complete in the sense that it precisely capture only and all the safety-preserving modification one can perform on a local type. Besides co- and contra-variance, MAS enables some actions to be swapped, reflecting the asynchronous nature of interaction. MAS allows two kinds of swapping:

SW1

a role can anticipate an output action with respect to an input action;

SW2

a role can swap actions of the same directions from/to different roles.

Below, C′′ is a variant of C where the client anticipates the end-of-session request s!stop before the processing of the feed c?next. This swap may be desirable to allow the client to process the feed from its own local queue at a later stage, and is allowed by SW1. S is a variant of S where the send actions c!feed and l!next have been swapped, which is allowed by SW2. Indeed C′′C and SS.

C′′=(s!next.s!stop.s?feed.l?sum)S=(c?next.c!feed.l!next.S+c?stop.l!stop)

This flexibility comes at a price: for interactions over unbounded channels MAS is undecidable [7, 35]. The subtyping problem can be viewed as a simulation game between the candidate subtype and the supertype, in which supertype is required to mirror any action performed by the candidate subtype. Consider checking whether C′′′ is a subtype of C where:

C′′′=s!next.s!next.s?feed.C′′′

The client requests feeds at double the pace of its own feed processing time. It is actually the case that C′′′C according to asynchronous subtyping [7, 27]. However to verify C′′′C, one needs to show that C can follow the actions of C′′′, albeit with send actions being delayed. Due to unbounded channel size, an unbounded number of input actions (the feed processing) can be deferred, yielding an infinite space of possible interleavings.

Sound algorithms have emerged which aim to establish subtyping in practical scenarios. Most of these algorithms are limited to binary sessions (only two roles) and follow the definition of binary subtyping in [13]. The definition in [13] is operational in nature, based on simulation trees, which makes it relatively straightforward to translate it into a practical subtyping algorithm [3, 6]. Unlike the binary case [13], the multiparty definition of MAS in [27] is declarative. While MAS concisely expresses an intrinsically complex problem, it is also highly non-intuitive. Therefore, it is unrealistic to expect a developer to be able to check the correctness of their code substitutions using the definition directly (beside the fact that the problem is undecidable). MAS can only be practically used if a test for subtyping can be automated, and since the problem is undecidable, the solution will necessarily entail approximation. This paper has exactly this purpose: automation of MAS. Automation still raises the question “how can one trust the algorithm?” Our paper also answers this: our black-box (automatically) generates a certificate which can be, if needed, further checked off with a proof assistant [23].

In this introduction, to clarify the purpose of our work, we have provided an overview of the problem space, and hinted at the underlying asynchronous communication model and the notion of safety that subtyping preserves. However, these details are neither needed nor used in the technical development which follows, since our work builds entirely on the declarative definition of MAS [27] that elegantly abstracts over the communication model.

1.1 Challenges and contributions

The undecidability of MAS is unfortunate, as safety-preserving substitutions are most valuable in the asynchronous setting to check the validity of performance optimisations, namely sending messages earlier or postponing receives [38]. A MAS subtyping checker would encourage developers to experiment with communication structures, providing a litmus test for checking the correctness of an optimisation. While polynomial checking algorithms do exist [36], they do not support optimisation even for the simpler binary case. A potential solution lies in abstract interpretation, previously applied to binary subtyping, where sets of words model asynchronicity [3]. This addresses undecidability with systematic (lattice-theoretic) approximation. To apply abstract interpretation to multiparty interaction, we reformulate MAS as subtyping on sets of session trees, and make the following contributions:

  • We introduce an equivalent but more tractable formulation of MAS [27], based on a new lite refinement preorder. MAS [27] is defined using nested quantification over infinite structures. One of the challenges of checking MAS is that it requires a check for inclusion of the actions being postponed over infinite structures. Lite refinement provides a way to automation by reducing the inclusion check to a simple, local check.

  • Abstraction has been applied to binary subtyping by adapting subtyping to sets of words and then representing these sets with regular expressions [3]. MAS is formulated in terms of session trees, and likewise we generalise subtyping to sets of session trees. To derive continuations after performing an action, we adapt the Brzozowski derivative [10] from regular expressions to session trees, and further extend it to sets of session trees. This provides a semantic foundation for subtyping, similar to a collecting semantics [17], ready for abstract interpretation and the deployment of an abstract domain.

  • We provide a new abstract domain for representing sets of session trees based on type graphs [43] and provide new domain operations for send and receive. Since the abstract domain is not finite, we show how widening can be applied to derive a terminating MAS algorithm founded on lite refinement.

Overall, we show how the theoretical formulation of MAS [27] can be distilled into an algorithm for checking subtyping. Moreover, our algorithm yields a certificate (enabling subtyping to be double-checked by a third-party without consideration of low-level algorithmic details). We complement our theoretical contribution by evaluating our algorithm on some challenging problems and show it can prove subtyping more often than existing methods, whilst being an order of magnitude faster than the state-of-the-art binary algorithm [3].

2 Preliminaries

2.1 Syntax

Let denote a finite set of roles and Σ denote a finite alphabet of communication labels. Let 𝔸!={p!ap,aΣ}, 𝔸?={p?ap,aΣ} and 𝔸=𝔸!𝔸?. The syntactic category of session types, 𝕊, is inductively defined by:

𝕊::=iIp!ai.𝕊i&iIp?ai.𝕊i𝖾𝗇𝖽μ𝚝.𝕊t

where I is drawn from the category of (finite) index sets 𝕀. Session type iIp!ai.𝕊i is for selection/send: the role selects one label in {ai}iI, sends it to role p, and continues as the corresponding 𝕊i. Session type &iIp?ai.𝕊i is a branching/receive action, where the role receives a label from p. 𝖾𝗇𝖽 is for termination, μ𝚝.𝕊 for recursion, and 𝚝 is a type variable used for recursive call.

Asynchronous multiparty subtyping [27] is based on a co-inductive representation of session types called session trees. The category 𝕋 for session trees is defined co-inductively below. Subtyping is defined using three sub-classes of session trees called single-output (SO) trees 𝕌, single-input (SI) trees 𝕍, and single-input-single-output (SISO) trees 𝕎, also defined co-inductively below:

𝕋::=iIp!ai.𝕋i&iIp?ai.𝕋i𝖾𝗇𝖽𝕌::=p!a.𝕌&iIp?ai.𝕌i𝖾𝗇𝖽𝕍::=iIp!ai.𝕍ip?a.𝕍𝖾𝗇𝖽𝕎::=p!a.𝕎p?a.𝕎𝖾𝗇𝖽

We let S, T, U, V and W denote typical members 𝕊, 𝕋, 𝕌, 𝕍 and 𝕎, respectively.

If a sequence W contains the action pa where {!,?}, we write paW. Given the sets !={p!p}, ?={p?p} and =!? we define the mapping act:𝔸 where act(pa)=p. Given a set of actions A𝔸 and a sequence of actions W𝕎, we define act(A)={act(pa)paA} and act(W)={act(pa)paW}.

2.2 MAS: a declarative definition

MAS [27] is formulated in terms of two classes of sequence of actions, 𝒜p and p, which are parameterised by a participant p. Classes 𝒜p and p embed the principles of swapability encoded into MAS. These finite sequences are inductively defined as follows:

Definition 1 (Finite sequences).

𝒜p::=ApAp.𝒜p and p::=BpBp.p where Ap={q?a𝔸?pq} and Bp={q!a𝔸!pq}𝔸?.

𝒜p defines the sequences of actions that can be anticipated before a receive action from p (namely any receive action that is not from p), whereas p defines the sequences of actions that can be anticipated before a send action to p (namely any receive action – outputs can always be done before inputs – and any send action that is not to p). Note in particular that p?a𝒜p and p!ap. Using 𝒜p and p, we can now define refinement for SISO trees:

Definition 2 (SISO refinement).

The refinement relation 𝕎×𝕎 for SISO-trees is co-inductively defined as below, where A𝒜p and Bp:

Example 3.

Since is the largest relation which is closed backwards under these rules it follows (p!a)ω(p!a)ω holds as well as p!a.𝖾𝗇𝖽p!a.𝖾𝗇𝖽. To see (p!a)ω(p!a)ω observe (p!a)ω=p!a.(p!a)ω therefore if p!a.(p!a)ωp!a.(p!a)ω then (p!a)ω(p!a)ω holds too. Thus 𝖱𝖾𝖿𝖮𝗎𝗍 is applicable. Rule 𝖱𝖾𝖿𝖡 is not violated since p!ap hence no rule is contradicted.

Example 4.

Let (q?b)ω denote the infinite sequence of actions q?b.q?b. and consider the following SISO trees: W=p?a.(q?b)ω and W=(q?b)ω. Observe that WW cannot be derived by 𝖱𝖾𝖿𝖨𝗇 since W does not start with p?a or 𝖱𝖾𝖿𝖠 since W does not contain p?a.

SISO-tree refinement provides an elegant vehicle for expressing swapability over the sequences of actions. However, a session type is not a sequence of actions, but rather a tree with selection and branching points. Definition 5 decomposes session trees in sets of SI- and SO- trees so as to express the co- and contra-variance of selection and branching.

Definition 5 (SO- and SI-tree decomposition for session trees).

The tree decomposition maps .𝖲𝖮:𝕋(𝕌) and .𝖲𝖨:𝕋(𝕍) are defined:

𝖾𝗇𝖽𝖲𝖮={𝖾𝗇𝖽}𝗂𝖨p!ai.Ti𝖲𝖮={p!ai.UiiI,UiTi𝖲𝖮}&𝗂𝖨p?ai.Ti𝖲𝖮={&𝗂𝖨p?ai.UiiI,UiTi𝖲𝖮}𝖾𝗇𝖽𝖲𝖨={𝖾𝗇𝖽}𝗂𝖨p!ai.Ti𝖲𝖨={𝗂𝖨p!ai.ViiI,ViTi𝖲𝖨}&𝗂𝖨p?ai.Ti𝖲𝖨={p?ai.ViiI,ViTi𝖲𝖨}

The intuition is that SO-tree decomposition removes the selection points in a session tree and expresses them using sets of single-output sequences, and dually for SI-trees. The maps 𝖲𝖮 and 𝖲𝖨 lift to a set of session trees 𝒯(𝕋) by, respectively, 𝒯𝖲𝖮=T𝒯T𝖲𝖮 and 𝒯𝖲𝖨=T𝒯T𝖲𝖨.

Example 6.

U𝖲𝖨={(p?a)ω}{(p?a)k.p?b.q?b.𝖾𝗇𝖽k0} where U=p?a.U&p?b.q?b.𝖾𝗇𝖽.

Multiparty Asynchronous Subtyping (MAS) is formally defined as a binary relation on session trees in a forall-exists construction. Covariance and contravariance are encoded as a forall requirement on the SO-trees (resp. SI-trees) of the subtype (resp. supertype). The problem is then reduced to checking SISO-tree refinement:

Definition 7 (MAS).

The binary relation on 𝕋×𝕋 is defined by TT holds iff UT𝖲𝖮:VT𝖲𝖨:WU𝖲𝖨:WV𝖲𝖮:WW.

Example 8.

To illustrate MAS, consider showing TT where T=p?c.q!d.𝖾𝗇𝖽&p?e.q!d.𝖾𝗇𝖽 and T=q!d.(p?c.𝖾𝗇𝖽&p?e.𝖾𝗇𝖽). Since T is an SO-tree, T𝖲𝖮={T}. T is not an SI-tree hence T𝖲𝖨={q!d.p?c.𝖾𝗇𝖽,q!d.p?e.𝖾𝗇𝖽}. Universal quantification over T𝖲𝖨 requires that T is checked against both q!d.p?c.𝖾𝗇𝖽 and q!d.p?e.𝖾𝗇𝖽. To do so, note p?c.q!d.𝖾𝗇𝖽T𝖲𝖨 and p?c.q!d.𝖾𝗇𝖽q!d.p?c.𝖾𝗇𝖽 likewise p?e.q!d.𝖾𝗇𝖽T𝖲𝖨 and p?e.q!d.𝖾𝗇𝖽q!d.p?e.𝖾𝗇𝖽 since

3 Lite SISO-tree refinement

To develop a subtyping algorithm we introduce a novel form of SISO-refinement on 𝕎×𝕎, called lite SISO-tree refinement, that is equivalent to classical SISO-refinement but is more attractive computationally. Lite refinement builds on the observation that the equality checks act(W)=act(A.W) and act(W)=act(B.W) in the premises 𝖱𝖾𝖿𝖠 and 𝖱𝖾𝖿𝖡 of classical SISO-refinement can be relaxed to inclusion checks act(W)act(A.W) and act(W)act(B.W) without enlarging the refinement relation. Furthermore, the inclusions can be further relaxed to lightweight checks act(hd(A))act(W) and act(hd(B))act(W) involving only the single actions hd(A) and hd(B) where hd denotes head:

Definition 9.

The lite refinement relation l𝕎×𝕎 on SISO-trees is co-inductively defined as:

where A𝒜p and Bp with 𝖱𝖾𝖿𝖤𝗇𝖽, 𝖱𝖾𝖿𝖨𝗇 and 𝖱𝖾𝖿𝖮𝗎𝗍 as in Definition 2.

Corollary 10.

WW iff WlW.

In the sequel, we develop a subtyping algorithm, based on l, the correctness of which follows from the equivalence asserted by Corollary 10.

4 Subtyping Sets of Session Trees

Reasoning on sets of session trees paves the way for abstract interpretation [17] to be applied, where an algorithm is obtained by representing sets of session trees using an abstract domain constructed from type graphs [32]. Let 𝒯𝖲𝖨={T𝖲𝖨T𝒯} to faciliate the following generalisaton of classical subtyping [27] to sets of session trees:

Definition 11.

The binary relation 𝕋×(𝕋) is defined T𝒯 holds iff 𝒯 and UT𝖲𝖮: V𝒯𝖲𝖨: WU𝖲𝖨 : WV𝖲𝖮 : WW.

The section builds towards a subtyping relation on sets of subtrees, given in Figure 1, that provides a basis for abstract interpretation. Subtyping is defined in terms two notions of derivative: one for receive actions (Definition 16) and one for send actions (Definition 17). These operations scan a session tree from its root for a specific action, and return the session trees obtained by removing that action and any sub-trees that do not include it. These operations are inspired by the Brzozowski derivative [10] of a regular expression e wrt to a symbol u: if e represents a set of words W, the derivative u(e) represents {wΣuwW}. Our derivatives, presented in Sections 4.1 and 4.2, generalise the Brzozowski derivative to operate on (sets of) session trees rather than (sets of) words. Section 4.3 formulates subtyping using the derivatives. The subtyping relation is defined co-inductively, each deduction reading the action at the head of the subtype to apply either the send or receive derivative to the supertype. Our approach is justified by lite refinement.

4.1 Receive derivative of a session tree

Derivatives differ depending on whether they look for receive or send actions. A receive derivative is calculated using a depth bound derived using the 𝖺𝗅𝗐𝖺𝗒𝗌p? predicate:

Definition 12.

The predicate 𝖺𝗅𝗐𝖺𝗒𝗌p?𝕋×0 is inductively defined as follows:

Furthermore 𝖺𝗅𝗐𝖺𝗒𝗌p?(T) holds iff there exists k0 such that 𝖺𝗅𝗐𝖺𝗒𝗌p?(T,k) holds.

Example 13.

Let T1=q?a.p?a.𝖾𝗇𝖽+q?b.p?b.T1 and T2=q?a.p?a.𝖾𝗇𝖽+q?b.T2. Since 𝖺𝗅𝗐𝖺𝗒𝗌p?(p?a.𝖾𝗇𝖽,0) and 𝖺𝗅𝗐𝖺𝗒𝗌p?(p?b.T1,0) then 𝖺𝗅𝗐𝖺𝗒𝗌p?(T1,1). However, 𝖺𝗅𝗐𝖺𝗒𝗌p?(T2,k) does not hold (k0) since 𝖺𝗅𝗐𝖺𝗒𝗌p? is defined inductively.

Lemma 14 asserts that the absence of a bound k implies the absence of subtyping. Lemma 15 asserts that there exists at most one k for which 𝖺𝗅𝗐𝖺𝗒𝗌p?(T,k) holds. The receive derivative, which follows, is then defined in terms of the bound.

Lemma 14.

If T,T𝕋 and p?a.TT then 𝖺𝗅𝗐𝖺𝗒𝗌p?(T).

Lemma 15.

If T𝕋, 𝖺𝗅𝗐𝖺𝗒𝗌p?(T,k) and 𝖺𝗅𝗐𝖺𝗒𝗌p?(T,k) then k=k.

Definition 16 (Receive derivative).

The receive derivative map δp?a:𝕋(𝕋) is defined as δp?a(T)=if 𝖺𝗅𝗐𝖺𝗒𝗌p?(T,k) then {Dδp?ak(T,D)} else , where the derivative relation δp?ak:𝕋×𝕋 for some k0 is inductively defined:

Following MAS, a receive action from p can only be found immediately (first rule) or after other receive actions from other roles (second rule). The second rule can be applied non-deterministically for any jI and derives at least |I| distinct derivatives (which δp?a(T) returns as a set). We write q?aj.Dj for the concatenation of q?a, the action preceding p?a, with a subtree Dj that was the continuation of p?a in that path. The receive derivative is well-defined because there exists at most one k such that 𝖺𝗅𝗐𝖺𝗒𝗌p?(T,k) holds.

4.2 Send derivative of a session tree

Unfortunately, Lemma 14 does not help us define a send derivative on supertypes as we no longer rely on a known bound k. Hence, the definition of Δp!ak is parametric in k.

Definition 17 (Send derivative).

The k-th order send derivative map Δp!ak:𝕋(𝕋) is defined as

Δp!ak(T)={𝒟kif 𝒟kk=0where 𝒟k={DΔp!ak(T,D)}Δp!ak1(T)otherwise

and the derivative relation Δp!ak𝕋×𝕋 is, itself, inductively defined by:

The k-th derivative is defined to be the set of derivatives 𝒟 for which 𝒟, the degree is maximal and k. If 𝒟= for all 0k then the k-th derivative is itself null. Following MAS, in a supertype, a send action can be found immediately (first rule), after receive actions (e.g., the subtype may have anticipated the output), or after other send actions from different roles (third rule). Condition ki maximal means: iI:Δp!aki(Ti,Di)kiki. The third rule derives at least one derivative equipped with |J| branches q!aj.Dj, where the Dj are again selected to maximise their degree ki.

Example 18 (Derivatives).

Let T=r?a.q?a.p!a.T&r?b.r?b.q?a.𝖾𝗇𝖽. The receive derivative δq?a(T) exists because both branches of T possess a receive action q?a. Indeed 𝖺𝗅𝗐𝖺𝗒𝗌q?(T,2) holds, hence δq?a(T)={r?a.p!a.T,r?b.r?b.𝖾𝗇𝖽}. Now consider Δp!ak(T). For k<2, the send derivatives Δp!a0(T) = Δp!a1(T)=. Yet for k2, Δp!ak(T)={r?a.q?a.T}. In this case, p!a does not need to occur in all branches of T for the derivative to exist.

4.3 Subtyping with receive and send derivatives

To apply one derivative after another in a chain of actions, receive and send derivatives are lifted to operators on sets of supertypes as follows:

Definition 19.

The operators δp?a:(𝕋)(𝕋) and Δp!a:(𝕋)(𝕋) are defined:

δp?a(𝒯)={δp?a(T)T𝒯}Δp!ak(𝒯)={Δp!ak(T)T𝒯}where𝒯={𝒯𝒯otherwise

The use of in Δp!ak(𝒯) reflects covariance over sends: the p!a action of the subtype must be supported by all session-trees T𝒯. Conversely, the use of in δp?a(𝒯) models contravariance over receives: the p?a of the subtype does not need to be found in all T𝒯.

Figure 1: Rules for the ternary subtyping relation (𝕋())×𝕋×(𝕋).
Definition 20.

Given a partial map Γ𝕋(), the update and accumulate operations are respectively defined:

  • Γ[TQ]={TQ}{TQΓTT}

  • Γ+p={TQ{p}TQΓ} where {!,?}

Definition 21 (Subtyping on sets of session trees).

The ternary subtyping relation (𝕋())×𝕋×(𝕋) is co-inductively defined by the rules of Figure 1.

The ternary subtyping relation is defined using an environment Γ, a partial map 𝕋(), that records the actions performed by T before T is encountered again as a sub-tree. This device assumes that session trees are regular [40, Section 21.7.2] (aka rational [16]). T is regular iff its set of distinct subtrees, 𝗌𝗎𝖻(T), is finite. This is not limiting since session types correspond to regular session trees. The premises of 𝖱𝖾𝖿𝖨𝗇𝖠 and 𝖱𝖾𝖿𝖮𝗎𝗍𝖡 are partitioned by the dotted lines into: (bottom) requirements based on the syntax of the subtype T that decompose the problem onto sub-problems of the form ΓiTi𝒟i and ensure a progress condition, and (top) subtyping requirements based on derivatives. In both rules, the premise TQΓQact(hd(𝒯)) stipulates that the actions at the head of 𝒯 must be performed within one cycle of T, that is, before T is revisited while traversing the subtype. This progress condition [15] ensures that a head action of 𝒯 is not postponed indefinitely.222 Binary subtyping [3, 5, 6, 13] makes use of a check that tests for cycles of send actions in the candidate subtype. We reframed these checks here as a more intuitive and simple progress condition, which amounts to no more than a set inclusion test that discharges a requirement on swapability.

Rule 𝖱𝖾𝖿𝖨𝗇𝖠 lifts 𝖱𝖾𝖿𝖨𝗇 and 𝖱𝖾𝖿𝖠 of lite refinement (Definition 9) to sets of session trees. The first premise of 𝖱𝖾𝖿𝖨𝗇𝖠 (top) is a coverage condition which ensures that for every T𝒯 a receive derivative δp?ai(T) is defined for least one iI. This guarantees that the selection of receive actions offered by T cover those occurring in 𝒯.

Rule 𝖱𝖾𝖿𝖮𝗎𝗍𝖡 lifts 𝖱𝖾𝖿𝖮𝗎𝗍 and 𝖱𝖾𝖿𝖡 (Definition 9) to session trees by applying the send derivative. Note 𝖱𝖾𝖿𝖨𝗇𝖠 permits a relaxation 𝒟i to be used for δp?ai(𝒯); likewise a superset 𝒟i is used for Δp!aiki(𝒯) in 𝖱𝖾𝖿𝖮𝗎𝗍𝖡. Observe k is not fixed upfront: it can vary with 𝒯.

Theorem 22.

If T𝕋 is regular, 𝒯(𝕋) and T𝒯 then T𝒯.

Example 23 (Violated progress condition).

Consider U=p?a.(q?a.U+q?b.r?a.𝖾𝗇𝖽) and the subtyping problem Ur?a.W where W=p?a.q?a.W and W𝕎. Observe that if Wlr?a.W then r?act(W) hence W is finite which presents a contradiction therefore Ur?a.W. Likewise Ur?a.W as is demonsrated below:

In the first application of 𝖱𝖾𝖿𝖨𝗇𝖠, δp?a(r?a.W) = δp?a(r?a.p?a.q?a.W)={r?a.q?a.W} and δp?a(r?a.W)= for all aa. In the second, δq?a(r?a.q?a.W)={r?a.W} but δq?b(r?a.q?a.W)= thus J is a singleton. The development cannot be progressed since {p?,q?}{r?}=act(hd({r?a.W})), in effect, detecting that r?a is an orphan.

Example 24 (Satisfied progress conditions).

To illustrate where a message is postponed, but is not orphan, consider the question WW where W=p!a.p!a.p?b.W and W=p!a.p?b.W:

To show W{W}, it is sufficient to put k=0 since Δp!a0(W)={p?b.W}. To establish the second, it is necessary to use k=1 because Δp!a0(p?b.W)= but Δp!a1(p?b.W)={p?b.p?b.W}. To show the fourth, k=2 is needed, illustrating that it is not sufficient to fix k throughout. Notice too that W is first revisited when attempting to establish the the fourth judgement. Its environment includes W{p!,p?}Γ and {p?}=act(hd({p?b.W})) hence the environment (orphan) premise is satisfied, and the development continues.

5 Subtyping sets of session trees using type graphs

Type graphs [32, Section 4.1.2] were proposed for representing (possibly infinite) sets of finite trees. We adapt them to represent (possibly infinite) sets of session trees by inductively defining the category 𝔾 of type graphs to be: 𝔾::=𝕋iI𝔾i&iIp?ai.𝔾iiIp!ai.𝔾i. Thus the leaves of a type graph G are session trees drawn from 𝕋. A type graph is interpreted by a concretisation map γ [17] which describes the set of session trees it represents.

Figure 2: (i) T    (ii) G      (iii) W0       (iv) W1    (v) Δq!a2(T)  (vi) Πq!a2(G).
Definition 25 (Concretisation map).

The concretisation map γ:𝔾(𝕋) is defined as the least solution to the following equations:

γ()=γ(T)={T}γ(iIGi)=iIγ(Gi)γ(&iIp?ai.Gi)={&iIp?ai.TiiI:Tiγ(Gi)}γ(iIp!ai.Gi)={iIp!ai.TiiI:Tiγ(Gi)}
Example 26.

Consider T (co-inductively) defined by T=p!a.q!a.Tp!b.T and the type graph G=Tp!a.G where G is (inductively) defined by G=T(p!a.Gp!b.p!a.G). T and G are illustrated in Figure 2 (i) and (ii) as regular trees where the terminal symbols distinguish T from G. If 𝒯0={T} and 𝒯i+1={T,p!a.T,p!a.(p!a.Tp!b.p!a.T)T𝒯i} then γ(G)=i=0𝒯i. Observe that G has a finite representation even though γ(G) is infinite.

Concretisation induces a preorder on 𝔾 by GG iff γ(G)γ(G). The preorder 𝔾, may possess a bottom element but admits infinite ascending chains, as shown below:

Example 27.

Define G0=T and Gi+1=Gip!a.(Gip!a.Gip!b.p!a.Gi). Observe γ(Gi)γ(Gi+1) but γ(Gi)γ(Gi+1) for all i0. Nevertheless the chain Gi has an upper bound: G of Example 26 since γ(Gi)γ(G) for all i0.

As we shall see, calculating the upper bound of a sequence of type graphs is key to finitely computing a co-inductive proof. Such an upper bound can classically [17] be found with a widening operator 𝔾𝔾𝔾. Widening provides a way to finitely derive an upper bound: given any increasing sequence G0G1 the (widened) sequence defined by G0=G0 and Gi+1=GiGi+1 is a sequence G0G1 which is ultimately stable with a limit G. Widening is required [17] to be monotonic in both arguments: GGG and GGG. Then the limit G is an upper bound of the whole Gi sequence, that is, GiG for all i0.

Example 28.

Type graphs can be widened [43] by introducing back-arcs to curb growth and thereby induce stability. To provide some intuition, consider widening the type graph W0 given in Figure 2(iii). Widening is achieved by repeatedly introducing cycles into the type graph by replacing a sub-tree with a back-arc to an ancestor. To illustrate, W0 is transformed into W1, see Figure 2(iv), by replacing the sub-tree p!a.T with a back-arc to an ancestor. Observe W0W1. Moreover, the deepest T of W1 has a direct ancestor which is disjunctive and has T as a child. This triggers the introduction of another back-arc which finally yields G, see Figure 2(ii). Again W1G. The widening algorithm of [43] guarantees [43, Theorem 7.1] that a widened sequence is ultimately stable, while attempting to minimise the introduction of cycles. The widening of [43] will terminate with G, though a more aggressive widening would also replace the deepest T of G with a back-arc to the root.

5.1 An abstract domain for sets of session trees

Operations on type graphs can be designed to mimic those on sets of session trees. In particular, to faithfully mimic the derivatives, it is both necessary to detect the absence of a derivative and preserve the derivation in a relaxation. The following definition formulates these requires and the proposition shows how they can be satisfied by lifting Δp!ak and δp?a:

Definition 29.

An abstract send derivative is any operator Πp!ak:𝔾𝔾 such that:

  • if Δp!ak(γ(G))= then Πp!ak(G)=

  • Δp!ak(γ(G))γ(Πp!ak(G))

for all G𝔾. An abstract receive derivative πp?a:𝔾𝔾 is specified analogously.

Proposition 30.

The operator 𝔾𝔾 is an abstract send derivative where:

with additional rules for Πp!ak(&iIp?ai.Gi) and Πp!ak(iIp!ai.Gi) that follow Definition 17.

An abstract receive derivative πp?a:𝔾𝔾 can also be constructed using an environment Γ.

Example 31.

Consider calculating Πq!a2(G) where G is as defined in Example 26. Figure 2 (i) and (ii) illustrate T and G. Following Proposition 30, Πq!a2(G) is constructed by replacing each leaf T of G with the derivative Δq!a2(T), given in (v), to produce the type graph of (vi).

Figure 3: Intermediate type graphs: (i) G0,0 (ii) G0,1 (iii) G0,2 (iv) G0,3 and (v) G1,0.

An algorithm for checking subtyping follows from Figure 1 by substituting Δp!ak with Πp!ak and δp?a with πp?a; thus operations on sets of session trees are simulated with operations on type graphs. We provide insight by first showing how widening can be applied to type graphs to create a co-inductive proof of subtyping, for a subtype that is linearly recursive.

Example 32.

To illustrate our strategy, consider TQ where T=q!a.q!a.p!a.p!b.T and Q=p!a.q!a.Qp!b.Q. For brevity, define T0=q!a.T1, T1=q!a.T2, T2=p!a.T3 and T3=p!b.T0 thus T=T0. Suppose G0,0=Q and Gi+1,0=Gi,0Gi+1,0 for all i0 where

Observe G0,0G1,0 constitutes an increasing sequence, albeit one that is possibility infinite. Repeating the construction with Gi+1,0=Gi,0Gi+1,0, however, yields a sequence which is ultimately stable, that contains its limit G,0. Because G,0G+1,0=G+1,0=G,0 it follows G+1,0G,0. An infinite co-inductive derivation can then be assembled by repeating the derivation on the right (since 𝖱𝖾𝖿𝖨𝗇𝖠 and 𝖱𝖾𝖿𝖮𝗎𝗍𝖡 support relaxation). Figure 3 illustrates G0,0, G0,1, G0,2, G0,3 and G1,0 whereas Figure 4 gives the widened sequence G0,0G1,0G2,0G3,0 which has G3,0 as its limit. Altogether this shows TQ. Note that G3,0 constitutes a certificate. Finally observe that existence of G3,0, hence an infinite co-inductive derivation, follows by widening, which was originally conceived [17] as a device for enforcing termination.

Figure 4: Widened type graphs: (i) G0,0 (ii) G1,0 (iii) G2,0 (iv) G3,0.

5.2 Subtyping algorithm for type graphs

Example 32 illustrates how widening can be applied to establish the existence of an infinite co-inductive proof for TQ. Algorithm 1 outlines an algorithm, which applies the same strategy for proving TT, but is applicable when T is not linearly recursive. The key caveat for our algorithm is that T is regular. This ensures 𝗌𝗎𝖻(T) is finite. It follows there exists a finite set wp𝗌𝗎𝖻(T) such that every cycle of T crosses at least one sub-tree of wp. (wp is inspired by the idea of widening points which are program locations [4] where widening is applied.)

Example 33.

Continuing Example 32, observe 𝗌𝗎𝖻(T)={T,T1,T2,T3} and the only cycle of T crosses each sub-tree of 𝗌𝗎𝖻(T). Thus put wp={T2}, though other choices are possible.

Algorithm 1 Subtyping algorithm where a type graph represents a set of sessions trees.

In addition to wp, which is fixed throughout, our subtyping algorithm has a worklist L and a partial map 𝒢:𝗌𝗎𝖻(T)𝔾 as parameters. 𝒢 mirrors the strategy used Example 32 which associates each sub-tree of T with its own type graph. The algorithm is primed with L=[T,Γ] where Γ= and 𝒢={TT} (recall 𝕋𝔾). The algorithm exits successfully at line (2) returning the certificate 𝒢, and otherwise throws an exception at (8), (9), (14) or (15) indicating an inconclusive verdict. The body of Subtyping removes the first pair T,Γ from the worklist (if not empty), and checks whether the action at the root of T is a receive, a send, or an 𝖾𝗇𝖽. In the latter case, if 𝔾(T)=𝖾𝗇𝖽 then rule 𝖱𝖾𝖿𝖤𝗇𝖽 of Figure 1 holds and processing continues, otherwise an exception is thrown.

If T is a receive, the progress condition of 𝖱𝖾𝖿𝖨𝗇𝖠 is checked at (8). The coverage condition at (9) can be decided without recourse to γ by an auxiliary predicate 𝖼𝗈𝗏𝖾𝗋 defined thus: 𝖼𝗈𝗏𝖾𝗋()=true, 𝖼𝗈𝗏𝖾𝗋(jJGj)=jJ𝖼𝗈𝗏𝖾𝗋(Gj) and 𝖼𝗈𝗏𝖾𝗋(G)=iI:δp?ai(G) if G𝕋. Then 𝖼𝗈𝗏𝖾𝗋(𝒢(T)) holds iff Tγ(𝒢(T)):iI:δp?ai(T). Line (9) also checks J. If these checks are passed, 𝒢 is relaxed to 𝒢 by updating 𝒢 on the keys {TjjJ}. If the sub-tree Tjwp then widening is triggered and 𝒢(Tj)=𝒢(Tj)πp?aj(𝒢(T)). It follows 𝒢(Tj)𝒢(Tj) and πp?aj(𝒢(T))𝒢(Tj), both assuring soundness while ensuring that 𝒢(Tj) cannot be relaxed ad infinitum. If Tjwp then 𝒢(Tj) = 𝒢(Tj)πp?aj(𝒢(T)), again yielding a sound relaxation. Widening at wp is enough to ensure 𝒢 is ultimately stable across all keys [4]: thus 𝒢=𝒢 after a finite number of updates.

To demonstrate 𝖱𝖾𝖿𝖨𝗇𝖠 holds it remains to show Γ[T]+p?Tjγ(𝒢(Tj)) for all jJ. This is achieved by the list comprehension at (11) which extends the worklist with the pair Tj,Γ[T]+p? for each jJ providing the pair actually needs to be considered, that is, if Γ(Tj)= or ¬(𝒢(Tj)𝒢(Tj)). Subtyping then reduces to invoking Subtype(L,wp,𝒢). Observe Γ(Tj) on any subsequent visit to Tj, and eventually 𝒢(Tj)𝒢(Tj) by virtue of widening. Termination thus follows.

The case for send on lines (14)–(18) is arguably simpler since J does not need to be computed and coverage does not need to be checked.

6 Implementation

To assess practicality, we have implemented the Subtype algorithm in Scala 3.1.0 in 5800 LOC. Our implementation makes substantial use of immutable data-structure and parser combinator libraries [28] to reconstruct the type graph operations of [32] and the widening of [43]. As well as the derivatives, our codebase provides a visualiser for type graphs which outputs tikz.

We tested our algorithm on 12 binary and 12 multiparty problems, as detailed in Table 1. The problem trickySub < trickySup is taken from Example 24 whereas all other problems are drawn from (or inspired by) existing literature. The binary benchmarks include 8 which possess “complex accumulation patterns” [6] which is a catch-all term for communication patterns which defy heuristic methods [6]. The remaining 4 problems were chosen by size.

Table 1: Minimum k of Πp!ak required for successful subtyping, iterations of the algorithm (up), time in ms (expressed as parse time+analysis time) with comparison against related algorithms.
benchmark (binary) k up time [6] [3] [18]
ctxta1 < ctxta2 [6] 1 14 1+ 14
ctxtb1 < ctxtb2 [6] 1 14 1+ 4
14may2 < 14may1 [6] 1 8 1+ 2
badseq1 < badseq2 [6] 1 24 1+ 16
march3testa1 < march3testa2 [6] 1 17 1+ 24
aaaaaab1 < aaaaaab2 [6] 1 9 1+ 2
ex1-ok-loop < ex2-ok-loop [6] 1 15 1+ 34
march3testa1 < march3testb2 [6] 1 28 1+ 15
twinstar < ex2 [6] 1 12 1+ 13
decidex1 < decidex2 [6] 1 22 1+ 33
sub-runningex < sup-runningex [6] 1 12 1+ 40
september1 < september2 [6] 1 20 1+ 75
benchmark (multiparty) k up time [6] [3] [18]
trickySub < trickySup 2 16 1+ 15
FFT1 < FFT2 [11] 1 15 2+ 1
altbit1 < altbit2 [18] 1 4 1+ 0
dbuff1 < dbuff2 [18] 1 5 1+ 1
ring1 < ring2 [18] 1 2 1+ 0
rchoice1 < rchoice2 [18] 1 3 1+ 0
ex181 < ex182 [27] 1 3 2+ 0
ex192 < ex191 [27] 1 9 2+ 2
ex172 < ex171 [27] 1 7 1+ 0
LSWAq2 < LSWAq1 [36] 1 8 2+ 0
LSWAr2 < LSWAr1 [36] 1 5 2+ 0
EYTb2 < EYTb1 [23] 1 3 1+ 0

Our algorithm was able to automatically prove subtyping for all problems, strictly improving on [3, 6] for the binary problems and [18] for the multiparty problems. Our algorithm was also able to establishing subtyping for all the remaining 74 binary problems in the benchmark suite of [6]. The strict improvement over the binary algorithm of [3] occurs because the string widening of [14] deployed in [3], imposes a restriction on the syntactic form of consecutive regular sub-expressions, whereas the particular widening developed for type graphs [42] used in the present work has no such limitation. However, Figure 5 depicts a binary problem, doubleb1 < doubleb2, delibrately crafted in response to the reviewers, to subvert the type graph widening of [42]. This example shows that the algorithm is incomplete.

Surprisingly, calculating the send derivatives with k=1 was sufficient for all but one problem, trickySub < trickySup, which was crafted to be difficult. The up column records how many times the map 𝒢 is updated, which governs complexity. Timings are presented as parse+analysis time and were taken on a 32 GB laptop equipped with a 2.8GHz i7 processor. The zero times are runs beneath the granularity of the clock. The slowest runtime was 1+75=76ms, whereas the subtyping tool of [3], takes 1,757ms worse-case for the binary benchmarks (on the same machine), which suggests that performance-wise, multiparty subtyping is no worse than binary subtyping if carefully designed. All certificates are available at https://www.cs.kent.ac.uk/people/staff/amk/certificates.zip.

7 Related Work

Figure 5: doubleb1 < doubleb2 (adapted from march3testa1 < march3testa2 of [6]).

The undecidability of asynchronous subtyping [7, 35] has given rise to a rich line of research aimed at finding sound algorithms. The first work [8] to explore the boundaries of undecidability, showed that synchronous subtyping can be generalised to k-bounded asynchronous subtyping [8], where input accumulation depth is bounded by k (k=0 is synchronous subtyping). With k fixed, k-bounded asynchronous subtyping is sound and decidable (though the existence of such a k is undecidable [8]).

Asynchronous (binary) approaches include the seminal algorithm from [5, 6] for binary sessions and [3], which uses word approximation [14] to enlarge the class of problems for which asynchronous subtyping can be algorithmically established. The extension from the binary setting to multiparty is not obvious. For example, swapping two send actions or two receive actions (to encode SW2) is not safe in the binary setting: it violates the FIFO ordering of messages, potentially causing communication mismatches (e.g., s!a.s!bs!b.s!a) or deadlocks (e.g., c?a.c?bc?b.c?a). The multiparty setting adds more interleaving options to handle and requires more machinery to keep track of the actions-role association.

As to multiparty asynchronous subtyping, the algorithm in [18], while applicable to several realistic protocols, does not address “complex accumulation patterns" [6] that can be, instead, handled by the tools of [3, 6]. MAS [27] has been mechanized [23] providing a sound and complete tool for verifying subtyping given a hand-crafted certificate as input, but provides no solution to the fundamental problem of how to compute a certificate.

Interest in subtyping seems to be increasing rather than abating and another approach to asynchronous multiparty subtyping [36], based on projecting global types (a global model of a collection of local types), was proposed in parallel to [3] at a sister conference. The global types in [36] provide richer select and branching primitives with respect to classic global types: in a given state, a sender can select to send a message to different receivers, and likewise a receives can wait on different senders. A central requirement of multiparty subtyping in [36] is sub-protocol fidelity [36, Definition 5.1(i)] which ensures that any refinement (subtype) is consistent with a given global type. Sub-protocol fidelity yields a very different notion of subtyping to the one adopted here (and [5, 6, 12, 13] and formalised as MAS [27]). Sub-protocol fidelity allows some actions to be swapped, but it does not allow the anticipation of outputs before inputs, which is a requirement for performance optimisation [38]. This means that a session type may be a subtype of another according to our algorithm (and MAS), but not that of [36]. Thus it is no paradox when the authors of [36] claim decidability while pointing out that asynchronous subtyping is undecidable [7, 35]. Classically, the subtyping question is answered pairwise: by comparing a type against a candidate subtype, without reference to a global type. This formulation is favourable when the global type is unknown, for instance, if types are mined from source code.

Session subtyping is related to compliance between session contracts [1], which is inspired by testing-preorders [19]. Must-testing, in the binary and synchronous setting, can be seen as a sort of inductive compliance relation [39]. Multiparty synchronous must-testing has been studied in [20], binary asynchronous in [2]. Another interesting preorder is fair subtyping [9], which takes its cues from should testing preorder [41], and preserves the possibility of correct termination. Difference nuances of session subtyping, such as those mentioned above, suggest the need of generic subtyping algorithms, parameterised by the underlying preorder.

8 Conclusion

The application of abstract interpretation to asynchronous session subtyping is challenging in the multiparty setting. To provide a semantic basis for abstraction, an alternative notion of SISO-tree refinement is given, and as well as new notions of derivative which, together, enables the MAS subtyping relation to be re-expressed over sets of session-trees. This provides a foundation for abstract interpretation, akin to a classical collecting semantics, whose use is illustrated with a new abstract domain for session trees, constructed from type graphs, that were originally proposed for type recovery. Overall, we provide the first algorithmic formulation of MAS together with experimental results which are truly encouraging.

References

  • [1] Franco Barbanera and Ugo de’Liguoro. Sub-behaviour relations for session-based client/server systems. Mathematical Structures in Computer Science, 25(6):1339–1381, 2015. doi:10.1017/S096012951400005X.
  • [2] Giovanni Bernardi, Ilaria Castellani, Paul Laforgue, and Léo Stefanesco. Constructive Characterisations of the MUST-preorder for Asynchrony. In European Symposium on Programming, volume 15694 of Lecture Notes in Computer Science, pages 88–116, 2025. doi:10.1007/978-3-031-91118-7_4.
  • [3] Laura Bocchi, Andy King, and Maurizio Murgia. Asynchronous Subtyping by Trace Relaxation. In Tools and Algorithms for the Construction and Analysis of Systems, volume 14570 of Lecture Notes in Computer Science, pages 207–226, Berlin, 2024. Springer-Verlag. doi:10.1007/978-3-031-57246-3_12.
  • [4] François Bourdoncle. Efficient Chaotic Iteration Strategies with Widenings. In Formal Methods in Programming and Their Applications, volume 735 of Lecture Notes in Computer Science, pages 128–141, New York, 1993. Springer-Verlag. doi:10.1007/BFb0039704.
  • [5] Mario Bravetti, Marco Carbone, Julien Lange, Nobuko Yoshida, and Gianluigi Zavattaro. A Sound Algorithm for Asychronous Session Subtyping. In International Conference on Concurrency Theory, volume 140 of LIPIcs, pages 38:1–38:16, Dagstuhl, 2019. Schloss Dagstuhl – Leibniz-Zentrum für Informatik. doi:10.4230/LIPIcs.CONCUR.2019.38.
  • [6] Mario Bravetti, Marco Carbone, Julien Lange, Nobuko Yoshida, and Gianluigi Zavattaro. A Sound Algorithm for Asychronous Session Subtyping and its Implementation. Logical Methods in Computer Science, 17(1):1–35, 2021. doi:10.23638/LMCS-17(1:20)2021.
  • [7] Mario Bravetti, Marco Carbone, and Gianluigi Zavattaro. Undecidability of Asynchronous Session Subtyping. Information and Computation, 256:300–320, 2017. doi:10.1016/j.ic.2017.07.010.
  • [8] Mario Bravetti, Marco Carbone, and Gianluigi Zavattaro. On the Boundary between Decidability and Undecidability of Asynchronous Session Subtyping. Theoretical Computer Science, 722:19–51, 2018. doi:10.1016/j.tcs.2018.02.010.
  • [9] Mario Bravetti, Julien Lange, and Gianluigi Zavattaro. Fair Asynchronous Session Subtyping. Logical Methods in Computer Science, 20:5:1–5:47, 2024. doi:10.48550/arXiv.2101.08181.
  • [10] Janusz Brzozowski. Derivatives of Regular Expressions. Journal of the ACM, 11(4):481–494, 1964. doi:10.1145/321239.321249.
  • [11] David Castro-Perez and Nobuko Yoshida. CAMP: cost-aware multiparty session protocols. Proc. ACM Program. Lang., 4(OOPSLA):155:1–155:30, 2020. doi:10.1145/3428223.
  • [12] Tzu-Chun Chen, Mariangiola Dezani-Ciancaglini, Alceste Scalas, and Nobuko Yoshida. On the Preciseness of Subtyping in Session Types. Logical Methods in Computer Science, 13(2):1–61, 2017. doi:10.23638/LMCS-13(2:12)2017.
  • [13] Tzu-Chun Chen, Mariangiola Dezani-Ciancaglini, and Nobuko Yoshida. On the Preciseness of Subtyping in Session Types. In Principles and Practice of Declarative Programming, pages 135–146, New York, 2014. ACM Press. doi:10.1145/2643135.2643138.
  • [14] Tae-Hyoung Choi, Oukseh Lee, Hyunha Kim, and Kyung-Goo Doh. A Practical String Analyzer by the Widening Approach. In Asian Symposium on Programming and Systems, volume 4279 of Lecture Notes in Computer Science, pages 374–388, Berlin, 2006. Springer-Verlag. doi:10.1007/11924661_23.
  • [15] Liron Cohen. Non-well-founded Deduction for Induction and Coinduction. In Conference on Automated Deduction, volume 12699 of Lecture Notes in Computer Science, pages 3–24. Springer-Verlag, 2021. doi:10.1007/978-3-030-79876-5_1.
  • [16] Bruno Courcelle. Fundamental Properties of Infinite Trees. Theoretical Computer Science, 25:95–169, 1983. doi:10.1016/0304-3975(83)90059-2.
  • [17] Patrick Cousot and Radhia Cousot. Abstract Interpretation: A Unified Lattice Model for Static Analysis of Programs by Construction or Approximation of Fixpoints. In Principles of Programming Languages, pages 238–252, New York, 1977. ACM Press. doi:10.1145/512950.512973.
  • [18] Zak Cutner, Nobuko Yoshida, and Martin Vassor. Deadlock-Free Asynchronous Message Reordering in Rust with Multiparty Session Types. In Symposium on Principles and Practice of Parallel Programming, pages 246–261, New York, 2022. ACM Press. doi:10.1145/3503221.3508404.
  • [19] Rocco De Nicola and Matthew Hennessy. Testing Equivalences for Processes. Theoretical Computer Science, 34:83–133, 1984. doi:10.1007/BFb0036936.
  • [20] Rocco De Nicola and Hernán Melgratti. Multiparty Testing Preorders. Logical Methods in Computer Science, 19:1:1–1:31, 2016. doi:10.46298/lmcs-19(1:1)2023.
  • [21] Romain Demangeon and Kohei Honda. Full Abstraction in a Subtyped pi-Calculus with Linear Types. In International Conference on Concurrency Theory, volume 6901 of Lecture Notes in Computer Science, pages 280–296, Berlin, 2011. Springer-Verlag. doi:10.1007/978-3-642-23217-6_19.
  • [22] Romain Demangeon, Kohei Honda, Raymond Hu, Rumyana Neykova, and Nobuko Yoshida. Practical interruptible conversations: distributed dynamic verification with multiparty session types and Python. Formal Methods in Systems Design, 46(3):197–225, 2015. doi:10.1007/s10703-014-0218-8.
  • [23] Burak Ekici and Nobuko Yoshida. Completeness of asynchronous session tree subtyping in coq. In Yves Bertot, Temur Kutsia, and Michael Norrish, editors, International Conference on Interactive Theorem Proving, volume 309 of LIPIcs, pages 13:1–13:20. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2024. doi:10.4230/LIPICS.ITP.2024.13.
  • [24] Simon Fowler. An Erlang Implementation of Multiparty Session Actors. In Interaction and Concurrency Experience, volume 223 of EPTCS, pages 36–50, 2016. doi:10.4204/EPTCS.223.3.
  • [25] Simon Gay and Malcolm Hole. Types and Subtypes for Client-Server Interactions. In European Symposium on Programming, volume 1576 of Lecture Notes in Computer Science, pages 74–90, Berlin, 1999. Springer-Verlag. doi:10.1007/3-540-49099-X_6.
  • [26] Simon Gay and Malcolm Hole. Subtyping for Session Types in the Pi Calculus. Acta Informatica, 42:191–225, 2005. doi:10.1007/s00236-005-0177-z.
  • [27] Silvia Ghilezan, Jovanka Pantovic, Ivan Prokic, Alceste Scalas, and Nobuko Yoshida. Precise Subtyping for Asynchronous Multiparty Sessions. Proc. ACM Program. Lang., 5(POPL):1–28, 2021. doi:10.1145/3434297.
  • [28] Steve Hill. Combinators for Parsing Expressions. Journal of Functional Programming, 6(3):445–463, 1996. doi:10.1017/S0956796800001799.
  • [29] Kohei Honda, Vasco T. Vasconcelos, and Makoto Kubo. Language Primitives and Type Disciplines for Structured Communication-based Programming. In European Symposium on Programming, volume 1381 of Lecture Notes in Computer Science, pages 22–138, Berlin, 1998. Springer-Verlag. doi:10.1007/BFb0053567.
  • [30] Kohei Honda, Nobuko Yoshida, and Marco Carbone. Multiparty asynchronous session types. In Principles of Programming Languages, pages 273–284. ACM, 2008. doi:10.1145/1328438.1328472.
  • [31] Raymond Hu, Nobuko Yoshida, and Kohei Honda. Session-Based Distributed Programming in Java. In European Conference on Object-Oriented Programming, volume 5142 of Lecture Notes in Computer Science, pages 516–541, Berlin, 2008. Springer-Verlag. doi:10.1007/978-3-540-70592-5_22.
  • [32] Gerda Janssens and Maurice Bruynooghe. Deriving Descriptions of Possible Values of Program Variables by Means of Abstract Interpretation. Journal of Logic Programming, 13(2&3):205–258, 1992. doi:10.1016/0743-1066(92)90032-X.
  • [33] Nicolas Lagaillardie, Rumyana Neykova, and Nobuko Yoshida. Stay Safe Under Panic: Affine Rust Programming with Multiparty Session Types. In European Conference on Object-Oriented Programming, volume 222, pages 4:1–4:29, Dagstuhl, 2022. Schloss Dagstuhl – Leibniz-Zentrum für Informatik. doi:10.4230/LIPIcs.ECOOP.2022.4.
  • [34] Julien Lange, Nicholas Ng, Bernardo Toninho, and Nobuko Yoshida. Fencing off Go: liveness and safety for channel-based programming. In Principles of Programming Languages, pages 748–761, 2017. doi:10.1145/3009837.3009847.
  • [35] Julien Lange and Nobuko Yoshida. On the Undecidability of Asynchronous Session Subtyping. In Foundations of Software Science and Computation Structures, volume 10203 of Lecture Notes in Computer Science, pages 441–457, Berlin, 2017. Springer-Verlag. doi:10.1007/978-3-662-54458-7_26.
  • [36] Elaine Li, Felix Stutz, and Thomas Wies. Deciding Subtyping for Asynchronous Multiparty Sessions. In European Symposium on Programming, volume 14576 of Lecture Notes in Computer Science, pages 176–205, Berlin, 2024. Springer-Verlag. doi:10.1007/978-3-031-57262-3_8.
  • [37] Dimitris Mostrous and Vasco Vasconcelos. Session Typing for a Featherweight Erlang. In Coordination Models and Languages, Lecture Notes in Computer Science, pages 95–109, 2011. doi:10.1007/978-3-642-21464-6_7.
  • [38] Dimitris Mostrous, Nobuko Yoshida, and Kohei Honda. Global Principal Typing in Partially Commutative Asynchronous Sessions. In European Symposium on Programming, volume 5502 of Lecture Notes in Computer Science, pages 316–332, Berlin, 2009. Springer-Verlag. doi:10.1007/978-3-642-00590-9_23.
  • [39] Maurizio Murgia. A fixed-points based framework for compliance of behavioural contracts. J. Log. Algebraic Methods Program., 120:100641, 2021. doi:10.1016/j.jlamp.2021.100641.
  • [40] Benjamin C. Pierce. Types and Programming Languages. MIT Press, 2002.
  • [41] Arend Rensink and Walter Vogler. Fair testing. Information and Computation, 205(2):125–198, 2007. doi:10.1016/j.ic.2006.06.002.
  • [42] Pascal Van Hentenryck, Agostino Cortesi, and Baudouin Le Charlier. Type Analysis of Prolog Using Type Graphs. In Programming Language Design and Implementation, pages 337–348. ACM Press, 1994. doi:10.1145/773473.178479.
  • [43] Pascal Van Hentenryck, Agostino Cortesi, and Baudouin Le Charlier. Type Analysis of Prolog Using Type Graphs. Journal of Logic Programming, 22(3):179–209, 1995. doi:10.1016/0743-1066(94)00021-W.