<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta>
      <journal-title-group>
        <journal-title>Italian Conference on Theoretical Computer Science, September</journal-title>
      </journal-title-group>
    </journal-meta>
    <article-meta>
      <title-group>
        <article-title>Omission Failures in Choreographic Programming</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Eva Graversen</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Fabrizio Montesi</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Marco Peressotti</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Tallinn University of Technology</institution>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>University of Southern Denmark</institution>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2025</year>
      </pub-date>
      <volume>1</volume>
      <fpage>0</fpage>
      <lpage>12</lpage>
      <abstract>
        <p>Choreographic programming promises a simple approach to concurrent and distributed programming: write the collective communication behaviour of a system of processes as a choreography, and then the programs for these processes are automatically compiled through a provably-correct procedure known as endpoint projection. While this promise prompted substantial research, a theory that can deal with realistic communication failures in a distributed network remains elusive. In this work, we provide the first theory of choreographic programming that addresses realistic communication failures taken from the literature of distributed systems: processes can send or receive fewer messages than they should (send and receive omission), and the network can fail at transporting messages (omission failure). Our theory supports the programming of strategies for failure recovery and is expressive enough to capture diferent communication patterns that usually required ad-hoc choreographic primitives and realistic protocols like two-phase commit.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>
        In the paradigm of choreographic programming [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ], programs express coordination plans for
communicating processes as compositions of high-level communication primitives inspired by security protocol
notation [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]. In particular, the choreographic primitive p. → q. reads ‘process p communicates the
evaluation of expression  to process q, which stores it in its variable ’.
      </p>
      <p>
        Key to choreographic programming is the notion of endpoint projection (EPP), a procedure for
compiling choreographies into distributed implementations in terms of appropriate send and receive
actions [
        <xref ref-type="bibr" rid="ref3 ref4">3, 4</xref>
        ]. EPP provides an escape from the challenge of separately writing compatible process
programs, which is notoriously hard even for expert developers [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]. This motivated a number of theoretical
investigations and implementations, including a full-fledged object-oriented choreographic
programming language that extends Java [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ], libraries for Haskell [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] and Rust [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ], several mechanisations [
        <xref ref-type="bibr" rid="ref10 ref11 ref12 ref9">9–12</xref>
        ],
and the correct implementation of distributed cryptographic applications [
        <xref ref-type="bibr" rid="ref13">13, 14</xref>
        ].
      </p>
      <p>
        Despite all the recent interest in choreographic programming and neighbouring approaches, like
multiparty session types [
        <xref ref-type="bibr" rid="ref14">15</xref>
        ], the theories presented so far rely on strong assumptions about communication
actions. Most works just assume that communications never fail. Others allow for some communications
or processes to fail, but with limitations. For example, they might assume synchronous communication
to detect link failures [
        <xref ref-type="bibr" rid="ref15">16</xref>
        ], that some processes can never crash, that failures are permanent (crash,
fail-stop), or reliable FIFO communications [
        <xref ref-type="bibr" rid="ref16">17</xref>
        ]. These limitations obscure the applicability of these
approaches to the programming of protocols that designed to deal with realistic communication failures
(like two-phase commit, or 2PC), without assuming costly middleware that masks these failures.
      </p>
      <p>
        To meet this need, in this work we present a new theory of choreographic programming: Lossy
Choreographies (LC). LC is the first choreographic programming theory that can deal with realistic
communication failures from the literature of distributed systems: processes can send or receive fewer
messages than they should – send and receive omission [
        <xref ref-type="bibr" rid="ref17 ref18">18, 19</xref>
        ] – and the network can fail at transporting
messages – omission failure [
        <xref ref-type="bibr" rid="ref19">20</xref>
        ]. Our only assumptions are that messages do not get corrupted and
participants are not malicious, i.e., they run the code projected from the choreography.
      </p>
      <p>The key technical challenge in developing LC lies in designing its syntax and semantics, because we
need to equip programmers with the ability to program recovery strategies for failures. These strategies
can be asymmetric, e.g., the sender of a message might use exponential backof while the intended
receiver a timeout. This calls for deconstructing the syntax and semantics of the usual choreographic
communication primitive to allow for independent implementations and executions of the send and
receive sides. However, at the same time, we need to retain the high-level view of choreographies on
what communications and computations the programmer wants to take place.</p>
      <p>LC ofers a simple solution by introducing a notion of frames to choreographic programming.
Specifically, we declare the intent to communicate a message of type T from p to q by writing
(, ′)T : p → q,which creates the frames  at p and ′ at q. Intuitively, the frame  is a promise that p
will send a value of type T for this particular communication, and dually ′ is a future where q can try
to receive that value. Frames can then be used separately at the two processes in their own strategies for
performing their respective obligations (sending or receiving). For example, p could use a procedure with
exponential backof and q one with a timeout, written as sendExpBackoff(p; ); recvTimeout(q; ′).
Leveraging this design and the high-level view of choreographic programming, LC enables processes to
interleave the handling of multiple frames, each with its own recovery strategy. LC is thus expressive
enough to capture diferent communication patterns that usually required ad-hoc choreographic
primitives like scatter and to model realistic protocols like 2PC. Indeed, we will show that LC can serve as a
general model where such primitives can be reconstructed as syntactic sugar.</p>
      <p>
        Structure and contributions We introduce Lossy Choreographies in Section 2 and give some
examples of protocols modelled in this language in Section 3. In Section 4 we equip LC with a type
system and show that well-typed choreographies enjoy progress. In Section 5 we present a language for
local processes and endpoint projection for compiling choreographies to processes. Finally, we compare
our development to related work in Section 6 and conclude in Section 7. In the accompanying technical
report [
        <xref ref-type="bibr" rid="ref20">21</xref>
        ], we provide the full technical details of LC and further proofs of its adequacy: (i) a static
analysis for verifying delivery guarantees on frames (at-most-once and exactly-once, depending on
which omissions can take place) and (ii) an implementation given as a library for programming recovery
strategies in Choral [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ], a state-of-the-art choreographic programming language that compiles to Java.
      </p>
    </sec>
    <sec id="sec-2">
      <title>2. Lossy Choreographies</title>
      <sec id="sec-2-1">
        <title>Syntax</title>
        <p>The language of Lossy Choreographies (LC) is defined by the following grammar.</p>
        <p>::= ;  | 0  ::=  |   ::=  | ! | ? | ?  ::=  | (p, )
#» #»
 ::= (, ′)T : p → q | p.! | p.? | p. :=  | if p. then 1 else 2 | ⟨ p ;  ⟩
A choreography  is a sequence of instructions () ending in 0. Term (, ′)T : p → q declares a
communication of a message of type T from p to q, binding the frame names  for the sender and ′
for the receiver to the continuation — for simplicity we assume the Barendregt convention replacing
bound names as needed. When this declaration is executed, frame names are substituted with pairs –
(q, ) – that contain the name of the other process in the communication (q) and a natural number ()
called frame number that identifies this specific communication from p to q.1 Communications are then
implemented with send terms like p.! (read ‘p sends  on frame ’) and receive terms like q.′? (read
‘q receives a message on ′ and stores it in ’). These actions may fail, as we will show in our semantics.</p>
        <p>
          Following standard practice from choreographic programming and session types, we syntactically
distinguish when a process sends the result of a local expression () or a statically-defined literal ( ,
also known as selection labels) [
          <xref ref-type="bibr" rid="ref14 ref4">4, 15</xref>
          ]. We leave the language of local expressions as a parameter of
our theory, as in other choreographic languages [
          <xref ref-type="bibr" rid="ref11 ref3 ref4 ref9">3, 4, 9, 11</xref>
          ]. Selection labels make the development
of endpoint projection clearer, because it streamlines detecting whether all processes involved in a
conditional communicate suficient information about which branch has been chosen [
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]. This standard
solution adapts to our setting without major changes.
        </p>
        <sec id="sec-2-1-1">
          <title>1Frame numbers are inspired by the sequence numbers found TCP.</title>
          <p>
            In the local assignment term p. := , p assigns its local variable  the value of local computation
. In a conditional if p. then 1 else 2, p evaluates the guard  and chooses between the possible
continuations 1 and 2 accordingly. Guards can be of four forms: ! evaluates to true if the last
send attempt for  was successful and to false otherwise; ? behaves like ? but for receive attempts;
? behaves like ? but additionally checks that the received values is the label ; and  evaluates
#»
according to the semantics of the language of local expressions. Term ⟨ p ; #»⟩ invokes procedure 
with arguments #p» and #». Procedures are defined by providing equations as usual in process calculi [
            <xref ref-type="bibr" rid="ref21">22</xref>
            ].
Example 1. We formalise the procedures sendExpBackoff and recvTimeout from the introduction as a
family of procedures indexed by the expression at the sender () and the variable at the receiver (). We
use some auxiliary variables to store the number of send attempts () and the timeout ().
1 sendExpBackoff(p; ):
2 p.!; //Try sending
3 if ¬p.! then //Check whether send has succeeded
4 p. := waitAndReturn(); //Wait 2 milliseconds and return  + 1
5 sendExpBackoff⟨p; ⟩ //Call procedure recursively
6 else 0 //If send is successful, finish
1 recvTimeout(p; ):
2 p. := currentTime();
3 p.?; //Try receiving
4 p. :=  − (currentTime() − );
5 if p. &gt; 0 ∧ ¬p.? then //Check whether receive has succeeded or time has elapsed
6 recvTimeout⟨; ⟩ //Call procedure recursively
7 else 0 //If receive is successful or the time has elapsed, finish
Using these procedures, we can define as syntactic sugar a communication primitive with a timeout
that recovers the usual simplicity of choreographic syntax. Below, p. →T q. is a communication of
p. (of type T) to q. with timeout .
          </p>
          <p>(, ′)T : p → q; p. := 0; sendExpBackoff⟨p; ⟩; q. := ; recvTimeout⟨p; ⟩; 0</p>
          <p>LC is expressive enough to capture other strategies as syntactic sugar, including acknowledgements
