Abstract
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.
Similar content being viewed by others
Notes
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).
References
Barbanera, F., de’ Liguoro, U.: Sub-behaviour relations for session-based client/server systems. Math. Struct. Comput. Sci. 25(6), 1339–1381 (2015)
Barbanera, F., Dezani-Ciancaglini, M., de’Liguoro, U.: Reversible client/server interactions. Form. Asp. Comput. 28(4), 697–722 (2016)
Barbanera, F., Dezani-Ciancaglini, M., Lanese, I., de’ Liguoro, U.: Retractable contracts. In: PLACES, volume 203 of EPTCS, pp. 61–72 (2016)
Bernardi, G., Hennessy, M.: Modelling session types using contracts. Math. Struct. Comput. Sci. 26(3), 510–560 (2016)
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)
Boudol, G., Castellani, I.: Flow models of distributed computations: three equivalent semantics for CCS. Inf. Comput. 114(2), 247–314 (1994)
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)
Castellani, I., Dezani-Ciancaglini, M., Giannini, P.: Concurrent reversible sessions. In: CONCUR, volume 85 of LIPIcs, pp. 30:1–30:17. Schloss Dagstuhl (2017)
Cristescu, I., Krivine, J., Varacca, D.: Rigid families for the reversible \(\pi \)-calculus. In: RC, volume 9720 of LNCS, pp. 3–19. Springer (2016)
Danos, V., Krivine, J.: Reversible communicating systems. In: CONCUR, volume 3170 of LNCS, pp. 292–307. Springer (2004)
de Vries, E., Koutavas, V., Hennessy, M.: Communicating transactions—(extended abstract). In: CONCUR, volume 6269 of LNCS, pp. 569–583. Springer (2010)
de Vries, E., Koutavas, V., Hennessy, M.: Liveness of communicating transactions—(extended abstract). In: APLAS, volume 6461 of LNCS, pp. 392–407. Springer (2010)
Deniélou, P.-M., Yoshida, N.: Dynamic multirole session types. In: POPL, pp. 435–446. ACM Press (2011)
Dezani-Ciancaglini, M., Giannini, P.: Reversible multiparty sessions with checkpoints. In: EXPRESS/SOS, volume 222 of EPTCS, pp. 60–74 (2016)
Giachino, E., Sackman, M., Drossopoulou, S., Eisenbach, S.: Softly safely spoken: Role playing for session types. In: PLACES (2009)
Graversen, E., Phillips, I., Yoshida, N.: Towards a categorical representation of reversible event structures. In: PLACES, volume 246 of EPTCS, pp. 49–60 (2017)
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)
Honda, K., Yoshida, N., Carbone, M.: Multiparty asynchronous session types. In: POPL, pp. 273–284. ACM Press (2008)
Honda, K., Yoshida, N., Carbone, M.: Multiparty asynchronous session types. J. ACM 63(1), 9 (2016)
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)
Koutavas, V., Spaccasassi, C., Hennessy, M.: Bisimulations for communicating transactions—(extended abstract). In: FOSSACS, volume 8412 of LNCS, pp. 320–334. Springer (2014)
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)
Lanese, I., Mezzina, C.A., Stefani, J.-B.: Reversing higher-order pi. In: CONCUR, volume 6269 of LNCS, pp. 478–493. Springer (2010)
Mezzina, C.A., Pérez, J.A.: Reversible semantics in session-based concurrency. In: ICTCS, volume 1720 of CEUR, pp. 221–226 (2016). CEUR-WS.org
Mezzina, C.A., Pérez, J.A.: Reversible sessions using monitors. In: PLACES, volume 211 of EPTCS, pp. 56–64 (2016)
Mezzina, C.A., Pérez, J.A.: Causally consistent reversible choreographies: a monitors-as-memories approach. In: PPDP, pp. 127–138. ACM Press (2017)
Mezzina, C.A., Tuosto, E.: Choreographies for automatic recovery (2017). CoRR, arXiv:1705.09525
Neykova, R., Yoshida, N.: Let it recover: multiparty protocol-induced recovery. In: CC, pp. 98–108. ACM Press (2017)
Padovani, L.: Type reconstruction for the linear \(\pi \)-calculus with composite regular types. Log. Methods Comput. Sci. 11(4), 1–23 (2015)
Phillips, I., Ulidowski, I.: Operational semantics of reversibility in process algebra. In: APC, volume 162 of ENTCS, pp. 281–286 (2006)
Phillips, I., Ulidowski, I.: Reversing algebraic process calculi. J. Log. Algebr. Methods Program. 73(1–2), 70–96 (2007)
Phillips, I., Ulidowski, I.: Reversibility and asymmetric conflict in event structures. J. Log. Algebr. Methods Program. 84(6), 781–805 (2015)
Pierce, B.C.: Types and Programming Languages. MIT Press, Cambridge (2002)
Tiezzi, F., Yoshida, N.: Reversible session-based pi-calculus. J. Log. Algebr. Methods Program. 84(5), 684–707 (2015)
Tiezzi, F., Yoshida, N.: Reversing single sessions. In: RC, volume 9720 of LNCS, pp. 52–69. Springer (2016)
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)
Winskel, G.: Events in Computation. PhD thesis, Department of Computer Science, University of Edinburgh (1980)
Acknowledgements
We would like to thank the anonymous referees for their helpful comments.
Author information
Authors and Affiliations
Corresponding author
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:
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.
If , then .
-
2.
If , then .
-
3.
If , then .
-
4.
If , then and .
Proof
(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
where
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
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
About this article
Cite this article
Castellani, I., Dezani-Ciancaglini, M. & Giannini, P. Reversible sessions with flexible choices. Acta Informatica 56, 553–583 (2019). https://doi.org/10.1007/s00236-019-00332-y
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s00236-019-00332-y