<figure><img src="image_1.png" /></figure>

HAL
open science

# Towards a Semantic Characterisation of Global Type Well-formedness

Ilaria Castellani, Paola Giannini

► To cite this version:

Ilaria Castellani, Paola Giannini. Towards a Semantic Characterisation of Global Type Well-formedness. PLACES 2024 - 15th Workshop on Programming Language Approaches to Concurrency and Communication-cEntric Software (affiliated with ETAPS 2024), Diana Costa; Raymond Hu, Apr 2024, Luxembourg, Luxembourg. pp.11 - 21. hal-04895569

HAL Id: hal-04895569

https://inria.hal.science/hal-04895569v1

Submitted on 18 Jan 2025

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_2.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
# Towards a Semantic Characterisation of Global Type Well-formedness

Ilaria Castellani*

INRIA, Université Côte d'Azur, France

ilaria.castellani@inria.fr

Paola Giannini†

DiSSTE, Università del Piemonte Orientale, Italy

paola.giannini@uniupo.it

We address the question of characterising the well-formedness properties of multiparty session types semantically, i.e., as properties of the semantic model used to interpret types. Choosing Prime Event Structures (PESs) as our semantic model, we present semantic counterparts for the two properties that underpin global type well-formedness, namely projectability and boundedness, in this model. As a first step towards a characterisation of the class of PESs corresponding to well-formed global types, we identify some simple structural properties satisfied by such PESs.

## 1 Introduction

This paper builds on our previous work [4], where we investigated the use of Event Structures (ESs) as a denotational model for multiparty session types (MPSTs). That paper presented an ES semantics for both sessions and global types, using respectively Flow Event Structures (FESs) and Prime Event Structures (PESs), and showed that if a session is typable with a given global type, then the FES associated with the session and the PES associated with the global type yield isomorphic domains of configurations.

The ES semantics proposed in [4] abstracts away from the syntax of global types, by making explicit the concurrency relation between independent communications. This abstraction is expected since ESs are a “true concurrency” model, where concurrency is treated as a primitive notion. However, [4] focussed on the equivalence between the FES of a session and the PES of its global type, without drawing all the consequences of its results and demonstrating the full benefits of the ES semantics for MPSTs.

In the present paper, we move one step further by studying how the well-formedness property of global types considered in [4] is reflected in their interpretation as Prime Event Structures (PESs). In [4], global type well-formedness is the conjunction of a *projectability* condition and a *boundedness* condition. Having semantic counterparts for these conditions will enable us to reason directly on PESs, taking advantage of their faithful account of concurrency and of their graphical representation.

We prove that: 1) all global types that type the same network yield identical PESs, 2) our proposed properties of *semantic projectability* and *semantic boundedness* for PESs reflect the corresponding properties of global types, and 3) PESs obtained from global types enjoy some simple structural properties.

The rest of the paper is organised as follows. In Section 2 and Section 3 we recall the necessary background from [4] and present the result 1) above. In Section 4 we define our semantic notions of projectability and boundedness and prove the result 2) above. Section 5 is devoted to the result 3). Finally, in Section 6 we discuss related work and sketch some directions for future work.

In the paper, all theorems are given with proofs while all lemmas are stated without proofs.

<footnote>*This research has been supported by the ANR17-CE25-0014-01 CISC project.</footnote>

<footnote>†This work was partially funded by the MUR project “T-LADIES” (PRIN 2020TL3X8X) and has the financial support of the Università del Piemonte Orientale.</footnote>
## 2 Networks and Global Types

To set up the stage for our study, we recall the definitions of sessions and global types from [4]. In the core multiparty session calculus of [4], sessions are described as networks of sequential processes, and processes coincide with local types. Session *participants* are denoted by p, q, r, and *messages* by $\lambda, \lambda'$.

**Definition 2.1 (Processes and networks)**

* Processes are defined by: $P ::=^{\text{coind}} \bigoplus_{i \in I} p!\lambda_i; P_i \mid \sum_{i \in I} p?\lambda_i; P_i \mid \mathbf{0}$
  where I is a finite non-empty index set and $\lambda_h \neq \lambda_k$ for $h \neq k$.

* Networks are defined by: $N = p_1[[P]] \parallel \cdots \parallel p_n[[P]]$ with $n \ge 1$ and $p_h \neq p_k$ for $h \neq k$.

The symbol $::=^{\text{coind}}$ in the definition of processes indicates that the definition is coinductive. This allows infinite processes to be defined without using an explicit recursion operator. However, in order to achieve decidability we focus on regular processes, namely those with a finite number of distinct subprocesses. In writing processes, we will omit trailing $\mathbf{0}$'s and when $|I| = 1$ we will omit the choice symbol.

A network is a parallel composition of processes, each located at a different participant. The LTS semantics of networks is specified by the unique rule:

$$p[[\bigoplus_{i \in I} q!\lambda_i; P_i]] \parallel q[[\sum_{j \in J} p?\lambda_j; Q_j]] \parallel N \xrightarrow{pq\lambda_k} p[[P_k]] \parallel q[[Q_k]] \parallel N \quad \text{where } k \in I \cap J \quad [\text{COMM}]$$

**Definition 2.2 (Global types)** Global types $G$ are defined by: $G ::=^{\text{coind}} p \to q : \{\lambda_i; G_i\}_{i \in I} \mid \text{End}$
where $I$ is finite non-empty index set and $\lambda_h \neq \lambda_k$ for $h \neq k$.

Here again, $::=^{\text{coind}}$ indicates that the definition is coinductive, and we focus on *regular* global types. We will omit trailing End's and when $|I| = 1$ we will write a global type $p \to q : \{\lambda; G\}$ simply as $p \xrightarrow{\lambda} q; G$.

A communication $pq\lambda$ represents the transmission of label $\lambda$ on the channel $pq$ from $p$ to $q$. Communications are ranged over by $\alpha, \beta$. The following notion of trace will be extensively used in the sequel.

**Definition 2.3 (Traces)** A trace $\sigma, \tau$ is a finite sequence of communications, i.e. $\sigma ::= \varepsilon \mid \alpha \cdot \sigma$.
The set of traces is denoted by *Traces*.

It is useful to define sets of participants also for communications and traces. We define $\text{part}(pq\lambda) = \{p, q\}$, and we lift this definition to traces by letting $\text{part}(\varepsilon) = \emptyset$ and $\text{part}(\alpha \cdot \sigma) = \text{part}(\alpha) \cup \text{part}(\sigma)$.

As observed in [4], global types may be viewed as trees whose internal nodes are decorated by channels $pq$, leaves by End, and edges by labels $\lambda$. Given a global type, the sequences of decorations of nodes and edges on the path from the root to an edge in the tree of the global type are traces. We denote by $\text{Tr}^+(G)$ the set of traces of $G$. By definition, $\text{Tr}^+(\text{End}) = \emptyset$ and each trace in $\text{Tr}^+(G)$ is non-empty.

The set of *participants of a global type* $G$, part($G$), is the union of the sets of participants of its traces, i.e. $\text{part}(G) = \bigcup_{\sigma \in \text{Tr}^+(G)} \text{part}(\sigma)$. The regularity assumption ensures that part($G$) is finite for any $G$.