and compensations (custom code triggered in case of failure). Examples are given in Section 3.
Semantics We give the semantics for LC in terms of a labelled transition system (LTS). The states of
this system are triples of the form ⟨, Σ, ⟩ called configurations comprised by a choreography  (a
term in LC extended with two runtime terms discussed later), a choreographic store Σ modelling the
processes memory, and a communication transit  modelling messages in transit over the network.</p>
          <p>
            A choreographic store Σ is a map from process names to their local memory stores ranged over by  ,
similarly to several previous theories [
            <xref ref-type="bibr" rid="ref22 ref23 ref24 ref3 ref4 ref9">3, 4, 9, 23–25</xref>
            ]. We write Σ(p.) =  to denote that Σ(p) = 
such that  () = , read ‘variable  at process p has value ’. Diferently from prior work, we reserve
two locations (fc,fb) to store data that processes use for implementing frames. The reserved location fc
stores counters used by the current process to generate frame identifiers, one for each other process:
Σ(p.fc.q) is the counter at p used for frames from/to q. The reserved location fb tracks the state of
frames used by the current process. We write Σ(p.fb.q.) for the state of the frame that p uses for
sending or receiving a message to q with identifier . This state can take diferent values: (1) it is
⊥ when the frame is first created, (2) it is ✓, when the frame is outgoing and the frame has been
successfully handed over to the network, (3) it is  when the frame is incoming and the network has
delivered the value  for this frame but the process has not consumed it yet, and (4) it is ✓ when the
value has been finally read by the process. Frame counters and identifiers are similar to the device
used in TCP to correlate asynchronous messages at sender and receiver. The idea is that: (1) each
process maintains a counter for each other process it interacts with; (2) frame declarations increment
Σ(p) ⊢  ↓ 
⟨p. := ; , Σ, ⟩− →−
          </p>
          <p>⟨, Σ[p. ↦→ ], ⟩
Σ(p.fc.q) =  Σ′ = Σ[p.fc.q ↦→  + 1][p.fb.q. ↦→ ⊥ CFrame
]
⟨p.(q, )T; , Σ, ⟩− →−
⟨p.(q, )T; q.(p, ′)T; , Σ, ⟩→−
  ⟨[(q, )/], Σ′, ⟩</p>
          <p>⟨(, ′)T : p → q; , Σ, ⟩→−  ⟨′, Σ′, ⟩</p>
          <p>Σ(p) ⊢  ↓ 
⟨p.(q, )!; , Σ, →−−− ⟩−− −</p>
          <p>⟨, Σ[p.fb.q. ↦→ ✓],  ⊎ (p, q, , )⟩
#» #»
⟨⟨ p ;  ⟩; ′, Σ, ⟩→−−
#»</p>
          <p>#» #»
⟨if p. then 1 else 2; , Σ, ⟩− →−−
⟨if p. then 1 else 2; , Σ, →−⟩−− −
Σ(p) ⊢  ↓ true
Σ(p) ⊢  ↓ false
( p ;  ):  ∈</p>
          <p>r ∈ p
#»</p>
          <p>#»
#»
#»
#»
r ∈ q
#»
#»
q ∖ r ̸= ∅
#»
 ⟨1 # , Σ, ⟩
#»
 ⟨2 # , Σ, ⟩
#» #»</p>
          <p>#» #»
#» #»</p>
          <p>CThen
CElse</p>
          <p>CEnter
 ⟨ p ∖ r : [ p ;  ].′; [ p / q ][  /  ] # ′, Σ, ⟩</p>
          <p>CSend
CRecv</p>
          <p>CCall
⟨p.(q, )!; , Σ, →−−− ⟩−− −</p>
          <p>⟨, Σ, ⟩
⟨p.(q, )?; , Σ, →−−− ⟩−− −
Σ(p) ⊢  ↓ 
⟨, Σ,  ⊎ (p, q, , )→⟩−   ⟨, Σ[q.fb.p. ↦→ ], ⟩
⟨, Σ,  ⊎ (p, q, , )→⟩−   ⟨, Σ, ⟩
⟨1, Σ, ⟩→−  ⟨1′, Σ′, ′⟩</p>
          <p>⟨2, Σ, ⟩→− 
 ⟨2′, Σ′, ′⟩
p ∈/ pn( )</p>
          <p>CDelayC
CFinish
⟨, Σ, ⟩→−
 ⟨′, Σ′, ′⟩</p>
          <p>pn() ∩ pn( ) = ∅ CDelayI

⟨; , Σ, ⟩→−  ⟨; ′, Σ′, ′⟩
⟨if p. then 1 else 2; , Σ, ⟩→−  ⟨if p. then 1′ else 2′; , Σ′, ′⟩
⟨ q :[ p ;  ].′; , Σ, ⟩→−−</p>
          <p>⟨ q ∖ r : [ p ;  ].′; , Σ, ⟩
counters locally, i.e., without synchronising with the other party; (3) frames are assigned the value
held by the corresponding counter when they are created. Our semantics ensures that frame counters
remain consistent through the execution of a choreography and so it sufices to agree on an initial value
— we formalise this property after we present the semantics (Definition 1).</p>
          <p>The network and the messages transiting on it are modelled by a communication transit : a multiset
of messages that have been successfully handed over to the network from the sender, but have not
been delivered to the receiver. Each message has the form (p, q, , ) where p is the sender, q is the
receiver,  is the frame number, and  is the payload.  may contain messages with the same sender,
receiver, and frame number but diferent payloads e.g., when a sender makes multiple attempts updating
a timestamp or counter in the payload each time and these are still in transit. The defining  as a
multiset, we model a network without any ordering guarantee.</p>
          <p>#»</p>
          <p>The transition relation of the LTS is giv#»en by the SOS specification in Figure 1 and it is p#»arameterised
on a set  of procedure definitions ( p ;  ):  where  is the procedure name, p and  are its formal
parameters for process and frame names, the choreography  (free from runtime terms) is its body.
#»</p>
          <p>In the remainder, we write pn() and and pn( ) for the set of process names that appear in the
choreography  and the label  , respectively.</p>
          <p>
            Rule CAssign models local assignments and is standard: the update notation Σ[p. ↦→ ] denotes a
choreographic store such that (Σ[p. ↦→ ])(p.) =  and behaves like Σ otherwise [
            <xref ref-type="bibr" rid="ref4">4</xref>
            ]. The premise
Σ(p) ⊢  ↓  states that the evaluation of  in the process store Σ(p) yields value  – the definition
of this relation on local expressions () is a parameter of the theory (evaluation may be partial or
nondeterministic) whereas on labels it is assumed as Σ(p) ⊢  ↓ .
          </p>
          <p>Rules CCom and CFrame model the creation of a pair of frames for a communication from p to q
without relying on any rendezvous mechanism. Instead, these rules rely on the runtime term p.(q, )T
to represent the creation of a frame to/from q at p: in rule CFrame, p.(q, )T is consumed, the frame 
is assigned a number , its state is initialised to ⊥, and the frame counter for q is incremented; and in
rule CCom, the semantics of (, ′)T : p → q is essentially defined as that of p.(q, )T; q.(p, ′)T. The
order of the runtime terms in the premise of rule CCom is immaterial since the semantics allows these
to be executed in any order via rule CDelayI (explained below).</p>
          <p>Rules CSend and CSendFail capture the possible executions of a send attempt for a frame (q, ) at
p. The first, Rule CSend models a successful send: a payload  is computed and the message (p, q, , )
is successfully handed of to the communication transit ( ). It also updates the frame state at the sender
accordingly. Rule CSendFail, instead, models a send omission failure: the send action is consumed
but it omits (fails at) adding the message to . In both cases, no information about the attempt is
propagated to the receiver: our semantics is asynchronous and the only way to exchange information
across processes is through fallible communication actions and a lossy . Note that rule CSend does
not check the state of the frame and that the new one is added to  with a multiset union (⊎), to reflect
the real-world situation that a sender may perform multiple send actions resulting in the transmission
of multiple messages (regardless of diferences for the payload ) for the same frame.</p>
          <p>Once a message is in transit, there are two possibilities: It can either be successfully delivered to the
receiver, which causes a corresponding update to its frame state (rule CDel), or it can incur an omission
failure and be lost (rule CLoss). The sender has no knowledge of what happens.</p>
          <p>Rules CRecv and CRecvFail model a receive attempt. The attempt can be successful (CRecv) only if
the receiver’s state for the desired frame contains a value (previously put there by rule CDel). Otherwise,
if no message for that frame has reached the receiver yet, the receive attempt fails (rule CRecvFail).</p>
          <p>Rules CThen and CElse model conditionals. The evaluation of guards on frames is as follows:
Σ(p.fb.q.) = ✓
Σ(p) ⊢ (q, )? ↓ true
Σ(p.fb.q.) ̸= ✓
Σ(p) ⊢ (q, )? ↓ false</p>
          <p>Σ(p.fb.q.) = ✓
Σ(p) ⊢ (q, )! ↓ true</p>
          <p>Σ(p.fb.q.) ̸= ✓
Σ(p) ⊢ (q, )! ↓ false</p>
          <p>Σ(p.fb.q.) = ✓
Σ(p) ⊢ (q, )? ↓ true</p>
          <p>
            Σ(p.fb.q.) ̸= ✓
Σ(p) ⊢ (q, )? ↓ false
We use a meta-operator for sequential composition of choreographies ‘#’ [
            <xref ref-type="bibr" rid="ref25 ref4">4, 26</xref>
            ] which replaces 0 in a
