Reversible sessions with flexible choices

  • 94 Accesses

  • 2 Citations


We propose a calculus for concurrent reversible multiparty sessions, equipped with a flexible choice operator allowing for different sets of participants in each branch. This operator is inspired by the notion of connecting action recently introduced by Hu and Yoshida to describe protocols with optional participants. We argue that this choice operator allows for a natural description of typical communication protocols. Our calculus also supports a compact representation of the history of processes and types, which facilitates the definition of rollback. Moreover, it implements a fine-tuned strategy for backward computation. We present a session type system for the calculus and show that it enforces the expected properties of session fidelity, forward progress and backward progress.

This is a preview of subscription content, log in to check access.

Access options

Buy single article

Instant unlimited access to the full article PDF.

US$ 39.95

Price includes VAT for USA

Subscribe to journal

Immediate online access to all issues from 2019. Subscription will auto renew annually.

US$ 99

This is the net price. Taxes to be calculated in checkout.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7


  1. 1.

    We could also leave the executed branch, just erasing its hats. This change would preserve all the properties of the calculus. We prefer the current formulation, since it avoids the possibility of going back and fourth several times along the same branch (which could yield a livelock).


  1. 1.

    Barbanera, F., de’ Liguoro, U.: Sub-behaviour relations for session-based client/server systems. Math. Struct. Comput. Sci. 25(6), 1339–1381 (2015)

  2. 2.

    Barbanera, F., Dezani-Ciancaglini, M., de’Liguoro, U.: Reversible client/server interactions. Form. Asp. Comput. 28(4), 697–722 (2016)

  3. 3.

    Barbanera, F., Dezani-Ciancaglini, M., Lanese, I., de’ Liguoro, U.: Retractable contracts. In: PLACES, volume 203 of EPTCS, pp. 61–72 (2016)

  4. 4.

    Bernardi, G., Hennessy, M.: Modelling session types using contracts. Math. Struct. Comput. Sci. 26(3), 510–560 (2016)

  5. 5.

    Boudol, G., Castellani, I.: Permutation of transitions: an event structure semantics for CCS and SCCS. In: REX School, volume 354 of LNCS, pp. 411–427. Springer (1988)

  6. 6.

    Boudol, G., Castellani, I.: Flow models of distributed computations: three equivalent semantics for CCS. Inf. Comput. 114(2), 247–314 (1994)

  7. 7.

    Caires, L., Vieira, H.T.: Analysis of service oriented software systems with the conversation calculus. In: FACS, volume 6921 of LNCS, pp. 6–33. Springer (2010)

  8. 8.

    Castellani, I., Dezani-Ciancaglini, M., Giannini, P.: Concurrent reversible sessions. In: CONCUR, volume 85 of LIPIcs, pp. 30:1–30:17. Schloss Dagstuhl (2017)

  9. 9.

    Cristescu, I., Krivine, J., Varacca, D.: Rigid families for the reversible \(\pi \)-calculus. In: RC, volume 9720 of LNCS, pp. 3–19. Springer (2016)

  10. 10.

    Danos, V., Krivine, J.: Reversible communicating systems. In: CONCUR, volume 3170 of LNCS, pp. 292–307. Springer (2004)

  11. 11.

    de Vries, E., Koutavas, V., Hennessy, M.: Communicating transactions—(extended abstract). In: CONCUR, volume 6269 of LNCS, pp. 569–583. Springer (2010)

  12. 12.

    de Vries, E., Koutavas, V., Hennessy, M.: Liveness of communicating transactions—(extended abstract). In: APLAS, volume 6461 of LNCS, pp. 392–407. Springer (2010)

  13. 13.

    Deniélou, P.-M., Yoshida, N.: Dynamic multirole session types. In: POPL, pp. 435–446. ACM Press (2011)

  14. 14.

    Dezani-Ciancaglini, M., Giannini, P.: Reversible multiparty sessions with checkpoints. In: EXPRESS/SOS, volume 222 of EPTCS, pp. 60–74 (2016)

  15. 15.

    Giachino, E., Sackman, M., Drossopoulou, S., Eisenbach, S.: Softly safely spoken: Role playing for session types. In: PLACES (2009)

  16. 16.

    Graversen, E., Phillips, I., Yoshida, N.: Towards a categorical representation of reversible event structures. In: PLACES, volume 246 of EPTCS, pp. 49–60 (2017)

  17. 17.

    Honda, K., Vasconcelos, V.T., Kubo, M.: Language primitives and type disciplines for structured communication-based programming. In: ESOP, volume 1381 of LNCS, pp. 22–138. Springer (1998)

  18. 18.

    Honda, K., Yoshida, N., Carbone, M.: Multiparty asynchronous session types. In: POPL, pp. 273–284. ACM Press (2008)

  19. 19.

    Honda, K., Yoshida, N., Carbone, M.: Multiparty asynchronous session types. J. ACM 63(1), 9 (2016)

  20. 20.

    Hu, R., Yoshida, N.: Explicit connection actions in multiparty session types. In: Fundamental Approaches to Software Engineering, volume 10202 of LNCS, pp. 116–133. Springer (2017)

  21. 21.

    Koutavas, V., Spaccasassi, C., Hennessy, M.: Bisimulations for communicating transactions—(extended abstract). In: FOSSACS, volume 8412 of LNCS, pp. 320–334. Springer (2014)

  22. 22.

    Lanese, I., Mezzina, C.A., Schmitt, A., Stefani, J.-B.: Controlling reversibility in higher-order pi. In: CONCUR, volume 6901 of LNCS, pp. 297–311. Springer (2011)

  23. 23.

    Lanese, I., Mezzina, C.A., Stefani, J.-B.: Reversing higher-order pi. In: CONCUR, volume 6269 of LNCS, pp. 478–493. Springer (2010)

  24. 24.

    Mezzina, C.A., Pérez, J.A.: Reversible semantics in session-based concurrency. In: ICTCS, volume 1720 of CEUR, pp. 221–226 (2016).

  25. 25.

    Mezzina, C.A., Pérez, J.A.: Reversible sessions using monitors. In: PLACES, volume 211 of EPTCS, pp. 56–64 (2016)

  26. 26.

    Mezzina, C.A., Pérez, J.A.: Causally consistent reversible choreographies: a monitors-as-memories approach. In: PPDP, pp. 127–138. ACM Press (2017)

  27. 27.

    Mezzina, C.A., Tuosto, E.: Choreographies for automatic recovery (2017). CoRR, arXiv:1705.09525

  28. 28.

    Neykova, R., Yoshida, N.: Let it recover: multiparty protocol-induced recovery. In: CC, pp. 98–108. ACM Press (2017)

  29. 29.

    Padovani, L.: Type reconstruction for the linear \(\pi \)-calculus with composite regular types. Log. Methods Comput. Sci. 11(4), 1–23 (2015)

  30. 30.

    Phillips, I., Ulidowski, I.: Operational semantics of reversibility in process algebra. In: APC, volume 162 of ENTCS, pp. 281–286 (2006)

  31. 31.

    Phillips, I., Ulidowski, I.: Reversing algebraic process calculi. J. Log. Algebr. Methods Program. 73(1–2), 70–96 (2007)

  32. 32.

    Phillips, I., Ulidowski, I.: Reversibility and asymmetric conflict in event structures. J. Log. Algebr. Methods Program. 84(6), 781–805 (2015)

  33. 33.

    Pierce, B.C.: Types and Programming Languages. MIT Press, Cambridge (2002)

  34. 34.

    Tiezzi, F., Yoshida, N.: Reversible session-based pi-calculus. J. Log. Algebr. Methods Program. 84(5), 684–707 (2015)

  35. 35.

    Tiezzi, F., Yoshida, N.: Reversing single sessions. In: RC, volume 9720 of LNCS, pp. 52–69. Springer (2016)

  36. 36.

    Vieira, H.T., Caires, L., Seco, J.C.: The conversation calculus: a model of service-oriented computation. In: ESOP, volume 4960 of LNCS, pp. 269–283. Springer (2008)

  37. 37.

    Winskel, G.: Events in Computation. PhD thesis, Department of Computer Science, University of Edinburgh (1980)