The semantics of global types is given by the standard LTS presented in Figure 1, where transitions are labelled by communications.

The projection of a global type onto participants is given in Figure 2. As usual, projection is defined only when it is defined on all participants. Due to the simplicity of our calculus, the projection of a global type, when defined, is simply a process. The definition is the standard one from [9, 10]: the projection of a choice type on the sender or the receiver yields an output choice or an input choice, while its projection on a third participant is its projection on the continuation of the branch, which must be equal on all branches. Our coinductive definition is more permissive than the standard one for infinite types (see [4]).
$$ p \to q : \{\lambda_i; G_i\}_{i \in I} \xrightarrow{pq\lambda_j} G_j \quad j \in I \quad [\text{ECOMM}] \quad \frac{G_i \xrightarrow{\alpha} G'_i \quad \text{for all } i \in I \quad \text{part}(\alpha) \cap \{p, q\} = \emptyset}{p \to q : \{\lambda_i; G_i\}_{i \in I} \xrightarrow{\alpha} p \to q : \{\lambda_i; G'_i\}_{i \in I}} [\text{ICOMM}] $$

<caption>Figure 1: LTS for global types.</caption>

$$ G \upharpoonright r = 0 \text{ if } r \notin \text{part}(G) \quad (p \to q : \{\lambda_i; G_i\}_{i \in I}) \upharpoonright r = \left\{ \begin{array}{ll} \sum_{i \in I} p?\lambda_i; G_i \upharpoonright r & \text{if } r = q, \\ \bigoplus_{i \in I} q!\lambda_i; G_i \upharpoonright r & \text{if } r = p, \\ G_1 \upharpoonright r & \text{if } r \notin \{p, q\} \text{ and } r \in \text{part}(G_1) \\ & \text{and } G_i \upharpoonright r = G_1 \upharpoonright r \text{ for all } i \in I \end{array} \right. $$

<caption>Figure 2: Projection of global types onto participants.</caption>

A global type G is projectable if $G \upharpoonright p$ is defined for all p.

The following property of boundedness for global types is used to ensure progress.

**Definition 2.4 (Depth and boundedness)** The two functions $\delta(p, \sigma)$ and $\delta(p, G)$ are defined by:

$$ \delta(p, \sigma) = \begin{cases} |\sigma_1 \cdot \alpha| & \text{if } \sigma = \sigma_1 \cdot \alpha \cdot \sigma_2 \text{ and } p \notin \text{part}(\sigma_1) \text{ and } p \in \text{part}(\alpha) \\ 0 & \text{otherwise} \end{cases} \\ \delta(p, G) = \sup(\{\delta(p, \sigma) \mid \sigma \in \text{Tr}^+(G)\}) $$

A global type G is bounded if $\delta(p, G')$ is finite for each participant p and each subtree G' of G.

If $\delta(p, G)$ is finite, then there is no path in the tree of G in which p is delayed indefinitely. Note that if $\delta(p, G)$ is finite, G may have subtrees $G'$ for which $\delta(p, G')$ is infinite.

**Definition 2.5 (Well-formed global types)** A global type G is well formed if it is projectable and bounded.

We conclude this section by recalling the type system for networks. The unique typing rule for networks is Rule [NET] in Figure 3. It relies on a preorder on processes, $P \le Q$, meaning that process P can be used where we expect process Q. This preorder plays the same role as the standard subtyping for local types, except that it is invariant for output processes (rather than covariant). This restriction is imposed in [4] in order to obtain bisimilar LTSs for networks and their global types, a property which in turn is used to prove our main result there (isomorphism of the configuration domains of the two ESs). The preorder rules are interpreted coinductively, since processes may have infinite (regular) trees.

A network is well typed if all its participants behave as specified by the projections of the same global type G. Rule [NET] is standard for MPSTs, so we do not discuss it further.

$$ \mathbf{0} \le \mathbf{0} \ [ \le \mathbf{-0} ] \quad \frac{P_i \le Q_i \quad i \in I}{\sum_{i \in I \cup J} p?\lambda_i; P_i \le \sum_{i \in I} p?\lambda_i; Q_i} \ [ \le \mathbf{-IN} ] \quad \frac{P_i \le Q_i \quad i \in I}{\bigoplus_{i \in I} p!\lambda_i; P_i \le \bigoplus_{i \in I} p!\lambda_i; Q_i} \ [ \le \mathbf{-OUT} ] \\ \frac{P_i \le G \upharpoonright p_i \quad i \in I \quad \text{part}(G) \subseteq \{p_i \mid i \in I\}}{\vdash \prod_{i \in I} p_i[[P_i]] : G} [\text{NET}] $$

<caption>Figure 3: Preorder on processes and network typing rule.</caption>
## 3 Event Structure Semantics of Global Types

In this section we present the interpretation of global types as Prime Event Structures, as proposed in our previous work [4]. We start by recalling the definition of *Prime Event Structure* (PES) and configuration from [12]. All the following definitions (from Definition 3.3 to Definition 3.10) are required background taken from [4], with some minor variations. The new material starts immediately after Definition 3.10.

**Definition 3.1** ([12 Prime Event Structure] A prime event structure (PES) is a tuple $S = (E, \leq, \#)$ where $E$ is a denumerable set of events; $\leq \subseteq (E \times E)$ is a partial order relation, called the causality relation; $\# \subseteq (E \times E)$ is an irreflexive symmetric relation, called the conflict relation, satisfying the property of conflict hereditariness: $\forall e, e', e'' \in E : e \# e' \leq e'' \Rightarrow e \# e''$.

A PES configuration is a set of events that may have occurred at some stage of computation.

**Definition 3.2** ([12 PES configuration] Let $S = (E, \leq, \#)$ be a prime event structure. A configuration of $S$ is a finite subset $\mathcal{X}$ of $E$ which is (1) downward-closed: $e' \leq e \in \mathcal{X} \Rightarrow e' \in \mathcal{X}$; and (2) conflict-free: $\forall e, e' \in \mathcal{X}, \neg(e \# e')$.

The semantics of a PES $S$ is given by its poset of configurations ordered by set inclusion, where $\mathcal{X}_1 \subset \mathcal{X}_2$ means that $S$ may evolve from $\mathcal{X}_1$ to $\mathcal{X}_2$.

The events of the PES associated with a global type will be equivalence classes of particular traces. We introduce some notations for traces $\sigma$. We denote by $\sigma[i]$ the $i$-th element of $\sigma$. If $i \leq j$, we define $\sigma[i \dots j] = \sigma[i] \cdots \sigma[j]$ to be the subtrace of $\sigma$ consisting of the $(j-i+1)$ elements starting from the $i$-th one and ending with the $j$-th one. If $i > j$, we convene that $\sigma[i \dots j]$ denotes the empty trace $\varepsilon$.

A permutation equivalence on *Traces* is used to swap communications with disjoint participants.

**Definition 3.3** (Permutation equivalence) The permutation equivalence on *Traces* is the least equivalence ~ such that

$$ \sigma \cdot \alpha \cdot \alpha' \cdot \sigma' \sim \sigma \cdot \alpha' \cdot \alpha \cdot \sigma' \quad \text{if} \quad \text{part}(\alpha) \cap \text{part}(\alpha') = \emptyset $$

We denote by $[\sigma]_{\sim}$ the equivalence class of $\sigma$, and by $\text{Traces}_{\sim}$ the set of equivalence classes on *Traces*.

The events of the PES associated with a global type are equivalence classes of particular traces that we call *pointed*. Intuitively, a pointed trace “points to” its last communication, in that all the preceding communications in the trace should cause some subsequent communication in the trace. Formally:

**Definition 3.4** (Pointed trace) A non empty trace $\sigma = \sigma[1 \dots n]$ is said to be pointed if

$$ \forall i.1 \leq i < n, \exists j. i < j \leq n. \text{ part}(\sigma[i]) \cap \text{part}(\sigma[j]) \neq \emptyset $$

Note that the condition of Definition 3.4 is vacuously satisfied by any trace of length $n = 1$, since in that case there is no $i$ such that $1 \leq i < n$.

Let us also point out that Definition 3.4 is slightly different from (but equivalent to) the definition of pointed trace given in [4].

For example, let $\alpha_1 = pq\lambda_1$, $\alpha_2 = rs\lambda_2$ and $\alpha_3 = rp\lambda_3$. Then $\sigma_1 = \alpha_1$ and $\sigma_3 = \alpha_1 \cdot \alpha_2 \cdot \alpha_3$ are pointed traces, while $\sigma_2 = \alpha_1 \cdot \alpha_2$ is not a pointed trace.

If $\sigma$ is non empty, we use $\text{last}(\sigma)$ to denote the last communication of $\sigma$. It is easy to prove that, if $\sigma$ is a pointed trace and $\sigma \sim \sigma'$, then $\sigma'$ is a pointed trace and $\text{last}(\sigma) = \text{last}(\sigma')$.

**Definition 3.5** (Global event) Let $\sigma = \sigma' \cdot \alpha$ be a pointed trace. Then $\gamma = [\sigma]_{\sim}$ is a global event, also called g-event, with communication $\alpha$, notation $\text{cm}(\gamma) = \alpha$.

Notice that, due to the observation above, $\text{cm}(\gamma)$ is well defined. We denote by $\mathcal{GE}$ the set of g-events.

We now introduce an operator that adds a communication $\alpha$ in front of a g-event $\gamma$, provided $\alpha$ is a cause of some communication in the trace of $\gamma$. This ensures that the operator always transforms a g-event into another g-event. We call this operator *causal prefixing of a g-event by a communication*.
**Definition 3.6 (Causal prefixing of a g-event by a communication)**

1. The causal prefixing of a g-event $\gamma$ by a communication $\alpha$ is defined by:

$$ \alpha \circ \gamma = \begin{cases} [\alpha \cdot \sigma]_{\sim} & \text{if } \gamma = [\sigma]_{\sim} \text{ and } \text{part}(\alpha) \cap \text{part}(\sigma) \neq \emptyset \\ \gamma & \text{otherwise} \end{cases} $$

2. The operator $\circ$ naturally extends to traces by: $\varepsilon \circ \gamma = \gamma$ ($\alpha \cdot \sigma) \circ \gamma = \alpha \circ (\sigma \circ \gamma)$

An easy consequence of Clause 2 is that $(\sigma' \cdot \sigma) \circ \gamma = \sigma' \circ (\sigma \circ \gamma)$ for all $\sigma$ and $\sigma'$.

Using causal prefixing, we can define the mapping $ev(\cdot)$ which, applied to a trace $\sigma$, yields the g-event representing the communication last($\sigma$) prefixed by its causes occurring in $\sigma$.

**Definition 3.7** The g-event generated by a non-empty trace is defined by: $ev(\sigma \cdot \alpha) = \sigma \circ [\alpha]_{\sim}$

Clearly, $ev(\sigma)$ is a subtrace of $\sigma$ and $cm(ev(\sigma)) = \text{last}(\sigma)$. Observe that the function $ev(\cdot)$ is not injective on the set of traces of a global type. For example, let $G = p \to q : \{\lambda_1; r \xrightarrow{\lambda} s, \lambda_2; r \xrightarrow{\lambda} s\}$. Let $\sigma_1 = pq\lambda_1 \cdot rs\lambda$ and $\sigma_2 = pq\lambda_2 \cdot rs\lambda$. Then $\sigma_1, \sigma_2 \in \text{Tr}^+(G)$ and $ev(\sigma_1) = ev(\sigma_2) = [rs\lambda]_{\sim}$.

**Lemma 3.8** If $\text{part}(\alpha_1) = \text{part}(\alpha_2)$ and $ev(\sigma \cdot \alpha_1) = [\sigma' \cdot \alpha_1]_{\sim}$, then $ev(\sigma \cdot \alpha_2) = [\sigma' \cdot \alpha_2]_{\sim}$.

We proceed now to define the causality and conflict relations on g-events.

**Definition 3.9 (Causality and conflict relations on g-events)** The causality relation $\leq$ and the conflict relation $\#$ on the set of g-events $\mathcal{G}\mathcal{E}$ are defined by:

1. $\gamma \leq \gamma'$ if $\gamma = [\sigma]_{\sim}$ and $\gamma' = [\sigma \cdot \sigma']_{\sim}$ for some $\sigma, \sigma'$;

2. $\gamma \# \gamma'$ if $\gamma = [\sigma \cdot pq\lambda_1 \cdot \sigma_1]_{\sim}$ and $\gamma' = [\sigma \cdot pq\lambda_2 \cdot \sigma_2]_{\sim}$ for some $\sigma, \sigma_1, \sigma_2, p, q, \lambda_1, \lambda_2$ where $\lambda_1 \neq \lambda_2$.

If $\gamma = [\sigma \cdot \alpha \cdot \sigma' \cdot \alpha']_{\sim}$, then the communication $\alpha$ must be done before the communication $\alpha'$. This is expressed by the causality $[\sigma \cdot \alpha]_{\sim} \leq \gamma$. An example is $[pq\lambda]_{\sim} \leq [rs\lambda' \cdot pq\lambda \cdot sq\lambda'']_{\sim}$. As regards the conflict relation, an example is $[rs\lambda \cdot pq\lambda_1 \cdot qr\lambda]_{\sim} \# [pq\lambda_2 \cdot rs\lambda]_{\sim}$, since $pq\lambda_2 \cdot rs\lambda \sim rs\lambda \cdot pq\lambda_2$.

**Definition 3.10 ( [4] Event structure of a global type)** The event structure of the global type $G$ is the triple $\mathcal{S}(G) = (\mathcal{E}(G), \leq_G, \#_G)$ where: $\mathcal{E}(G) = \{ev(\sigma) \mid \sigma \in \text{Tr}^+(G)\}$ and $\leq_G$ and $\#_G$ are the restrictions of $\leq$ and $\#$ to $\mathcal{E}(G)$.

When clear from the context, we shall omit the subscript $G$ in the relations $\leq_G$ and $\#_G$.

In the sequel, a PES obtained from a global type by Definition 3.10 will often be called a g-PES.

It should be stressed that Definition 3.10 only makes sense for global types that are projectable. Such global types are guaranteed to be realisable by some distributed implementation, i.e., to type some network. For these global types it has been shown in [4] that the semantics in Definition 3.10 preserves and reflects the operational semantics, namely that $G$ performs a transition sequence labelled by a trace $\sigma$ in the LTS of Figure 1 if and only if the associated PES admits the configuration $X = \{ev(\sigma') \mid \sigma' \sqsubseteq \sigma\}$.

**Example 3.11** The global type $G = p \to q : \{\lambda_1; r \xrightarrow{\lambda_3} s, \lambda_2; r \xrightarrow{\lambda_3} s\}$ is projectable, with projections:

$$ G \upharpoonright p = P = q!\lambda_1 \oplus q!\lambda_2 \qquad G \upharpoonright q = Q = p?\lambda_1 + q?\lambda_2 \qquad G \upharpoonright r = R = s!\lambda_3 \qquad G \upharpoonright s = U = r?\lambda_3 $$

Clearly, $G$ types the network $p[[P]] \parallel q[[Q]] \parallel r[[R]] \parallel s[[U]]$. The PES $S$ associated with $G$ by Definition 3.10 has three events $\gamma_1 = [pq\lambda_1]_{\sim}, \gamma_2 = [pq\lambda_2]_{\sim}, \gamma_3 = [rs\lambda_3]_{\sim}$, with $\leq_G = \text{Id}$ and $\gamma_1 \#_G \gamma_2$.

Consider now the global type $G' = p \to q : \{\lambda_1; \text{End}, \lambda_2; r \xrightarrow{\lambda_3} s\}$, where the first branch of the choice has no continuation. Clearly, $G'$ is not projectable. However, Definition 3.10 associates the same PES $S$ with $G'$, whereas $G'$ and $S$ do not have the same operational semantics, since $G' \xrightarrow{pq\lambda_1} \text{End}$ while in the PES $S$ the configuration $X = \{\gamma_1\}$ can be extended to the configuration $X' = \{\gamma_1, \gamma_3\}$.
Our PES interpretation of global types explicitly brings out the concurrency between communica-
tions that is left implicit in the syntax of global types. We prove now that all well-formed global types
that type the same network yield the same PES (Theorem 3.14). We start by proving a weaker theorem,
which follows from results established in [12] and [4]. We say that two well-formed global types G and
G' are equivalent if ⊢ N : G and ⊢ N : G' for some network N. Let ≅ denote PES isomorphism.

**Theorem 3.12 (Equivalent well-formed global types yield isomorphic PESs)** *Let G and G' be well-formed global types. If ⊢ N : G and ⊢ N : G' for some network N, then 𝒳(G) ≅ 𝒳(G').*

*Proof.* It was shown in [4] (Theorem 8.18 p 25) that if ⊢ N : G then the domain of configurations of 𝒳(G) is isomorphic to the domain of configurations of the Flow Event Structure associated with N. Then, from ⊢ N : G and ⊢ N : G' it follows that 𝒳(G) and 𝒳(G') have isomorphic domains of configurations. A classical result in [12] (Theorem 9 p. 102) establishes that a PES S is isomorphic to the PES whose events are the prime elements of the domain of configurations of S, with causality relation given by set inclusion and conflict relation given by set inconsistency. We conclude that 𝒳(G) ≅ 𝒳(G'). □*

We now wish to go a step further by showing that 𝒳(G) and 𝒳(G') are actually identical PESs. We write $G \xrightarrow{\sigma} G'$ if $G \xrightarrow{\alpha_1} G_1 \cdots \xrightarrow{\alpha_n} G_n$ where $\alpha_1 \cdots \alpha_n = \sigma$ and $G_n = G'$, and $G \xrightarrow{\sigma} G'$ if there exists $G'$ such that $G \xrightarrow{\sigma} G'$. A similar notation will be used for transition sequences of a network N.

Our next theorem relies on the following key lemma.

**Lemma 3.13** *Let G be a global type and σ be a trace. Then:*

1. $\sigma \in \text{Tr}^+(G)$ implies $G \xrightarrow{\sigma}$;

2. $G \xrightarrow{\sigma} \text{implies } \text{ev}(\sigma) \in \mathcal{E}(G)$.

**Theorem 3.14 (Equivalent well-formed global types yield identical PESs)** *Let G and G' be well-formed global types. If ⊢ N : G and ⊢ N : G' for some network N, then 𝒳(G) = 𝒳(G').*

*Proof.* It is enough to show that 𝒳(G) and 𝒳(G') have exactly the same sets of events, since events
are defined syntactically and the relations of causality and conflict can be extracted from their syntax.

We prove that $\mathcal{E}(G) = \mathcal{E}(G')$. Let $e \in \mathcal{E}(G)$. By Definition 3.10 there exists $\sigma \in \text{Tr}^+(G)$ such that $\text{ev}(\sigma) = e$. Then $G \xrightarrow{\sigma}$ by Lemma 3.13(1), from which we deduce $N \xrightarrow{\sigma}$ by the Session Fidelity result in [4] (Theorem 6.11 p. 16). Then $G' \xrightarrow{\sigma}$ by the Subject Reduction result in [4] (Theorem 6.10 p. 16). By Lemma 3.13(2) this implies $\text{ev}(\sigma) \in \mathcal{E}(G')$, i.e., $e \in \mathcal{E}(G')$.

<figure><img src="image_3.png" /></figure>

# 4 Semantic Well-formedness

We now investigate semantic counterparts for the syntactic well-formedness property of global types.
Recall that type well-formedness is the conjunction of two properties: projectability and boundedness.
We start by defining a notion of semantic projectability for PESs. We first give some auxiliary definitions.

**Definition 4.1** Let G be a global type and 𝒳(G) = (E(G), ≤, #). Two events γ₁, γ₂ ∈ E(G) are in initial conflict, γ₁ #in γ₂, if γ₁ = [σ · pqλ₁]~ and γ₂ = [σ · pqλ₂]~ for some σ, p, q, λ₁, λ₂ such that λ₁ ≠ λ₂.

**Definition 4.2 (Projection of traces on participants)** *The projection of σ on r, σ@r, is defined by:*

$$
\epsilon@r = \epsilon \quad (pq\lambda \cdot \sigma)@r = \begin{cases} q!\lambda \cdot \sigma@r & \text{if } r = p \\ p?\lambda \cdot \sigma@r & \text{if } r = q \\ \sigma@r & \text{if } r \notin \{p, q\} \end{cases}
$$
**Definition 4.3 (Semantic projectability)** Let $G$ be a global type and $\mathcal{S}(G) = (\mathcal{E}(G), \leq, \#)$. We say that $\mathcal{S}(G)$ is semantically projectable if for all $\gamma_1, \gamma_2 \in \mathcal{E}(G)$ in initial conflict:

if there is $\gamma'_1 = [\sigma_1 \cdot \alpha_1]_{\sim}$ with $\gamma_1 \leq_G \gamma'_1$ and $r \in \text{part}(\alpha_1) \setminus \text{part}(\text{cm}(\gamma_1))$,

then there is $\gamma'_2 = [\sigma_2 \cdot \alpha_2]_{\sim}$ with $\gamma_2 \leq_G \gamma'_2$ and $\alpha_2 = \alpha_1$ and $\sigma_2 @ r = \sigma_1 @ r$.

Note that if $G$ is semantically projectable, then also any subterm $G'$ of $G$ is semantically projectable.

We now show that, if a global type $G$ is projectable, then all initial conflicts between two participants $p$ and $q$ in the event structure $\mathcal{S}(G)$ reflect branching points between $p$ and $q$ in the tree of $G$. In general, the mapping from branching points in the tree of $G$ to initial conflicts in $\mathcal{S}(G)$ is not injective, namely, there may be several branching points in the tree of $G$ that give rise to the same initial conflict in $\mathcal{S}(G)$.

**Lemma 4.4 (Initial conflicts in $\mathcal{S}(G)$ reflect branching points in the tree of $G$)** Let $G$ be a global type and $\mathcal{S}(G) = (\mathcal{E}(G), \leq, \#)$. Let $\gamma_1, \gamma_2 \in \mathcal{E}(G)$ be in initial conflict and $\gamma_i = [\sigma_i \cdot \alpha_i]_{\sim}$ for $i \in \{1, 2\}$. If $G$ is projectable then there exists $\sigma'$ such that $\sigma' \cdot \alpha_i \in \text{Tr}^+(G)$ and $\text{ev}(\sigma' \cdot \alpha_i) = [\sigma_i \cdot \alpha_i]_{\sim}$ for $i \in \{1, 2\}$.

Let $\sigma \in \text{Tr}^+(G)$. We denote by $G_\sigma$ the subterm of $G$ after $\sigma$, which is easily defined by induction on the length of $\sigma$. The converse of Lemma 4.4 is immediate, since any subterm of $G$ is $G_\sigma$ for some $\sigma \in \text{Tr}^+(G)$. So if $G_\sigma = p \to q : \{\lambda_i; G'_i\}_{i \in I}$ with $\{1, 2\} \subseteq I$, then the two events $\gamma_1 = \text{ev}(\sigma \cdot pq\lambda_1)$ and $\gamma_2 = \text{ev}(\sigma \cdot pq\lambda_2)$ are in initial conflict because by Lemma 3.8 there exists $\sigma'$ such that $\text{ev}(\sigma \cdot pq\lambda_i) = [\sigma' \cdot pq\lambda_i]_{\sim}$ for $i \in \{1, 2\}$.

**Theorem 4.5 (Projectability preservation)** If $G$ is projectable then $\mathcal{S}(G)$ is semantically projectable.

*Proof.* Let $\gamma_1, \gamma_2 \in \mathcal{E}(G)$ and $\gamma_1 \#_i \gamma_2$. By definition, $\gamma_1 = [\sigma \cdot pq\lambda_1]_{\sim}$ and $\gamma_2 = [\sigma \cdot pq\lambda_2]_{\sim}$ for some $\sigma, p, q, \lambda_1, \lambda_2$ such that $\lambda_1 \neq \lambda_2$. Let $\alpha_i = pq\lambda_i$ for $i \in \{1, 2\}$.

Since $G$ is projectable, by Lemma 4.4 there exists $\sigma'$ such that $\sigma' \cdot \alpha_i \in \text{Tr}^+(G)$ and $\text{ev}(\sigma' \cdot \alpha_i) = [\sigma_i \cdot \alpha_i]_{\sim}$ for $i \in \{1, 2\}$. Then $G_{\sigma'} = p \to q : \{\lambda_i; G'_i\}_{i \in I}$ with $\{1, 2\} \subseteq I$. Since $G$ is projectable, also $G_{\sigma'}$ is projectable. Thus, for any $r \notin \{p, q\}$ we get $G'_1 \upharpoonright r = G'_2 \upharpoonright r$.

Let $\gamma'_1 \in \mathcal{E}(G)$, with $\gamma'_1 \leq_G \gamma'_1$, $\text{cm}(\gamma'_1) = \beta$, and $r \in \text{part}(\beta) \setminus \{p, q\}$. Since $\gamma'_1 \leq_G \gamma'_1$, it must necessarily be $\gamma'_1 = [\sigma \cdot \alpha_1 \cdot \sigma_1 \cdot \beta]_{\sim} = \text{ev}(\sigma' \cdot \alpha_1 \cdot \sigma'_1 \cdot \beta)$ for some $\sigma_1, \sigma'_1$. Then $\sigma'_1 \cdot \beta$ is a path in $G'_1$.

Since $G_{\sigma'}$ is projectable, $G'_1 \upharpoonright r = G'_2 \upharpoonright r$. Then there must be a path $\sigma'_2$ of $G'_2$ such that $\sigma'_1 \cdot \beta @ r = \sigma'_2 \cdot \beta @ r$. We want to show that $\gamma'_2 = \text{ev}(\sigma' \cdot \alpha_2 \cdot \sigma'_2 \cdot \beta) = [\sigma' \cdot \alpha_2 \cdot \sigma_2 \cdot \beta]_{\sim}$ for some $\sigma_2$, i.e., that $\gamma_2 \leq \gamma'_2$. Now, if $\text{part}(\beta) \cap \{p, q\} \neq \emptyset$, we can conclude immediately. So, let us assume $\text{part}(\beta) \cap \{p, q\} = \emptyset$.

Since $\gamma'_1 = \text{ev}(\sigma' \cdot \alpha_1 \cdot \sigma'_1 \cdot \beta) = [\sigma \cdot \alpha_1 \cdot \sigma_1 \cdot \beta]_{\sim}$ we know that $\alpha_1 \cdot \sigma_1 \cdot \beta$ is a pointed trace. So, there must be a *bridging communication sequence* between $\alpha_1$ and $\beta$, namely there must be a subtrace $\beta_1 \cdots \beta_n$ of $\sigma_1$ for some $n \geq 1$ such that

$$ \text{part}(\alpha_1) \cap \text{part}(\beta_1) \neq \emptyset \quad \text{part}(\beta_n) \cap \text{part}(\beta) \neq \emptyset \quad \text{part}(\beta_i) \cap \text{part}(\beta_{i+1}) \neq \emptyset \quad \text{for } 1 \leq i < n $$

Correspondingly, we will have $\sigma'_1 = \hat{\sigma}_1 \cdot \beta_1 \cdots \hat{\sigma}_n \cdot \beta_n$. There are now two possible cases:

- $\text{part}(\beta_i) \neq \{p, q\}$ for every $i = 1, \dots, n$. Since $G_{\sigma'}$ is projectable, $G'_1 \upharpoonright s = G'_2 \upharpoonright s$ for all $s \notin \{p, q\}$, i.e., $\sigma'_1 @ s = \sigma'_2 @ s$. Therefore all the $\beta_i$'s for $1 \leq i \leq n$ must occur in the same order in $\sigma'_2$, i.e. $\sigma'_2 = \tau_1 \cdot \beta_1 \cdots \tau_n \cdot \beta_n$ for some $\tau_1, \dots, \tau_n$. Hence $\text{ev}(\sigma' \cdot \alpha_2 \cdot \sigma'_2 \cdot \beta) = [\sigma' \cdot \alpha_2 \cdot \sigma_2 \cdot \beta]_{\sim}$ for some $\sigma_2$.

- $\text{part}(\beta_j) = \{p, q\}$ for some $j, 1 \leq j \leq n$. Let $k$ be the maximum such index $j$. Then we know that $\text{part}(\beta_h) \neq \{p, q\}$ for every $h, k+1 \leq h \leq n$, and either $p \in \text{part}(\beta_{k+1})$ or $q \in \text{part}(\beta_{k+1})$. Therefore all the $\beta_h$'s for $k+1 \leq h \leq n$ must occur in the same order in $\sigma'_2$, i.e. $\sigma'_2 = \tau_k \cdot \beta_{k+1} \cdots \tau_n \cdot \beta_n$ for some $\tau_k, \dots, \tau_n$. Hence, $\text{ev}(\sigma' \cdot \alpha_2 \cdot \sigma'_2 \cdot \beta) = [\sigma' \cdot \alpha_2 \cdot \sigma_2 \cdot \beta]_{\sim}$ for some $\sigma_2$. $\square$

The converse is not true, i.e., semantic projectability of $\mathcal{S}(G)$ does not imply projectability of $G$, as shown by the global type $G'$ in Example 3.11. Note that there is no network behaving as prescribed by $G'$. We conjecture that for realisable global types semantic projectability implies projectability.
We now define a notion of semantic boundedness for PESs, which is global in that it looks simultaneously at all occurrences of each participant p in the g-events whose last communication involves p. Let $S = (E, \leq, \#)$ be a g-PES. For any participant p, let $p \in \text{part}(S)$ if there exists $\gamma \in E$ such that $p \in \text{part}(\gamma)$.

**Definition 4.6 (Semantic k-depth and semantic boundedness)** Let $S = (E, \leq, \#)$ be a g-PES. The two functions $\delta_{\text{sem}}^k(p, \gamma)$ and $\delta_{\text{gsem}}(p, S)$ are defined by:

$$ \delta_{\text{sem}}^k(p, [\sigma]_\sim) = \begin{cases} |\sigma| & \text{if } \sigma = \sigma_1 \cdot \alpha_1 \cdots \sigma_k \cdot \alpha_k \text{ and } p \in \text{part}(\alpha_i) \text{ for } i = 1, \dots, k \\ 0 & \text{otherwise} \end{cases} \\ \delta_{\text{gsem}}^k(p, S) = \sup(\{\delta_{\text{sem}}^k(p, \gamma) \mid \gamma \in E\}) \text{ for every } k \in \mathbb{N} $$

$S$ is semantically bounded if $\delta_{\text{gsem}}^k(p, S)$ is finite for each participant $p \in \text{part}(S)$ and each $k \in \mathbb{N}$.

**Theorem 4.7 (Boundedness preservation)** If $G$ is bounded, then $\mathcal{S}(G)$ is semantically bounded.

*Proof.* Let $G$ be bounded and $\mathcal{S}(G) = (\mathcal{E}(G), \leq, \#)$. We want to show that $\delta_{\text{gsem}}^k(p, \mathcal{S}(G))$ is finite for each participant $p \in \text{part}(\mathcal{S}(G))$ and each $k \in \mathbb{N}$. Fix some $p$. If $p \notin \text{part}(G)$ then $p \notin \text{part}(\mathcal{S}(G))$ and thus the statement is vacuously true. So, assume $p \in \text{part}(G)$. We show now, by induction on $k$, that there exists $n_k \in \mathbb{N}$ such that $\delta_{\text{sem}}^k(p, \gamma) \leq n_k$ for any $\gamma \in \mathcal{E}(G)$.

- Case $k=1$. We may assume $\gamma = [\sigma_1 \cdot \alpha_1]_\sim \in \mathcal{E}(G)$ with $p \notin \text{part}(\sigma_1)$ and $p \in \text{part}(\alpha_1)$, since for any $\gamma'$ not of this shape we have $\delta_{\text{sem}}^1(p, \gamma') = 0$ and we can immediately conclude. Then there exists $\sigma'_1 \cdot \alpha_1 \in \text{Tr}^+(G)$ such that $\gamma = \text{ev}(\sigma'_1 \cdot \alpha_1)$. Note that it must be $p \notin \text{part}(\sigma'_1)$, since otherwise there would be some $\beta$ in $\sigma'_1$ such that $\text{part}(\beta) \cap \text{part}(\alpha_1) \neq \emptyset$ and the function $\text{ev}(\cdot)$ would keep this $\beta$, contradicting the hypothesis $p \notin \text{part}(\sigma_1)$. Let $n_1 = \delta(p, G) = \sup(\{\delta(p, \sigma) \mid \sigma \in \text{Tr}^+(G)\})$. By Definition 2.4 $\delta(p, \sigma'_1 \cdot \alpha_1) = |\sigma'_1 \cdot \alpha_1| \leq n_1$. Then by Definition 4.6 we get $\delta_{\text{sem}}^1(p, [\sigma_1 \cdot \alpha_1]_\sim) = |\sigma_1 \cdot \alpha_1| \leq |\sigma'_1 \cdot \alpha_1| \leq n_1$.

- Case $k > 1$. Assume that $\sup(\{\delta_{\text{sem}}^{k-1}(p, \gamma) \mid \gamma \in \mathcal{E}(G)\}) \leq n_{k-1}$. Let $\sigma = \sigma_1 \cdot \alpha_1 \cdots \sigma_k \cdot \alpha_k$ be such that $p \notin \text{part}(\sigma_i)$ and $p \in \text{part}(\alpha_i)$ for every $i = 1, \dots, k$, and let $\gamma = [\sigma]_\sim \in \mathcal{E}(G)$. Then there exists $\sigma' = \sigma'_1 \cdot \alpha_1 \cdots \sigma'_k \cdot \alpha_k \in \text{Tr}^+(G)$ such that $\gamma = \text{ev}(\sigma')$. For each $i = 1, \dots, k$ we must have $p \notin \text{part}(\sigma'_i)$, because otherwise we would contradict the hypothesis $p \notin \text{part}(\sigma_i)$ (as argued in the previous case). Let now $\sigma'' = \sigma'_1 \cdot \alpha_1 \cdots \sigma'_{k-1} \cdot \alpha_{k-1}$, and consider the subterm $G_{\sigma''}$ of $G$.

Since $G$ is bounded and $G_{\sigma''}$ is a subtree of $G$, by Definition 2.4 we get $\delta(p, G_{\sigma''}) = \sup(\{\delta(p, \sigma) \mid \sigma \in \text{Tr}^+(G_{\sigma''})\}) = m$ for some $m \in \mathbb{N}$. Therefore $\delta_{\text{sem}}^1(p, [\sigma_k \cdot \alpha_k]_\sim) = |\sigma_k \cdot \alpha_k| \leq |\sigma'_k \cdot \alpha_k| = \delta(p, \sigma'_k \cdot \alpha_k) \leq m$. $\delta(p, \sigma'_k \cdot \alpha_k) = |\sigma'_k \cdot \alpha_k| \leq m$. Let $n_k = n_{k-1} + m$. We may conclude that $\delta_{\text{sem}}^k(p, [\sigma_1 \cdot \alpha_1 \cdots \sigma_k \cdot \alpha_k]_\sim) = \delta_{\text{sem}}^{k-1}(p, [\sigma_1 \cdot \alpha_1 \cdots \sigma_{k-1} \cdot \alpha_{k-1}]_\sim) + \delta_{\text{sem}}^1(p, [\sigma_k \cdot \alpha_k]_\sim) \leq n_{k-1} + m = n_k$.

□

# 5 Structural Properties of g-PESs

In this section we discuss some additional properties of the PESs we obtain by interpreting global types. Some of these properties do not depend on the well-formedness of global types but only on their syntax. For instance, since we adopt for global types the directed choice construct of [9, 10]: $p \to q : \{\lambda_i; G_i\}_{i \in I}$, every branch of a choice uses the same channel pq. As a consequence, g-PESs satisfy the property of initial conflict uniformity: in every set $X = \{\gamma_1, \dots, \gamma_n\}$ of initially conflicting g-events, every $\gamma_i \in X$ uses the same channel pq in its last communication, i.e., $\text{cm}(\gamma_i) = pq\lambda_i$ for some $\lambda_i$. Moreover, since global types have deterministic LTSs, where no state can perform two different transitions with the same label,
the same holds for g-PESs: if $\mathcal{X}$, $\mathcal{X} \cup \{\gamma_1\}$, $\mathcal{X} \cup \{\gamma_2\}$ are configurations of the same g-PES, then $\gamma_1 \neq \gamma_2$ implies $\text{cm}(\gamma_1) \neq \text{cm}(\gamma_2)$. If moreover $\neg(\gamma_1 \# \gamma_2)$, we additionally have $\text{part}(\text{cm}(\gamma_1)) \cap \text{part}(\text{cm}(\gamma_2)) = \emptyset$.

Note that our core session calculus may be viewed as a linear subcalculus of Milner's calculus CCS, where parallel composition appears only at top level and any pair of processes *P* and *Q*, run by participants *p* and *q*, can communicate only via two unidirectional channels: channel *pq* for communication from *p* to *q*, and channel *qp* for communication from *q* to *p*. Hence, *restricted parallel composition*, which is the kind of parallel composition used in session calculi, where processes are only allowed to communicate with each other but not to proceed independently, becomes an associative operation, while it is not associative in full CCS (as observed by Milner in his 1980 book, see [11] page 21).

Then, a natural question is: how does our ES semantics for the linear subcalculus of CCS compare to the ES semantics proposed in [2, 3] for other fragments of CCS? To carry out this comparison, we would need to take a more extensional view of g-PESs, forgetting about the syntactic structure of g-events and retaining only their last communication. In other words, we should consider *Labelled PESs*, where events are labelled by communications $pq\lambda$ and have no specific structure. Moreover, some care should be taken since, unlike our session calculus, our language for global types is *not* a subcalculus of CCS: indeed, while the syntax of global types is included in that of CCS with guarded sums, their semantics is not the same as that of CCS processes, since some communications may be performed under guards.

More in detail, the work [2] provides a characterisation of the class of Labelled PESs obtained by interpreting the fragment of CCS built from actions *a*, *b*,... by means of the three constructors $+, ;, \parallel$, denoting respectively choice, sequential composition and parallel composition with no communication. As a matter of fact, [2] uses slightly more relaxed PESs where conflict is not required to be hereditary - let us call them r-PESs - and shows that the Labelled r-PESs obtained for that fragment of CCS are exactly those satisfying two structural properties called *triangle freeness* and *N-freeness*. In conjunction, these two properties express the possibility of extracting a head operator among $+, ;, \parallel$ from the structure of the r-PES. We recall from [2] the definition of these properties. Let $\prec$ denote the *concurrency relation* on the events of a PES $S = (E, \leq, \#)$, defined by $\prec = (E \times E) - (\leq \cup \geq \cup \#)$. Let $\diamond = (\leq \cup \geq)$ denote *causal connection*. By definition the three relations $\diamond, \#)$ and $\prec$ set a partition over $E \times E$. Then triangle freeness (or $\nabla$-freeness) is defined as the absence of a triple of events $e, e', e''$ such that $e \diamond e' \# e'' \prec e$ (see [2] page 41). Note that one half of triangle-freeness, where $\diamond$ is replaced by $\geq$, is implied by conflict hereditariness in g-PESs. We conjecture that g-PESs satisfy also the other half of triangle-freeness, where $\diamond$ is replaced by $\leq$, namely they do not feature the pattern $e \leq e' \# e'' \prec e$, a situation known as *asymmetric confusion* in Petri nets. The property of N-freeness is slightly more involved. For any $R \in \{\leq, \#\}$, let $R^\epsilon$ be the reflexive and symmetric closure of $R$ and $\ddagger(R)$ be the $R$-*incomparability* relation defined by $\ddagger(R) = (E \times E) - R^\epsilon$. Then the N-freeness property is stated as follows:

$$ \textit{N-freeness} \quad \forall R \in \{\leq, \#, \prec\}: (e_0 Re_1 \wedge e_0 \ddagger(R)e_2 \wedge e_2 Re_3 \wedge e_1 \ddagger(R)e_3) \implies (e_0 Re_3 \implies e_2 Re_1) $$

This property does not hold for g-PESs, e.g., it does not hold for the g-PES of the global type $G = p \xrightarrow{\lambda_0} q; p \xrightarrow{\lambda_1} t; r \xrightarrow{\lambda_2} s; q \xrightarrow{\lambda_3} s$, with $e_0 = [pq\lambda_0]_~, e_1 = [pq\lambda_0 \cdot pt\lambda_1]_~, e_2 = [rs\lambda_2]_~, e_3 = [pq\lambda_0 \cdot rs\lambda_2 \cdot qs\lambda_3]_~$.

However, we may show that g-PESs satisfy particular instances of N-freeness, for instance when $R$ is the covering relation of $\leq$ and $e_1 \#_in e_3$ (in which case conflict hereditariness enforces $e_0 \prec e_2$).

The paper [3], on the other hand, presents a Flow Event Structure semantics for the whole calculus CCS. Our conjecture is that this semantics should coincide with the Flow ES semantics proposed for sessions in [4]. However, this is not entirely trivial since the semantics of [3] uses self-conflicting events, a specific feature of Flow ESs, to interpret restricted parallel composition, while the semantics of [4] uses a pre-processing phase to rule out the g-events that do not satisfy a causal well-foundedness condition, and these events are a superset of those that are self-conflicting in the semantics of [3]. However, one
may already observe that the Flow ESs obtained by interpreting sessions in [4] trivially satisfy the axiom
$\Delta$ put forward in [5] in order to guarantee that CCS parallel composition is a categorical product.

# 6 Conclusion

We conclude by further discussing related work and by sketching some directions for future work.

**Related work.** In Section 5 we compared our PES semantics for global types to existing ES semantics for other fragments of CCS. In that case, the comparison was somewhat hindered by the fact that the target ESs were not exactly the same (PESs vs r-PESs vs Flow ESs). We now turn to other proposals of denotational models for MPSTs. The models that are closest to ours are the *graphical choreographies* by Guanciale and Tuosto [14], the *choreography automata* by Barbanera, Lanese and Tuosto [1], the *global choreographies* by de'Liguoro, Melgratti and Tuosto [6], and the *branching pomsets* by Edixhoven et al. [8]. It should be noted that most of these works deal with asynchronous communication, so “events” (or communications) are split into send events and receive events. Common well-formedness conditions proposed in these works are *well-branchedness* [1, 5, 6, 8], which in our case is enforced by the syntax of global types, and *well-sequencedness* [1, 6], which is automatically enforced by our PES semantics. As regards the use of ESs to model MPSTs, the paper [6] also uses PESs to model (asynchronous) choreographies, but it needs an additional type system to obtain projectability (so, the resulting notion of projectability is not totally semantic). In [8], asynchronous choreographies are modelled with branching pomsets, a model featuring both concurrency and choice, which is compared with various classes of ESs.

**Future work.** In this paper, we have devised semantic counterparts for the well-formedness conditions of global types. However, we have only gone half the way in establishing a characterisation of the class of Prime ESs representing well-formed global types. To achieve such a characterisation, we should prove the converse of Theorem 4.7 and the following weaker form of the converse of Theorem 4.5:

**Conjecture [Projectability reflection]** Let $G$ be a global type. If $\mathcal{S}(G)$ is semantically projectable then there exists a projectable global type $G'$ such that $\mathcal{S}(G') = \mathcal{S}(G)$.

If this conjecture were true, then our PES semantics for global types would also provide a way to “sanitise” ill-formed global types. For instance, starting from the g-PES $\mathcal{S}(G')$ of the ill-formed global type $G'$ of Example 3.11, we would be able to get back to the well-formed global type $G$ of the same example or to the well-formed global type $G'' = r \xrightarrow{\lambda_3} s; p \rightarrow q : \{\lambda_1; End, \lambda_2; End\}$. Once we achieve a characterisation for this class of g-PESs, the next step would be to propose an algorithm to synthesise a well-formed global type (or directly a network) from a g-PES of this class. A further goal would be to semantically characterise less restrictive notions of projection, such as the one proposed in [7].

Since g-PESs are images of regular trees, it would be worth investigating their connection with Regular Event Structures [13]. Moreover, as argued in the previous section, extensional g-PESs, where g-events have no structure and are labelled by their last communication, may be viewed as Labelled ESs whose observable behaviour (the communications) is deterministic. Hence, such extensional g-PESs could be characterised by the trace language they recognise<fnref n="1" />.

**Acknowledgments.** We are grateful to the anonymous reviewers for their useful suggestions. The first author would also like to acknowledge interesting discussions with Nobuko Yoshida, Francisco Ferreira and Raymond Hu during her visits to Oxford University and Queen Mary University of London in 2023.

<footnote n="1">¹Here, “trace” should be intended as a Mazurkiewicz trace, namely as an equivalence class of standard traces with respect to an independence relation $I$ on the alphabet of the language, which in our case is given by $pq\lambda I rs\lambda'$ if $\{p,q\} \cap \{r,s\} = \emptyset$.</footnote>
References

[1] Franco Barbanera, Ivan Lanese & Emilio Tuosto (2020): *Choreography Automata*. In Simon Bliudze & Laura Bocchi, editors: *Coordination Models and Languages - 22nd IFIP WG 6.1 International Conference, COORDINATION 2020*, 12134, Springer, pp. 86–106, doi:10.1007/978-3-030-50029-0_6.

[2] Gérard Boudol & Ilaria Castellani (1988): *Concurrency and atomicity*. Theoretical Computer Science 59(1-2), pp. 25–84, doi:10.1016/0304-3975(88)90096-5.

[3] Gérard Boudol & Ilaria Castellani (1988): *Permutation of transitions: an event structure semantics for CCS and SCCS*. In J.W. de Bakker, W.-P. de Roever & G. Rozenberg, editors: REX School/Workshop on Linear Time, Branching Time and Partial Order in Logics and Models for Concurrency, Noordwijkerhout, Lecture Notes in Computer Science 354, Springer-Verlag, pp. 411–427, doi:10.1007/BFb0013028.

[4] Ilaria Castellani, Mariangiola Dezani-Ciancaglini & Paola Giannini (2023): *Event structure semantics for multiparty sessions*. J. Log. Algebraic Methods Program. 131, p. 100844, doi:10.1016/j.jlamp.2022.100844.

[5] Ilaria Castellani & Guo Qiang Zhang (1997): *Parallel product of event structures*. Theoretical Computer Science 179(1-2), pp. 203–215, doi:10.1016/S0304-3975(96)00104-1.

[6] Ugo de'Liguoro, Hernán C. Melgratti & Emilio Tuosto (2022): *Towards refinable choreographies*. J. Log. Algebraic Methods Program. 127, p. 100776, doi:10.1016/j.jlamp.2022.100776.

[7] Pierre-Malo Deniélou & Nobuko Yoshida (2013): *Multiparty Compatibility in Communicating Automata: Characterisation and Synthesis of Global Session Types*. In Fedor V. Fomin, Rusins Freivalds, Marta Z. Kwiatkowska & David Peleg, editors: Automata, Languages, and Programming - 40th International Colloquium, ICALP 2013, Riga, Latvia, July 8-12, 2013, Proceedings, Part II, Lecture Notes in Computer Science 7966, Springer, pp. 174–186, doi:10.1007/978-3-642-39212-2_18.

[8] Luc Edixhoven, Sung-Shik Jongmans, José Proença & Ilaria Castellani (2024): *Branching pomsets: Design, expressiveness and applications to choreographies*. J. Log. Algebraic Methods Program. 136, p. 100919, doi:10.1016/J.JLAMP.2023.100919.

[9] Kohei Honda, Nobuko Yoshida & Marco Carbone (2008): *Multiparty Asynchronous Session Types*. In George C. Necula & Philip Wadler, editors: POPL, ACM Press, New York, pp. 273–284, doi:10.1145/1328897.1328472.

[10] Kohei Honda, Nobuko Yoshida & Marco Carbone (2016): *Multiparty Asynchronous Session Types*. Journal of ACM 63(1), pp. 9:1–9:67, doi:10.1145/2827695.

[11] Robin Milner (1980): *A Calculus of Communicating Systems*. Lecture Notes in Computer Science 92, Springer, doi:10.1007/3-540-10235-3.

[12] Mogens Nielsen, Gordon Plotkin & Glynn Winskel (1981): *Petri Nets, Event Structures and Domains, Part I*. Theoretical Computer Science 13(1), pp. 85–108, doi:10.1016/0304-3975(81)90112-2.

[13] Mogens Nielsen & P. S. Thiagarajan (2002): *Regular Event Structures and Finite Petri Nets: The Conflict-Free Case*. In Javier Esparza & Charles Lakos, editors: Applications and Theory of Petri Nets 2002, 23rd International Conference, ICATPN 2002, Adelaide, Australia, June 24-30, 2002, Proceedings, Lecture Notes in Computer Science 2360, Springer, pp. 335–351, doi:10.1007/3-540-48068-4_20.

[14] Emilio Tuosto & Roberto Guanciale (2018): *Semantics of global view of choreographies*. J. Log. Algebraic Methods Program. 95, pp. 17–40, doi:10.1016/j.jlamp.2017.11.002.