choreography with another choreography (0 #  ≜  and (; ) # ′ ≜ ; ( # ′)).
          </p>
          <p>
            Remaining rules are standard for the theory of choreographic languages [
            <xref ref-type="bibr" rid="ref4">4</xref>
            ]. Rules CCall, CEnter
and CFinish model a decentralised call to a choreographic procedure (i.e., without synchronising the
#» #» #»
processes that enter the procedure). These rules rely on the runtime term q :[ p ;  ].′ to track which
processes have not joined the call ( #q») and thus cannot perform any action from#»its continuation via the
#»
delay rules. Rule CCall unfolds  with its body where formal arguments ( q ;  ) are instantiated with
#»
the actual ones p ; #» (parameters are positional). Rules CEnter and CFinish update and remove the
runtime term as the remaining processes join the call. Rules CDelayI and CDelayC model that actions
performed by distinct processes are executed concurrently by delaying the execution of a term.
          </p>
          <p>With the language fully defined, we formalise the property that frame states, counters, and runtime
terms are consistent across a choreography and store.</p>
          <p>Definition 1. Σ is consistent with  if, for any two p and q in : (1) Σ(p.fb.q.) is defined for any
 &lt; Σ(p.fc.q); and (2) |qp()| = max(0, Σ(p.fc.q) − Σ(q.fc.p)) where the (partial) function qp
computes the set of frame names to q that p has yet to initialise as follows.</p>
          <p>qp(0) ≜ ∅</p>
          <p>qp(; ) ≜ qp() ∪ qp() where pq() ∩ qp() = ∅
qp(p.(q, )T) ≜ {}</p>
          <p>qp(if p. then 1 else 2) ≜ qp(1) where pq(1) = qp(2)
qp() = ∅ for  ∈/ {p.(q, )T, if p. then 1 else 2}
Σ′ = Σ[p.fb.q.1 ↦→ ✓]
Σ(p.fb.q.1) = Σ(p.fb.q.1) = ⊥</p>
          <p>(a)</p>
          <p>CRecv
CDel
⟩
⟨
(c)
CSend
⟨
⟨
(b)
(h)
CDel</p>
          <p>q.(p, 1)?; 0, ⟩
Σ[p.fb.q.1 ↦→ ✓],
{(p, q, 1, 3)}</p>
          <p>0,
Σ[p.fb.q.1 ↦→ ✓],
{(p, q, 1, 3)}</p>
          <p>⟩
CRecvFail</p>
          <p>q.(p, 1)?; 0, ⟩
Σ′[q.fb.p.1 ↦→ 3],</p>
          <p>∅
CLoss
(i)
CLoss
⟨ q.(p, 1)?; 0,⟩
(j)
Σ′,
∅
⟨ 0, ⟩
Σ′,
∅</p>
          <p>Note that the function qp is partial and rejects choreographies that misuse runtime terms for frame
creation e.g., the condition on the case ;  excludes repetitions of runtime terms for the same .</p>
          <p>Proposition 1. If ⟨, Σ, →⟩−  ⟨′, Σ′, ′⟩ and Σ is consistent with , then Σ′ is consistent with ′.</p>
        </sec>
      </sec>
      <sec id="sec-2-2">
        <title>Understanding failures</title>
        <p>We illustrate the realism of our model wrt communication failures with
a simple end-to-end communication. Consider the choreography p.(q, 1)!3; q.(p, 1)?; 0 where p
attempts to communicate the number 3 to q; the LTS in Figure 2 captures all the possible executions for
this program. For convenience of exposition, we assign a letter to each state. Also, we do not show
transition labels but rather the name of the rule applied to derive the transition – the transition from (a)
to (e) is the only one that also requires rule CDelayI.</p>
        <p>Every run of the program begins in state (a) and eventually terminates reaching 0. We describe the
diferent situations at the ends of the possible executions.</p>
        <p>(d) This is the final state of the only successful execution: the value 3 is marked as delivered and no
transition from (a) to (d) uses any of the rules that model send, receive, and omission failures.
(g) This state is reached if we have both a send and a receive omissions. In the path via (f), a send
omission stops the receive from ever succeeding. In the path via (e), we have a receive omission
because the receive is attempted before the send action had a chance to put the message in the
network. The latter case exemplifies how our semantics captures timeouts at the receiver. In fact,
(e) may transition to (h) failing because of timing, as this is before the successful transit.
(j) This state is reached because of an omission failure. In the path via (i), the omission failure causes
the receive to fail. In the path via (e), the receive fails regardless of the omission because of timing.
(k) This state is reached if the send succeeds but the receive fails because of timing issues: in the
path through (e), the receive is executed before the send; in the path through (b), the receive is
executed before the network could carry the message to the receiver.</p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>3. Applications</title>
      <sec id="sec-3-1">
        <title>Acknowledgements</title>
        <p>Assume a setting with omission failure (rule CLoss). In this setting, the
definition of p. →T q. presented in Example 1 risks ending up in a state where the sender believes
it has completed a communication but the receiver has timed out due to the message being lost by
the network. This is a common problem in practice, which is addressed by switching to “best-efort”
strategies where delivery is possible (to varying degrees) but not certain.</p>
        <p>The procedure below implements a simple communication protocol with capped retries and
acknowledgements to the sender. In this, the strategy use by comACK, can be regarded as a simplification of
that of TCP; four-phase handshakes or other protocols are implementable in LC as well.
1 comACK,(s, r):
2 (, ′)T : s → r; //Create new frame for this communication
3 (′, )Unit : r → s; //Create new frame for the acknowledgement
4 sendExpBackoff(s; ); //Send
5 recvTimeout(r; ′); //Receive
6 sendExpBackoff(r; ′</p>
        <p>); //Send acknowledgement
7 sendUntilACK,(s; , ); //Call send procedure
8 sendUntilACK,(s; , ):
9 recvTimeout(s; ); //Try receiving acknowledgement
10 if s.( &gt; 0) ∧ ¬s.? then //Check number of attempts and received acknowledgement
11 s. :=  − 1; //Update send attempt number
12 sendExpBackoff(s; ); //Make another attempt at sending
13 sendUntilACK,(s; , ); //Repeat
14 else 0 //When acknowledgement has been received or we run out of attempts, end.</p>
        <p>
          Compensations With comACK, we can also use LC to develop a new variant of choreographies
that does not assume reliable transmission, i.e., when we are in a setting with omission failures. In
this setting, a common pattern to deal with failures of best-efort communications are compensations.
Fault compensations can be defined in LC (for both settings with and without omission failures) using
conditionals, comACK, (or variations thereof), and some syntax sugar to improve readability. An
expression s. ⇒ r.{s}{r} is a communication as in comACK,(s, r) where choreographies s
and r are executed as compensations for faults detected by the sender s (no ack) or the receiver r,
respectively. An example of communications with fault compensations is the communication construct
defined in [
          <xref ref-type="bibr" rid="ref15">16</xref>
          ] where communication operations specify default values as compensations; this is
recovered in LC using local computations as, e.g., in s. ⇒ r.{s. := foo}{r. := 42}.
Any/Many communications We can also implement more complex communication primitives, like
those in [
          <xref ref-type="bibr" rid="ref26 ref27">27, 28</xref>
          ]. Below are procedures that iteratively attempt at sending some frames until the sender
stack accepts all or any of them, respectively, using a round-robin strategy.
        </p>
        <p>
          1 sendAll,(s; 1, . . . , ):
2 s.!; //Send to the last frame in the list
3 if s.! then //Check if send was successful
4 sendAll− 1,(s; 1, . . . , − 1) //Send to the remaining frames
5 else sendAll,(s; 2, . . . , , 1) //Otherwise, try this frame again later
1 sendAny,(s; 1, . . . , ):
2 s.1!; //Send to the first frame in the list
3 if ¬s.1! then //Check if send was unsuccessful
4 sendAny,(s; 2, . . . , , 1) //Retry cycling through the frames
5 else 0 //End function if the send succeeded
We omit the dual procedures for receiving all or some frames, which are similarly defined. Combining
these it is possible to implement scatter/gather communication primitives from [
          <xref ref-type="bibr" rid="ref26">27</xref>
          ].
1 scatter,(s, r1, . . . , r; ∅):
2 (1, 1′)T : s → r1; . . . (, ′)T : s → rn; //Create frames
3 sendAll(s; 1, . . . , ); //Call send all on the new frames
4 recvTimeout(r1; 1′); . . . recvTimeout(r; ′) //Each receiver receives on its frame.
        </p>
        <p>
          Two-phase commit LC can be used to implement common protocols for dealing with failures. The
two-phase commit protocol [
          <xref ref-type="bibr" rid="ref28">29</xref>
          ] is a protocol for getting a set of participants to agree to either commit
or abort their local transaction thus providing a mechanism for distributed transactions in presence of
unreliable communication. Each participant sends the controller a vote to commit or a veto for aborting
the transaction. The controller tallies all the votes and decides to globally commit if all are in favour
(a missing vote is regarded as a veto) and to globally abort otherwise. The controller then sends its
decision to each participant, trying repeatedly to send until it receives an acknowledgement. Meanwhile
the participants wait for the decision before they commit or abort their local transaction acknowledging
the outcome to the controller. We base our code on the version of the protocol presented in [
          <xref ref-type="bibr" rid="ref28">29</xref>
          ].
1 2PhaseCommit(c, p1, . . . , pn; ):
432 (((111,,, ′′′111)))BBUoonooitll ::: ppc11→→→pcc1;;; ... ... ... ;;; (((,,, ′′′)))BUBonooiotll::: ppcnn→→→pccn;;; //////FFFrrraaammmeeesssfffooorrravdcoektcenissoiwonledgements
5 c.1 :=  ; . . . ; c. :=  ; //All votes start out false at c
6 p1.1 !vote(); . . . ; pn. !vote(); //Participants send votes
7 c.′1 ?1; . . . ; c.′ ?; //Controller receives votes (they remain false if receive fails)
8 c. := 1 ∧ · · · ∧ ; //Decision on whether to commit is made - only if all voted yes
9 sendAllUntilAck(c; 1 , . . . ,  , ′1 , . . . , ′ ); //c sends the decision
10 recvDec(p1; ′1 , 1 ); . . . ; recvDec(pn; ′ ,  ) //ps receive decisions
11 sendAllUntilAck(c; 1, . . . ,  , 1 , . . . ,  ):
12 c. !; //c sends the decision to a participant
13 c. ?; //c receives acknowledgement from that participant
14 if  ? then //If the acknowledgement was received
15 sendAllUntilAck− 1(c; 1 , . . . , − 1 , 1 , . . . , − 1 ) //Send to other participants
16 else sendAllUntilAck(c; 2 , . . . ,  , 1 , 2 , . . . ,  , 1 ) //Try again later
17 recvDec(p; , ):
18 p.?; //Try receiving the decision
19 if p.? then //If receive was successful
20 if p. then p. := commit()
21 else p. := abort()
22 sendExpBackoff(p, ) //Keep sending acknowledgement until successful
23 else recvDec(p; , ) //If receive decision was unsuccessful, try again
        </p>
        <p>Note that sendAllUntilAck is a combination of sendAll and sendUntilAck without the check on
the number of send attempts; we omitted this for brevity but it could easily be reintroduced if one is
concerned about c being blocked by a lost acknowledgement.</p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>4. Typing</title>
      <p>LC programs can get stuck if procedures are called on wrong arguments, communication actions are
performed against the wrong frames or processes, and guards of conditionals are not of the expected
type. We introduce a type system for LC that rejects this kind of programs and ensures progress.</p>
      <p>Type judgements are of the form Γ ⊢  where Γ is an environment for tracking the types of
choreographic procedures, frames and the local memory.</p>
      <p>#» # »
Γ := ⟨ p ;  : T⟩ | p. :  | p. : T  := !T | ?T
Γ, p. : !T, q.′ : ?T ⊢  TCom
Γ ⊢ (, ′)T : p → q; 
Γ(p.) ∈ {!T, ?T} Γ ⊢ 
Γ ⊢ p.(q, )T;</p>
      <p>TFrame
Γ(p.) = !T
Γ(p) ⊢  : T Γ ⊢</p>
      <p>TSend
Γ(p.) = ?T</p>
      <p>Γ(p.) = T Γ ⊢  TRecv
Γ ⊢ p.!; 
Γ ⊢ p.?;</p>
      <p>The frame types !T and ?T denote a frame that sends a payload of type T and one that receives a
payload of type T. We write Γ(p.) and Γ(p.) for the type of frame p. and of variable p., and Γ(p)
for the environment local to p. Just like we assumed a user-defined local language, we do the same for
guards about frame status (!, ?, ?) as one would expect (see [21, §4] for details).
the local type system, which we assume has local judgements Γ(p) ⊢  : T extended to account for</p>
      <p>For the most part, these rules are fairly intuitive. We report a selection of illustrative derivation rules
of the type system in Figure 3, the full system is available in the report [21, §4]. Rule TCom adds both
ends of the frame to the environment with the expected send and receive types and rule TFrame checks
that the runtime term for frame creation refers to a frame in the environment.2 Rules TSend and TRecv
check that the type of the frame matches the type of the payload and the variable it gets stored on.
Definition 2.</p>
      <p>We say that a configuration</p>
      <p>⟨, Σ, ⟩ is well-typed if there is a type environment
Γ(q.(p, )) = ?T, and ⊢  : T for any (p, q, , ) ∈ ; (4) Σ is consistent with .
Γ such that (1) Γ ⊢ ; (2) Γ ⊢ Σ(p.) : Γ(p.) for any variable p. ∈ Σ; (3) Γ(p.(q, )) = !T,</p>
      <p>Our type system enjoys typability preservation: if a configuration is well-typed then so is any
configuration that can be reached from it.</p>
      <p>Proposition 2 (Typability Preservation). Given a well-typed configuration ⟨, Σ, ⟩ and set of procedure
definitions , if ⟨, Σ, →⟩−  ⟨′, Σ′, ′⟩, then ⟨′, Σ′, ′⟩ is also well-typed.</p>
      <p>Well-typed configurations enjoy progress: they either do an action or their choreography is 0.
Theorem 1 (Progress). Given a well-typed ⟨, Σ, ⟩ and ,  = 0 or ⟨, Σ, →⟩−  ⟨′, Σ′, ′⟩.</p>
    </sec>
    <sec id="sec-5">
      <title>5. Compilation to Process Implementations</title>
      <p>We present an EndPoint Projection (EPP) procedure that compiles a choreography to a concurrent
implementation in terms of a process calculus, which assumes the same failure model as in LC.</p>
      <sec id="sec-5-1">
        <title>Lossy Processes</title>
        <p>
          The target process language, Lossy Processes, is based on Recursive Processes –
the textbook target for choreography projection [
          <xref ref-type="bibr" rid="ref4">4</xref>
          ]. We extend the semantics so that (i) send and
receive operations may fail and (ii) messages are tagged with numeric (frame) identifiers. Numeric
frame identifiers act as message sequence numbers. However, the model does not ofer any
mechanism for maintaining counters synchronised among connected processes nor can such mechanism be
programmed since these counters are inaccessible. The only way to maintain synchrony is to write
programs where frame declarations are carefully matched at communicating process. In the next section
we leverage the fact that processes projected from a choreography enjoy this by construction.
        </p>
        <p>The next grammar allows for writing process programs, or behaviours ().</p>
        <p>::= ;  | 0
 ::=  | 
 ::=  | 
 ::=  | (p, )
 ::= (p, ) | ! | ? |  :=  | if  then 1 else 2 | &amp;{1 : }∈ | ⟨ p ;  ⟩
#» #»
2For conciseness, neither rule check for misuses of runtime terms like p.(q, )T; p.(q, )T or (, ′)T : p → q; p.(q, )T as
these are already excluded by Definition 1; these checks amount to adding the premises  ∈/ qp() and ′ ∈/ pq().
⟨p[(q, )?; ], Σ, →−−− ⟩−− −</p>
        <p>⟨, Σ, ⟩→−  ℬ ⟨ ′, Σ′, ′⟩
⟨ | , Σ, ⟩→− ℬ ⟨ ′ | , Σ′, ′⟩</p>
        <p>Term (p, ) represent the creation of a new frame. Terms ! and ? express send and receive actions
for . Term &amp;{1 : }∈ describes a branching based on a label communicated for , if any label  has
been successfully received then, the process proceeds with the corresponding behaviour  otherwise
it proceeds with the one labelled with default which is reserved for this purpose and cannot be sent.
 has been successfully completed. Remaining terms are standard.</p>
        <p>If  = ∅, then the term is simply discarded. Guard  states that the last communication action for frame</p>
        <p>
          Borrowing notation from [
          <xref ref-type="bibr" rid="ref4">4</xref>
          ], a network (of processes)  is a map from process names to process
behaviours such that only finitely many are mapped to behaviours other than 0; the set of these processes
is called domain of the network. We write p[] for the network where process p has behaviour  and
every other process has behaviour 0. The parallel composition of two networks  and  ′ with disjoint
domains,  |  ′, simply assigns to each process its behaviour in the network defining it.
        </p>
        <p>The semantics of networks is given as an LTS. States are configurations ⟨, Σ, ⟩ where  is a
network and Σ and  are as in the LTS of LC. The transition relation uses the same labels of LC and is
which we discuss below—the remaining ones are standard and can be found in [21, §5].
parameterised in a set ℬ of procedure definitions. We report a selection of the core rules in Figure 4</p>
        <p>Rule PFrame models the creation at p of a new frame for q using the value  of the corresponding
counter. Rule PSend models the sending of a message  to frame (q, ), marking the frame as sent and
rule PSendFail models the case where the send fails. Dually, rules PRecv and PRecvFail model the
successful reception of a message from frame (q, ), marking the frame as received and storing in 
the received value , and the case where the receive fails, respectively. Rules NLoss and NDel model
the loss and delivery of messages by the network like rules CLoss and CDel.</p>
      </sec>
      <sec id="sec-5-2">
        <title>EndPoint Projection</title>
        <p>
          Given a choreography , the projected behaviour of process p in  is defined
as JKp where J− Kp is the partial function defined by structural recursion in Figure 5. Each case in the
definition follows the intuition of writing, for each choreographic term, the local actions performed
by the given process. For instance, p.! is skipped during the projection of any process but p, for
which the send action ! is produced. Cases for receiving, procedure calls, and frame creation are
similar. The projection of frame declaration expands it to two frame creation runtime terms similarly
to its semantics, ensuring that as long as the starting configuration is consistent, the frame counters
will remain synchronised for the entire execution. The case for conditionals combines the normal
conditionals and branching over labels selection but otherwise follows the standard approach (see
e.g., [
          <xref ref-type="bibr" rid="ref25 ref29 ref3 ref30 ref31 ref4">3, 4, 26, 30–32</xref>
          ]). The (partial) merging operator ⊔ from [
          <xref ref-type="bibr" rid="ref3">3</xref>
          ] is used to merge the behaviour of a
process that does not know (yet) which branch has been chosen by the the process evaluating the guard.
Intuitively,  ⊔ ′ behaves as  and ′ up to branching, where branches of  or ′ with distinct
q(, ′)T : p → q; yr ≜ qp.(q, )T; q.(p, ′)T; yr
qp.(q, )T; yr
        </p>
        <p>JKr
{︃(q, ); JKr if r = p</p>
        <p>else
Jp. := ; Kr ≜</p>
        <p>JKr
{︃ := ; JKr if r = p</p>
        <p>#» #»</p>
        <p>J⟨ p ;  ⟩; Kr ≜
else</p>
        <p>JKr
J #q»:[ p ;  ].′; Kr ≜
#» #»</p>
        <p>#» #» #» #»
{︃( p ∖ r;  ); J′Kr if r ∈ q and r = p []</p>
        <p>else
s if p. then 1 {
else 2; 
r
≜
⎪
⎪
⎩(J1Kr ⊔ J2Kr); JKr
⎪⎨(if  then J1Kr else J2Kr); JKr
⎪(if  then J1Kr else J2Kr); JKr
⎪
⎧(&amp;{ : J1Kr , default : J2Kr}); JKr if p. = r.?
⎪
if p. = r.
if p. = r.! or p. = r.?
else
Jp.!; Kr ≜
Jp.?; Kr ≜</p>
        <p>JKr</p>
        <p>J
Kr</p>
        <p>JKr
{︃!; JKr if r = p
{︃?; JKr if r = p
else
else
else</p>
        <p>J0Kr ≜ 0
#» #» #»
{︃( p ∖ r;  ); JKr if r = p []
labels are also included. One proceeds homomorphically (e.g., !;  ⊔ !; ′ is !; ( ⊔ ′)) on all
terms but branches which are handled defining the merge of &amp;{ : }∈ ;  and &amp;{ : ′ }∈ ; ′
as &amp;{ℎ : ℎ′′}ℎ∈ ; ( ⊔ ′) where {ℎ : ℎ′′}ℎ∈ is the union of { : }∈∖ , { : ′ }∈∖ , and
{ :  ⊔ ′}∈∩ . A choreography  is projected to JK ≜  p. JKp and procedure definitions as:
JK ≜ ⋃︀</p>
        <p>#»
(p1,...pn;  )=∈
⃒ }︁
{︁(p1, . . . , p− 1, p+1, . . . pn;  )JKp ⃒⃒ 1 ≤  ≤  .</p>
        <p>#»
Observe that since a procedure  may be called multiple times on any combination of its arguments it
is necessary to project the behaviour of each possible process parameter p as the procedure .</p>
        <p>
          There is an operational correspondence between choreographies and their projections, which we
can be formulated in the standard way up to the ‘branching’ relation ⊒ (the natural order induced by
merging i.e., 1 ⊒ 2 if 1 ⊔ 3 = 2 for some 3 [
          <xref ref-type="bibr" rid="ref4">4</xref>
          ]). This relation accounts for the well-known
fact in choreographic programming that, after a conditional is executed at the choreography level, some
processes get to know about the chosen branch only after a while (through selections) and thus have
temporary ‘dead code’ (branches that are never going to be selected) [4, Chapter 6].
Theorem 2 (EPP). Given a well-typed ⟨, Σ, ⟩ an d  such that JK and JK are defined, then:
        </p>
        <p>• If ⟨, Σ, →⟩−  ⟨′, Σ′, ′⟩ then J, Σ, →K−</p>
        <p>J K  such that J′K ⊒  .</p>
        <p>• If ⟨JK , Σ, →⟩− JK ⟨, Σ′, ′⟩, then ⟨, Σ, →⟩−  ⟨′, Σ′, ′⟩ such that J′K ⊒  .</p>
      </sec>
    </sec>
    <sec id="sec-6">
      <title>6. Related Work</title>
      <p>
        The work nearest to ours is [
        <xref ref-type="bibr" rid="ref15">16</xref>
        ], which extends multiparty session types (MPST) [
        <xref ref-type="bibr" rid="ref14">15</xref>
        ] – protocol
specifications without data or computation – with optional blocks that can become no-op non-deterministically.
While our initial motivation is similar, we address a diferent setting and see our work as complementary.
Our focus is providing guarantees on implementations, and thus choreographies in LC are concrete
programs, unlike protocol specifications. Another key diference is that communication in [
synchronous – both sender and receiver know if the communication failed – whereas in LC it is
asynchronous. This requires defining and analysing send and receive actions separately, as success in sending
does not guarantee success in receiving. This separation is is crucial for enabling diferent recovery
strategies for senders and receivers in LC whereas in [
        <xref ref-type="bibr" rid="ref15">16</xref>
        ] recovery strategies cannot be specified at all.
      </p>
      <p>
        Another extension of MPST focuses on process failures (instead of communication failures) [
        <xref ref-type="bibr" rid="ref16">17</xref>
        ].
Like LC and unlike [
        <xref ref-type="bibr" rid="ref15">16</xref>
        ], it supports asynchronous communication. However, it difers significantly
from LC by assuming some processes cannot fail and that communication between non-failed processes
is reliable. In contrast, LC allows messages to arrive in any order or not at all. The failure mode of [
        <xref ref-type="bibr" rid="ref16">17</xref>
        ]
lies between crash [
        <xref ref-type="bibr" rid="ref32">33</xref>
        ] and fail-stop [
        <xref ref-type="bibr" rid="ref33 ref34">34, 35</xref>
        ] modes, which impose stronger reliability assumptions
than to the omission modes of LC [
        <xref ref-type="bibr" rid="ref18 ref19">19, 20</xref>
        ]. Process failures can be encoded in LC, e.g., via internal
nondeterministic choices to proceed or shut down.
      </p>
      <p>
        In [
        <xref ref-type="bibr" rid="ref35">36</xref>
        ], MPST are augmented with controlled exceptions. These are diferent from communication
failures, because they are controlled by the programmer and their propagation is ensured through
communications that are assumed reliable. The same diference applies to a later refinement of this
approach [
        <xref ref-type="bibr" rid="ref36">37</xref>
        ] and a similar extension of session types to exception handling in a functional setting [
        <xref ref-type="bibr" rid="ref37">38</xref>
        ].
      </p>
      <p>
        A diferent approach to MPST with failures is seen in [
        <xref ref-type="bibr" rid="ref38">39</xref>
        ]. Like LC, they allow communication to
fail, but when this happens they kill the session where the failure occurred. Similarly to [
        <xref ref-type="bibr" rid="ref35">36</xref>
        ], this
mechanism for killing sessions assumes a reliable way to communicate failures between processes.
      </p>
      <p>
        In [
        <xref ref-type="bibr" rid="ref26">27</xref>
        ], the authors propose a choreographic language for programming systems where processes
are implemented as pools of redundant replicas that may and communicate via reliable multicast. No
recovery can be programmed, and there is no presentation of how the approach can be adopted in
realistic process models. Therefore, this approach is from from ours and and [
        <xref ref-type="bibr" rid="ref15">16</xref>
        ].
      </p>
      <p>
        Some work on choreographies include choice operators that behave nondeterministically, e.g.,  + ′,
read ‘run either  or ′’ [
        <xref ref-type="bibr" rid="ref14 ref3 ref30 ref39 ref4">3, 4, 15, 31, 40</xref>
        ]. These operators do not capture the failure modes we
are interested in for two reasons: they are explicitly programmed and thus predictable, and their
formalizations assume reliable propagation of choice information among processes.
      </p>
      <p>
        Our approach of recovering high-level choreographic constructs by wrapping lower-level
communication actions (as in Example 1) follows the practice established by Choral, the most expressive
implementation of choreographic programming to date [
        <xref ref-type="bibr" rid="ref40 ref6">6, 41</xref>
        ]. However, Choral does not come with a
formal semantics. LC thus ofers a useful theory to reason about recovery strategies before they are
implemented, which can be done through our accompanying implementation as a Choral library [
        <xref ref-type="bibr" rid="ref20">21</xref>
        ].
      </p>
      <p>
        Recent work explored how choreographic programming can be ofered as embedded domain-specific
languages in, for example, Haskell and Rust [
        <xref ref-type="bibr" rid="ref41 ref42 ref7 ref8">7, 8, 42, 43</xref>
        ]. Diferently from Choral, these languages
are based on interpretation rather than compilation. We think that our ideas are applicable also to
these languages, but it would require updating both the languages and their interpretation functions –
whereas our implementation does not require any change to Choral itself, it is ‘just a library’.
      </p>
      <p>
        Our new primitive for communication declaration is reminiscent of the ‘cut’ operator found in
sessiontyped process calculi for connecting two endpoints of a channel [
        <xref ref-type="bibr" rid="ref43 ref44 ref45 ref46">44–47</xref>
        ]. While there is a superficial
similarity in that both endpoints and our frames are created in pairs, endpoint pairs represent channels,
whereas frame pairs represent single communications. More importantly, the dynamic creation of
endpoints requires synchronisation, unlike our frames, which is crucial for our development due to
unreliable communication. Session types typically guarantee system-wide progress by restricting
communication structures or process topologies, whereas LC does not require such restrictions.
      </p>
    </sec>
    <sec id="sec-7">
      <title>7. Conclusion</title>
      <p>
        Choreographic programming has seen significant advancements over the past decade, but always under
the strong assumption of reliable communication [
        <xref ref-type="bibr" rid="ref1 ref11 ref22 ref23 ref24 ref4 ref47 ref48 ref49 ref50 ref6 ref7 ref8">1, 4, 6–8, 11, 23–25, 48–51</xref>
        ]. Our study frees the
paradigm from this assumption, reaching all the way to standard failure modes and realistic protocols.
      </p>
      <p>Our work covers all failure modes with honest participants. A natural next step is therefore to
investigate Byzantine failures modes where participants may act maliciously. Exploring this direction
would touch on a realm where possible guarantees are more limited. Therefore, it would be interesting
and challenging to understand how close choreographic programming can be brought to the theoretical
limit. Another interesting direction is to explore a quantitative semantics of Lossy Choreographies. For
instance, in a probabilistic settings, failures are characterised by probability distributions. This would
enable reasoning about aspects such as quality of service, throughput, probability of critical failure, etc.</p>
    </sec>
    <sec id="sec-8">
      <title>Acknowledgments</title>
      <p>Partially supported by Villum Fonden (grant no. 29518), and by the Ministry of Education and Research
Centres of Excellence grant TK213 Estonian Centre of Excellence in Artificial Intelligence (EXAI).
Cofunded by the European Union (ERC, CHORDS, 101124225). Views and opinions expressed are however
those of the authors only and do not necessarily reflect those of the European Union or the European
Research Council. Neither the European Union nor the granting authority can be held responsible for
them.</p>
    </sec>
    <sec id="sec-9">
      <title>Declaration on Generative AI</title>
      <sec id="sec-9-1">
        <title>The author(s) have not employed any Generative AI tools.</title>
        <p>04131. doi:10.48550/ARXIV.2401.04131. arXiv:2401.04131.</p>
      </sec>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>F.</given-names>
            <surname>Montesi</surname>
          </string-name>
          , Choreographic Programming,
          <source>Ph.D. Thesis</source>
          , IT University of Copenhagen,
          <year>2013</year>
          . URL: https://www.fabriziomontesi.com/files/choreographic-programming.
          <source>pdf.</source>
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>R.</given-names>
            <surname>Needham</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Schroeder</surname>
          </string-name>
          ,
          <article-title>Using encryption for authentication in large networks of computers</article-title>
          ,
          <source>Commun. ACM</source>
          <volume>21</volume>
          (
          <year>1978</year>
          )
          <fpage>993</fpage>
          -
          <lpage>999</lpage>
          . doi:
          <volume>10</volume>
          .1145/359657.359659.
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>M.</given-names>
            <surname>Carbone</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Honda</surname>
          </string-name>
          ,
          <string-name>
            <given-names>N.</given-names>
            <surname>Yoshida</surname>
          </string-name>
          ,
          <article-title>Structured communication-centered programming for web services</article-title>
          ,
          <source>ACM Trans. Program. Lang. Syst</source>
          .
          <volume>34</volume>
          (
          <year>2012</year>
          )
          <article-title>8</article-title>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>F.</given-names>
            <surname>Montesi</surname>
          </string-name>
          , Introduction to Choreographies, Cambridge University Press,
          <year>2023</year>
          . doi:
          <volume>10</volume>
          .1017/ 9781108981491.
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>T.</given-names>
            <surname>Leesatapornwongsa</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J. F.</given-names>
            <surname>Lukman</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Lu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H. S.</given-names>
            <surname>Gunawi</surname>
          </string-name>
          ,
          <article-title>TaxDC: A taxonomy of non-deterministic concurrency bugs in datacenter distributed systems</article-title>
          , in: ASPLOS, ACM,
          <year>2016</year>
          , pp.
          <fpage>517</fpage>
          -
          <lpage>530</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>S.</given-names>
            <surname>Giallorenzo</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Montesi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Peressotti</surname>
          </string-name>
          , Choral:
          <article-title>Object-oriented choreographic programming</article-title>
          ,
          <source>ACM Trans. Program. Lang. Syst</source>
          .
          <volume>46</volume>
          (
          <year>2024</year>
          ). URL: https://doi.org/10.1145/3632398. doi:
          <volume>10</volume>
          .1145/ 3632398.
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>G.</given-names>
            <surname>Shen</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Kashiwa</surname>
          </string-name>
          , L. Kuper,
          <article-title>Haschor: Functional choreographic programming for all (functional pearl)</article-title>
          ,
          <source>Proc. ACM Program. Lang</source>
          .
          <volume>7</volume>
          (
          <year>2023</year>
          )
          <fpage>541</fpage>
          -
          <lpage>565</lpage>
          . URL: https://doi.org/10.1145/3607849. doi:
          <volume>10</volume>
          . 1145/3607849.
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>S.</given-names>
            <surname>Kashiwa</surname>
          </string-name>
          ,
          <string-name>
            <given-names>G.</given-names>
            <surname>Shen</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Zare</surname>
          </string-name>
          , L. Kuper, Portable, eficient, and
          <article-title>practical library-level choreographic programming</article-title>
          ,
          <source>CoRR abs/2311</source>
          .11472 (
          <year>2023</year>
          ). URL: https://doi.org/10.48550/arXiv.2311.11472. doi:
          <volume>10</volume>
          . 48550/ARXIV.2311.11472. arXiv:
          <volume>2311</volume>
          .
          <fpage>11472</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>L.</given-names>
            <surname>Cruz-Filipe</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Montesi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Peressotti</surname>
          </string-name>
          ,
          <article-title>A formal theory of choreographic programming</article-title>
          ,
          <source>J. Autom. Reason</source>
          .
          <volume>67</volume>
          (
          <year>2023</year>
          )
          <article-title>21</article-title>
          . URL: https://doi.org/10.1007/s10817-023-09665-3. doi:
          <volume>10</volume>
          .1007/ S10817-023-09665-3.
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>L.</given-names>
            <surname>Cruz-Filipe</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Montesi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Peressotti</surname>
          </string-name>
          ,
          <article-title>Certifying choreography compilation</article-title>
          , in: A.
          <string-name>
            <surname>Cerone</surname>
          </string-name>
          , P. C. Ölveczky (Eds.),
          <source>Theoretical Aspects of Computing - ICTAC</source>
          <year>2021</year>
          - 18th International Colloquium, Virtual Event, Nur-Sultan,
          <source>Kazakhstan, September</source>
          <volume>8</volume>
          -
          <issue>10</issue>
          ,
          <year>2021</year>
          , Proceedings, volume
          <volume>12819</volume>
          of Lecture Notes in Computer Science, Springer,
          <year>2021</year>
          , pp.
          <fpage>115</fpage>
          -
          <lpage>133</lpage>
          . doi:
          <volume>10</volume>
          .1007/978-3-
          <fpage>030</fpage>
          -85315-0\_8.
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <surname>A. K. Hirsch</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          <string-name>
            <surname>Garg</surname>
          </string-name>
          ,
          <article-title>Pirouette: higher-order typed functional choreographies</article-title>
          ,
          <source>Proc. ACM Program. Lang</source>
          .
          <volume>6</volume>
          (
          <issue>2022</issue>
          )
          <fpage>1</fpage>
          -
          <lpage>27</lpage>
          . URL: https://doi.org/10.1145/3498684. doi:
          <volume>10</volume>
          .1145/3498684.
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <given-names>J.</given-names>
            <surname>Å. Pohjola</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Gómez-Londoño</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Shaker</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Norrish</surname>
          </string-name>
          ,
          <article-title>Kalas: A verified, end-to-end compiler for a choreographic language</article-title>
          , in: J.
          <string-name>
            <surname>Andronick</surname>
          </string-name>
          , L. de Moura (Eds.),
          <source>13th International Conference on Interactive Theorem Proving, ITP 2022, August 7-10</source>
          ,
          <year>2022</year>
          , Haifa, Israel, volume
          <volume>237</volume>
          of LIPIcs,
          <source>Schloss Dagstuhl - Leibniz-Zentrum für Informatik</source>
          ,
          <year>2022</year>
          , pp.
          <volume>27</volume>
          :
          <fpage>1</fpage>
          -
          <lpage>27</lpage>
          :
          <fpage>18</fpage>
          . URL: https://doi.org/10. 4230/LIPIcs.ITP.
          <year>2022</year>
          .
          <volume>27</volume>
          . doi:
          <volume>10</volume>
          .4230/LIPICS.ITP.
          <year>2022</year>
          .
          <volume>27</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [13]
          <string-name>
            <given-names>C.</given-names>
            <surname>Acay</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Gancher</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Recto</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A. C.</given-names>
            <surname>Myers</surname>
          </string-name>
          ,
          <article-title>Secure synthesis of distributed cryptographic applications</article-title>
          (
          <source>technical report)</source>
          ,
          <source>CoRR abs/2401</source>
          .04131 (
          <year>2024</year>
          ). URL: https://doi.org/10.48550/arXiv.2401. doi:
          <volume>10</volume>
          .1145/3453483.3454074.
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          [15]
          <string-name>
            <given-names>K.</given-names>
            <surname>Honda</surname>
          </string-name>
          ,
          <string-name>
            <given-names>N.</given-names>
            <surname>Yoshida</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Carbone</surname>
          </string-name>
          , Multiparty Asynchronous Session Types,
          <source>J. ACM</source>
          <volume>63</volume>
          (
          <year>2016</year>
          )
          <article-title>9</article-title>
          . URL: http://doi.acm.
          <source>org/10</source>
          .1145/2827695. doi:
          <volume>10</volume>
          .1145/2827695.
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          [16]
          <string-name>
            <given-names>M.</given-names>
            <surname>Adameit</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Peters</surname>
          </string-name>
          , U. Nestmann,
          <article-title>Session types for link failures</article-title>
          ,
          <source>in: FORTE</source>
          , volume
          <volume>10321</volume>
          of Lecture Notes in Computer Science, Springer,
          <year>2017</year>
          , pp.
          <fpage>1</fpage>
          -
          <lpage>16</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          [17]
          <string-name>
            <given-names>M.</given-names>
            <surname>Viering</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Hu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Eugster</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Ziarek</surname>
          </string-name>
          ,
          <article-title>A multiparty session typing discipline for fault-tolerant event-driven distributed programming</article-title>
          ,
          <source>Proc. ACM Program. Lang</source>
          .
          <volume>5</volume>
          (
          <issue>2021</issue>
          )
          <fpage>1</fpage>
          -
          <lpage>30</lpage>
          . URL: https: //doi.org/10.1145/3485501. doi:
          <volume>10</volume>
          .1145/3485501.
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          [18]
          <string-name>
            <given-names>V.</given-names>
            <surname>Hadzilacos</surname>
          </string-name>
          ,
          <article-title>Issues of fault tolerance in concurrent computations (databases, reliability, transactions, agreement protocols</article-title>
          ,
          <source>distributed computing)</source>
          ,
          <source>Ph.D. thesis, USA</source>
          ,
          <year>1985</year>
          . AAI8520209.
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          [19]
          <string-name>
            <surname>K. J. Perry</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          <string-name>
            <surname>Toueg</surname>
          </string-name>
          ,
          <article-title>Distributed agreement in the presence of processor and communication faults</article-title>
          ,
          <source>IEEE Transactions on Software Engineering SE-12</source>
          (
          <year>1986</year>
          )
          <fpage>477</fpage>
          -
          <lpage>482</lpage>
          . doi:
          <volume>10</volume>
          .1109/TSE.
          <year>1986</year>
          .
          <volume>6312888</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref19">
        <mixed-citation>
          [20]
          <string-name>
            <given-names>F.</given-names>
            <surname>Cristian</surname>
          </string-name>
          ,
          <article-title>Understanding fault-tolerant distributed systems</article-title>
          ,
          <source>Commun. ACM</source>
          <volume>34</volume>
          (
          <year>1991</year>
          )
          <fpage>56</fpage>
          -
          <lpage>78</lpage>
          . URL: https://doi.org/10.1145/102792.102801. doi:
          <volume>10</volume>
          .1145/102792.102801.
        </mixed-citation>
      </ref>
      <ref id="ref20">
        <mixed-citation>
          [21]
          <string-name>
            <given-names>E.</given-names>
            <surname>Graversen</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Montesi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Peressotti</surname>
          </string-name>
          ,
          <article-title>A promising future: Omission failures in choreographic programming</article-title>
          ,
          <source>CoRR abs/1712</source>
          .05465 (
          <year>2025</year>
          ). URL: https://arxiv.org/abs/1712.05465v3. doi:
          <volume>10</volume>
          .48550/ arXiv.1712.05465. arXiv:
          <volume>1712</volume>
          .
          <year>05465v3</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref21">
        <mixed-citation>
          [22]
          <string-name>
            <given-names>D.</given-names>
            <surname>Sangiorgi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Walker</surname>
          </string-name>
          , The
          <article-title>-calculus: a Theory of Mobile Processes</article-title>
          , Cambridge University Press,
          <year>2001</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref22">
        <mixed-citation>
          [23]
          <string-name>
            <given-names>S.-S.</given-names>
            <surname>Jongmans</surname>
          </string-name>
          , P. van den Bos,
          <article-title>A predicate transformer for choreographies</article-title>
          , in: I. Sergey (Ed.),
          <source>Programming Languages and Systems</source>
          , Springer International Publishing, Cham,
          <year>2022</year>
          , pp.
          <fpage>520</fpage>
          -
          <lpage>547</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref23">
        <mixed-citation>
          [24]
          <string-name>
            <given-names>M.</given-names>
            <surname>Dalla Preda</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Gabbrielli</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Giallorenzo</surname>
          </string-name>
          ,
          <string-name>
            <surname>I. Lanese</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Mauro</surname>
          </string-name>
          ,
          <article-title>Dynamic choreographies: Theory and implementation</article-title>
          ,
          <source>Logical Methods in Computer Science</source>
          <volume>13</volume>
          (
          <year>2017</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref24">
        <mixed-citation>
          [25]
          <string-name>
            <given-names>L.</given-names>
            <surname>Cruz-Filipe</surname>
          </string-name>
          ,
          <string-name>
            <given-names>E.</given-names>
            <surname>Graversen</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Montesi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Peressotti</surname>
          </string-name>
          ,
          <article-title>Reasoning about choreographic programs</article-title>
          , in: S. Jongmans,
          <string-name>
            <surname>A</surname>
          </string-name>
          . Lopes (Eds.),
          <source>Coordination Models and Languages</source>
          , volume
          <volume>13908</volume>
          of Lecture Notes in Computer Science, Springer,
          <year>2023</year>
          , pp.
          <fpage>144</fpage>
          -
          <lpage>162</lpage>
          . doi:
          <volume>10</volume>
          .1007/978-3-
          <fpage>031</fpage>
          -35361-1\_8.
        </mixed-citation>
      </ref>
      <ref id="ref25">
        <mixed-citation>
          [26]
          <string-name>
            <given-names>L.</given-names>
            <surname>Cruz-Filipe</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Montesi</surname>
          </string-name>
          ,
          <article-title>Procedural choreographic programming</article-title>
          ,
          <source>in: FORTE, LNCS</source>
          , Springer,
          <year>2017</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref26">
        <mixed-citation>
          [27]
          <string-name>
            <given-names>H. A.</given-names>
            <surname>López</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Nielson</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H. R.</given-names>
            <surname>Nielson</surname>
          </string-name>
          ,
          <article-title>Enforcing availability in failure-aware communicating systems</article-title>
          ,
          <source>in: FORTE</source>
          , volume
          <volume>9688</volume>
          of Lecture Notes in Computer Science, Springer,
          <year>2016</year>
          , pp.
          <fpage>195</fpage>
          -
          <lpage>211</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref27">
        <mixed-citation>
          [28]
          <string-name>
            <given-names>L.</given-names>
            <surname>Cruz-Filipe</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Montesi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Peressotti</surname>
          </string-name>
          , Communication in choreographies, revisited, in: SAC, ACM,
          <year>2018</year>
          . To Appear.
        </mixed-citation>
      </ref>
      <ref id="ref28">
        <mixed-citation>
          [29]
          <string-name>
            <given-names>P. A.</given-names>
            <surname>Bernstein</surname>
          </string-name>
          , E. Newcomer,
          <article-title>Chapter 8 - two-phase commit</article-title>
          , in: P. A.
          <string-name>
            <surname>Bernstein</surname>
          </string-name>
          , E. Newcomer (Eds.),
          <source>Principles of Transaction Processing (Second Edition)</source>
          , The Morgan Kaufmann Series in Data Management Systems, second edition ed., Morgan Kaufmann, San Francisco,
          <year>2009</year>
          , pp.
          <fpage>223</fpage>
          -
          <lpage>244</lpage>
          . URL: https://www.sciencedirect.com/science/article/pii/B9781558606234000081. doi:
          <volume>10</volume>
          .1016/ B978-1
          <source>-55860-623-4</source>
          .
          <fpage>00008</fpage>
          -
          <lpage>1</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref29">
        <mixed-citation>
          [30]
          <string-name>
            <given-names>L.</given-names>
            <surname>Bettini</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Coppo</surname>
          </string-name>
          , L.
          <string-name>
            <surname>D'Antoni</surname>
          </string-name>
          ,
          <string-name>
            <surname>M. De Luca</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          <string-name>
            <surname>Dezani-Ciancaglini</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          <string-name>
            <surname>Yoshida</surname>
          </string-name>
          ,
          <article-title>Global progress in dynamically interleaved multiparty sessions</article-title>
          ,
          <source>in: CONCUR</source>
          , volume
          <volume>5201</volume>
          <source>of LNCS</source>
          , Springer,
          <year>2008</year>
          , pp.
          <fpage>418</fpage>
          -
          <lpage>433</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref30">
        <mixed-citation>
          [31]
          <string-name>
            <given-names>I.</given-names>
            <surname>Lanese</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Guidi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Montesi</surname>
          </string-name>
          ,
          <string-name>
            <surname>G.</surname>
          </string-name>
          <article-title>Zavattaro, Bridging the gap between interaction- and processoriented choreographies</article-title>
          ,
          <source>in: SEFM</source>
          ,
          <year>2008</year>
          , pp.
          <fpage>323</fpage>
          -
          <lpage>332</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref31">
        <mixed-citation>
          [32]
          <string-name>
            <given-names>L.</given-names>
            <surname>Cruz-Filipe</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Montesi</surname>
          </string-name>
          ,
          <article-title>A core model for choreographic programming</article-title>
          , in: O.
          <string-name>
            <surname>Kouchnarenko</surname>
          </string-name>
          , R. Khosravi (Eds.), FACS, volume
          <volume>10231</volume>
          <source>of LNCS</source>
          , Springer,
          <year>2016</year>
          . doi:
          <volume>10</volume>
          .1007/978-3-
          <fpage>319</fpage>
          -57666-4\ _3.
        </mixed-citation>
      </ref>
      <ref id="ref32">
        <mixed-citation>
          [33]
          <string-name>
            <given-names>L.</given-names>
            <surname>Lamport</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Fischer</surname>
          </string-name>
          ,
          <article-title>Byzantine generals and transaction commit protocols</article-title>
          ,
          <source>Technical Report, Technical Report 62</source>
          , SRI International,
          <year>1982</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref33">
        <mixed-citation>
          [34]
          <string-name>
            <given-names>R. D.</given-names>
            <surname>Schlichting</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F. B.</given-names>
            <surname>Schneider</surname>
          </string-name>
          ,
          <article-title>Fail-stop processors: an approach to designing fault-tolerant computing systems</article-title>
          ,
          <source>ACM Trans. Comput. Syst</source>
          .
          <volume>1</volume>
          (
          <year>1983</year>
          )
          <fpage>222</fpage>
          -
          <lpage>238</lpage>
          . URL: https://doi.org/10.1145/ 357369.357371. doi:
          <volume>10</volume>
          .1145/357369.357371.
        </mixed-citation>
      </ref>
      <ref id="ref34">
        <mixed-citation>
          [35]
          <string-name>
            <given-names>F. B.</given-names>
            <surname>Schneider</surname>
          </string-name>
          ,
          <article-title>Byzantine generals in action: implementing fail-stop processors</article-title>
          ,
          <source>ACM Trans. Comput. Syst</source>
          .
          <volume>2</volume>
          (
          <year>1984</year>
          )
          <fpage>145</fpage>
          -
          <lpage>154</lpage>
          . URL: https://doi.org/10.1145/190.357399. doi:
          <volume>10</volume>
          .1145/190.357399.
        </mixed-citation>
      </ref>
      <ref id="ref35">
        <mixed-citation>
          [36]
          <string-name>
            <given-names>S.</given-names>
            <surname>Capecchi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>E.</given-names>
            <surname>Giachino</surname>
          </string-name>
          ,
          <string-name>
            <given-names>N.</given-names>
            <surname>Yoshida</surname>
          </string-name>
          ,
          <article-title>Global escape in multiparty sessions</article-title>
          ,
          <source>Mathematical Structures in Computer Science</source>
          <volume>26</volume>
          (
          <year>2016</year>
          )
          <fpage>156</fpage>
          -
          <lpage>205</lpage>
          . URL: http://dx.doi.org/10.1017/S0960129514000164. doi:
          <volume>10</volume>
          . 1017/S0960129514000164.
        </mixed-citation>
      </ref>
      <ref id="ref36">
        <mixed-citation>
          [37]
          <string-name>
            <given-names>T.</given-names>
            <surname>Chen</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Viering</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Bejleri</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Ziarek</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Eugster</surname>
          </string-name>
          ,
          <article-title>A type theory for robust failure handling in distributed systems</article-title>
          , in: FORTE, volume
          <volume>9688</volume>
          of Lecture Notes in Computer Science, Springer,
          <year>2016</year>
          , pp.
          <fpage>96</fpage>
          -
          <lpage>113</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref37">
        <mixed-citation>
          [38]
          <string-name>
            <given-names>S.</given-names>
            <surname>Fowler</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Lindley</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J. G.</given-names>
            <surname>Morris</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Decova</surname>
          </string-name>
          ,
          <article-title>Exceptional asynchronous session types: session types without tiers</article-title>
          ,
          <source>Proc. ACM Program. Lang</source>
          .
          <volume>3</volume>
          (
          <year>2019</year>
          )
          <volume>28</volume>
          :
          <fpage>1</fpage>
          -
          <lpage>28</lpage>
          :
          <fpage>29</fpage>
          . URL: https://doi.org/10.1145/3290341. doi:
          <volume>10</volume>
          .1145/3290341.
        </mixed-citation>
      </ref>
      <ref id="ref38">
        <mixed-citation>
          [39]
          <string-name>
            <given-names>N.</given-names>
            <surname>Lagaillardie</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Neykova</surname>
          </string-name>
          ,
          <string-name>
            <given-names>N.</given-names>
            <surname>Yoshida</surname>
          </string-name>
          ,
          <article-title>Stay safe under panic: Afine rust programming with multiparty session types</article-title>
          , in: K. Ali, J. Vitek (Eds.),
          <source>36th European Conference on Object-Oriented Programming, ECOOP</source>
          <year>2022</year>
          , June 6-10,
          <year>2022</year>
          , Berlin, Germany, volume
          <volume>222</volume>
          of LIPIcs,
          <source>Schloss Dagstuhl - Leibniz-Zentrum für Informatik</source>
          ,
          <year>2022</year>
          , pp.
          <volume>4</volume>
          :
          <fpage>1</fpage>
          -
          <lpage>4</lpage>
          :
          <fpage>29</fpage>
          . URL: https://doi.org/10.4230/LIPIcs. ECOOP.
          <year>2022</year>
          .
          <article-title>4</article-title>
          . doi:
          <volume>10</volume>
          .4230/LIPICS.ECOOP.
          <year>2022</year>
          .
          <volume>4</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref39">
        <mixed-citation>
          [40]
          <string-name>
            <given-names>Z.</given-names>
            <surname>Qiu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>X.</given-names>
            <surname>Zhao</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Cai</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Yang</surname>
          </string-name>
          ,
          <article-title>Towards the theoretical foundation of choreography</article-title>
          , in: WWW, ACM,
          <year>2007</year>
          , pp.
          <fpage>973</fpage>
          -
          <lpage>982</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref40">
        <mixed-citation>
          [41]
          <string-name>
            <given-names>D.</given-names>
            <surname>Plyukhin</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Peressotti</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Montesi</surname>
          </string-name>
          , Ozone:
          <article-title>Fully out-of-order choreographies</article-title>
          , in: J.
          <string-name>
            <surname>Aldrich</surname>
          </string-name>
          , G. Salvaneschi (Eds.),
          <source>38th European Conference on Object-Oriented Programming, ECOOP 2024, September 16-20</source>
          ,
          <year>2024</year>
          , Vienna, Austria, volume
          <volume>313</volume>
          of LIPIcs,
          <source>Schloss Dagstuhl - Leibniz-Zentrum für Informatik</source>
          ,
          <year>2024</year>
          , pp.
          <volume>31</volume>
          :
          <fpage>1</fpage>
          -
          <lpage>31</lpage>
          :
          <fpage>28</fpage>
          . doi:
          <volume>10</volume>
          .4230/LIPICS.ECOOP.
          <year>2024</year>
          .
          <volume>31</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref41">
        <mixed-citation>
          [42]
          <string-name>
            <given-names>S.</given-names>
            <surname>Laddad</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Cheung</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J. M.</given-names>
            <surname>Hellerstein</surname>
          </string-name>
          ,
          <article-title>Suki: Choreographed distributed dataflow in rust</article-title>
          ,
          <source>CoRR abs/2406</source>
          .1473 (
          <year>2024</year>
          ). URL: https://arxiv.org/abs/2406.1473. doi:
          <volume>10</volume>
          .48550/arXiv.2406.1473. arXiv:
          <volume>2406</volume>
          .
          <fpage>1473</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref42">
        <mixed-citation>
          [43]
          <string-name>
            <given-names>G.</given-names>
            <surname>Shen</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Kuper</surname>
          </string-name>
          ,
          <article-title>Toward verified library-level choreographic programming with algebraic efects</article-title>
          ,
          <source>CoRR abs/2407</source>
          .06509 (
          <year>2024</year>
          ). URL: https://arxiv.org/abs/2407.06509. doi:
          <volume>10</volume>
          .48550/arXiv.2407. 06509. arXiv:
          <volume>2407</volume>
          .
          <fpage>06509</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref43">
        <mixed-citation>
          [44]
          <string-name>
            <given-names>V. T.</given-names>
            <surname>Vasconcelos</surname>
          </string-name>
          , Fundamentals of session types,
          <source>Inf. Comput</source>
          .
          <volume>217</volume>
          (
          <year>2012</year>
          )
          <fpage>52</fpage>
          -
          <lpage>70</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref44">
        <mixed-citation>
          [45]
          <string-name>
            <given-names>M.</given-names>
            <surname>Carbone</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Lindley</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Montesi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Schürmann</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Wadler</surname>
          </string-name>
          ,
          <article-title>Coherence generalises duality: A logical explanation of multiparty session types</article-title>
          ,
          <source>in: CONCUR</source>
          , volume
          <volume>59</volume>
          of LIPIcs, Schloss Dagstuhl,
          <year>2016</year>
          , pp.
          <volume>33</volume>
          :
          <fpage>1</fpage>
          -
          <lpage>33</lpage>
          :
          <fpage>15</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref45">
        <mixed-citation>
          [46]
          <string-name>
            <given-names>W.</given-names>
            <surname>Kokke</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Montesi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Peressotti</surname>
          </string-name>
          ,
          <article-title>Better late than never: a fully-abstract semantics for classical processes</article-title>
          ,
          <source>Proc. ACM Program. Lang</source>
          .
          <volume>3</volume>
          (
          <year>2019</year>
          )
          <volume>24</volume>
          :
          <fpage>1</fpage>
          -
          <lpage>24</lpage>
          :
          <fpage>29</fpage>
          . URL: https://doi.org/10.1145/3290337. doi:
          <volume>10</volume>
          .1145/3290337.
        </mixed-citation>
      </ref>
      <ref id="ref46">
        <mixed-citation>
          [47]
          <string-name>
            <given-names>W.</given-names>
            <surname>Kokke</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Montesi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Peressotti</surname>
          </string-name>
          ,
          <article-title>Taking linear logic apart</article-title>
          , in: T. Ehrhard,
          <string-name>
            <given-names>M.</given-names>
            <surname>Fernández</surname>
          </string-name>
          , V. de Paiva, L. T. de Falco (Eds.),
          <source>Proceedings Joint International Workshop on Linearity &amp; Trends in Linear Logic and Applications</source>
          , Linearity-TLLA@
          <article-title>FLoC 2018</article-title>
          , Oxford, UK,
          <fpage>7</fpage>
          -
          <issue>8</issue>
          <year>July 2018</year>
          ., volume
          <volume>292</volume>
          of Electronic Proceedings in Theoretical Computer Science, Open Publishing Association,
          <year>2018</year>
          , pp.
          <fpage>90</fpage>
          -
          <lpage>103</lpage>
          . doi:
          <volume>10</volume>
          .4204/EPTCS.292.5.
        </mixed-citation>
      </ref>
      <ref id="ref47">
        <mixed-citation>
          [48]
          <string-name>
            <given-names>M.</given-names>
            <surname>Carbone</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Montesi</surname>
          </string-name>
          ,
          <article-title>Deadlock-freedom-by-design: multiparty asynchronous global programming</article-title>
          ,
          <source>in: POPL, ACM</source>
          ,
          <year>2013</year>
          , pp.
          <fpage>263</fpage>
          -
          <lpage>274</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref48">
        <mixed-citation>
          [49]
          <string-name>
            <given-names>H.</given-names>
            <surname>Hüttel</surname>
          </string-name>
          ,
          <string-name>
            <given-names>I.</given-names>
            <surname>Lanese</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V. T.</given-names>
            <surname>Vasconcelos</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Caires</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Carbone</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Deniélou</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Mostrous</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Padovani</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Ravara</surname>
          </string-name>
          , E. Tuosto,
          <string-name>
            <given-names>H. T.</given-names>
            <surname>Vieira</surname>
          </string-name>
          , G. Zavattaro,
          <article-title>Foundations of session types and behavioural contracts</article-title>
          ,
          <source>ACM Comput. Surv</source>
          .
          <volume>49</volume>
          (
          <year>2016</year>
          ) 3:
          <fpage>1</fpage>
          -
          <lpage>3</lpage>
          :
          <fpage>36</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref49">
        <mixed-citation>
          [50]
          <string-name>
            <given-names>L.</given-names>
            <surname>Cruz-Filipe</surname>
          </string-name>
          ,
          <string-name>
            <given-names>E.</given-names>
            <surname>Graversen</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Lugović</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Montesi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Peressotti</surname>
          </string-name>
          ,
          <article-title>Functional choreographic programming</article-title>
          , in: H.
          <string-name>
            <surname>Seidl</surname>
            ,
            <given-names>Z.</given-names>
          </string-name>
          <string-name>
            <surname>Liu</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          Pasareanu (Eds.),
          <source>Theoretical Aspects of Computing - ICTAC</source>
          <year>2022</year>
          - 19th International Colloquium, Tbilisi, Georgia,
          <source>September 27-29</source>
          ,
          <year>2022</year>
          , Proceedings, Lecture Notes in Computer Science, Springer,
          <year>2022</year>
          , pp.
          <fpage>212</fpage>
          -
          <lpage>237</lpage>
          . doi:
          <volume>10</volume>
          .1007/978-3-
          <fpage>031</fpage>
          -17715-6_
          <fpage>15</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref50">
        <mixed-citation>
          [51]
          <string-name>
            <given-names>L.</given-names>
            <surname>Cruz-Filipe</surname>
          </string-name>
          ,
          <string-name>
            <given-names>E.</given-names>
            <surname>Graversen</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Lugović</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Montesi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Peressotti</surname>
          </string-name>
          ,
          <article-title>Modular compilation for higherorder functional choreographies</article-title>
          , in: K. Ali, G. Salvaneschi (Eds.),
          <source>37th European Conference on Object-Oriented Programming (ECOOP</source>
          <year>2023</year>
          ), volume
          <volume>263</volume>
          of Leibniz International Proceedings in Informatics (LIPIcs),
          <source>Schloss Dagstuhl - Leibniz-Zentrum für Informatik</source>
          , Dagstuhl, Germany,
          <year>2023</year>
          ,
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>