Download references


We would like to thank the anonymous referees for their helpful comments.

Author information

Correspondence to Paola Giannini.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Mariangiola Dezani-Ciancaglini: Partially supported by EU H2020-644235 Rephrase project, EU H2020-644298 HyVar project, IC1402 ARVI and Ateneo/CSP project RunVar. Paola Giannini: This original research has the financial support of the Università del Piemonte Orientale. The authors acknowledge a partial support of COST Action IC1405 on Reversible Computation—extending horizons of computing.

A: Reductions of networks and systems

A: Reductions of networks and systems

It is easy to define a bijection between networks and initial systems:

$$\begin{aligned} {\mathcal {S}}(\mathbb {N})=\mathbb {N}\between \langle -,\mathbb {P},\emptyset \rangle \qquad \qquad {\mathcal {N}}(\mathbb {N}\between \langle -,\mathbb {P},\emptyset \rangle )=\mathbb {N}\end{aligned}$$

where \(\mathbb {P}\) is the set of participants in \(\mathbb {N}\).

We establish now an operational correspondence between networks and their associated systems. More precisely we prove the following:

  • Communication preservation and reflection: every network communication is simulated by a communication in the associated system and vice-versa;

  • Rollback preservation: every network rollback is simulated by a sequence of backward moves in the associated system, initiating with a starting backward move and terminating with an ending backward move;

  • Rollback reflection: every starting backward move in a system can be extended to a complete sequence of backward moves such that the resulting system is the image of a rollback in the source network.

In the following theorem we denote transitive closure of and .

Theorem 5

  1. 1.

    If , then .

  2. 2.

    If , then .

  3. 3.

    If , then .

  4. 4.

    If , then and .


(1) and (2). The result is immediate since Rule [Com] of Fig. 1 and Rule [ComS] of Fig. 2 have the same antecedents.

(3). If , then the applied rule is


$$\begin{aligned} \begin{array}{c}\mathbb {N}=\textsf {p} \llbracket \,P\,\rrbracket \mathrel {\Vert }\varPi _{1\le i\le n}\textsf {p} _i\llbracket \,P_i\,\rrbracket \quad \text { and }\quad \mathbb {N}'=\textsf {p} \llbracket \,P'\,\rrbracket \mathrel {\Vert }\varPi _{1\le i\le m}\textsf {p} _i\llbracket \,P'_i\,\rrbracket \mathrel {\Vert }\varPi _{m+1\le i\le n}\textsf {p} _i\llbracket \,P_i\,\rrbracket \end{array} \end{aligned}$$

Then \({\mathcal {S}}(\mathbb {N})=\mathbb {N}\between \sigma \) and \({\mathcal {S}}(\mathbb {N}')=\mathbb {N}'\between \sigma \) with \(\sigma =\langle -,\{\textsf {p} \}\cup \{\textsf {p} _i\mid 1\le i \le n\},\emptyset \rangle \). We get

(4). If , then Rule [BackS] has been applied, so

Since \(\mathbb {P}_2\) can be split in two subsets of participants, according to whether the associated processes satisfy the premise of Rule [BackY] or of Rule [BackN] in Fig. 2, we may assume without loss of generality that

$$\begin{aligned} \begin{array}{c} \mathbb {N}_1=\varPi _{1\le i\le m}\textsf {p} _i\llbracket \,P_i\,\rrbracket \mathrel {\Vert }\varPi _{m+1\le i\le n}\textsf {p} _i\llbracket \,P_i\,\rrbracket \end{array} \end{aligned}$$

where for all i, \(1\le i\le n\), if \(i\le m\) and otherwise. With a sequence of reductions as in the proof of point (3), we then obtain for some network \(\mathbb {N}''\):

Since \(P\) and all the \(P_i\) for \(1\le i\le n\) satisfy the premises of Rule [Back] in Fig. 1, we may apply this rule to \(\mathbb {N}\) to conclude , as required. \(\square \)

Rights and permissions

Reprints and Permissions

About this article

Verify currency and authenticity via CrossMark

Cite this article

Castellani, I., Dezani-Ciancaglini, M. & Giannini, P. Reversible sessions with flexible choices. Acta Informatica 56, 553–583 (2019).

Download citation