Abstract
Mixed-choice has long been barred from models of asynchronous communication since it compromises key properties of communicating finite-state machines. Session types inherit this restriction, which precludes them from fully modelling timeouts – a key programming feature to handle failures. To address this deficiency, we present (binary) TimeOut Asynchronous Session Types (TOAST) as an extension to (binary) asynchronous timed session types to permit mixed-choice. TOAST deploy timing constraints to regulate the use of mixed-choice so as to preserve communication safety. We provide a new behavioural semantics for TOAST which guarantees progress in the presence of mixed-choice. Building upon TOAST, we provide a calculus featuring process timers which is capable of modelling timeouts using a \(\mathtt {receive\text {-}after}\) pattern, much like Erlang, and informally illustrate the correspondence with TOAST specifications.
This work has been partially supported by EPSRC project EP/T014512/1 (STARDUST) and the BehAPI project funded by the EU H2020 RISE under the Marie Sklodowska-Curie action (No: 778233). We thank Simon Thompson and Maurizio Murgia for their insightful comments on an early version of this work.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Similar content being viewed by others
Notes
- 1.
Similar to the queues used by configurations in Sect. 2.2.
References
Alur, R., Dill, D.L.: A theory of timed automata. Theor. Comput. Sci. 126, 183–235 (1994). https://doi.org/10.1016/0304-3975(94)90010-8
Bartoletti, M., Bocchi, L., Murgia, M.: Progress-Preserving refinements of CTA. In: CONCUR. Leibniz International Proceedings in Informatics, vol. 118, pp. 40:1–40:19. Schloss Dagstuhl-Leibniz-Zentrum fuer Informatik (2018). https://doi.org/10.4230/LIPIcs.CONCUR.2018.40
Bartoletti, M., Cimoli, T., Murgia, M.: Timed session types. logical methods in computer science 13(4) (2017). https://doi.org/10.23638/LMCS-13(4:25)2017
Bartoletti, M., Cimoli, T., Pinna, G.M.: A note on two notions of compliance. EPTCS 166, 86–93 (2014). https://doi.org/10.4204/EPTCS.166.9
Berger, M., Yoshida, N.: Timed, distributed, probabilistic, typed processes. In: Shao, Z. (ed.) APLAS 2007. LNCS, vol. 4807, pp. 158–174. Springer, Heidelberg (2007). https://doi.org/10.1007/978-3-540-76637-7_11
Bettini, L., Coppo, M., D’Antoni, L., De Luca, M., Dezani-Ciancaglini, M., Yoshida, N.: Global progress in dynamically interleaved multiparty sessions. In: van Breugel, F., Chechik, M. (eds.) CONCUR 2008. LNCS, vol. 5201, pp. 418–433. Springer, Heidelberg (2008). https://doi.org/10.1007/978-3-540-85361-9_33
Bocchi, L., Lange, J., Thompson, S., Voinea, A.L.: A model of actors and grey failures. In: COORDINATION. Lecture Notes in Computer Science, vol. 13271, pp. 140–158. Springer-Verlag (2022). https://doi.org/10.1007/978-3-031-08143-9_9
Bocchi, L., Langue, J., Yoshida, N.: Meeting deadlines together. In: CONCUR. Leibniz International Proceedings in Informatics, vol. 42, pp. 283–296 (2015). https://doi.org/10.4230/LIPIcs.CONCUR.2015.283
Bocchi, L., Murgia, M., Vasconcelos, V.T., Yoshida, N.: Asynchronous timed session types: from duality to time-sensitive processes. In: ESOP. Lecture Notes in Computer Science, vol. 11423, pp. 583–610. Springer-Verlag (2019). https://doi.org/10.1007/978-3-030-17184-1_21, https://kar.kent.ac.uk/72337/
Bocchi, L., Yang, W., Yoshida, N.: Timed multiparty session types. In: Baldan, P., Gorla, D. (eds.) CONCUR 2014. LNCS, vol. 8704, pp. 419–434. Springer, Heidelberg (2014). https://doi.org/10.1007/978-3-662-44584-6_29
Brand, D., Zafiropulo, P.: On communicating finite-state machines. J. ACM 30(2), 323–342 (1983). https://doi.org/10.1145/322374.322380
Carbone, M., Honda, K., Yoshida, N.: Structured interactional exceptions in session types. In: van Breugel, F., Chechik, M. (eds.) CONCUR 2008. LNCS, vol. 5201, pp. 402–417. Springer, Heidelberg (2008). https://doi.org/10.1007/978-3-540-85361-9_32
Castro, D., Hu, R., Jongmans, S.S., Ng, N., Yoshida, N.: Distributed programming using role-parametric session types in go: statically-typed endpoint APIs for dynamically-instantiated communication structures. In: POPL, vol. 3, pp. 1–30. ACM (2019). https://doi.org/10.1145/3290342
Deniélou, P.-M., Yoshida, N.: Multiparty session types meet communicating automata. In: Seidl, H. (ed.) ESOP 2012. LNCS, vol. 7211, pp. 194–213. Springer, Heidelberg (2012). https://doi.org/10.1007/978-3-642-28869-2_10
Deniélou, P.-M., Yoshida, N.: Multiparty compatibility in communicating automata: characterisation and synthesis of global session types. In: Fomin, F.V., Freivalds, R., Kwiatkowska, M., Peleg, D. (eds.) ICALP 2013. LNCS, vol. 7966, pp. 174–186. Springer, Heidelberg (2013). https://doi.org/10.1007/978-3-642-39212-2_18
Dezani-Ciancaglini, M., de’Liguoro, U., Yoshida, N.: On progress for structured communications. In: Barthe, G., Fournet, C. (eds.) TGC 2007. LNCS, vol. 4912, pp. 257–275. Springer, Heidelberg (2008). https://doi.org/10.1007/978-3-540-78663-4_18
Gouda, M., Manning, E., Yu, Y.: On the progress of communication between two finite state machines. Inf. Control 63(3), 200–216 (1984). https://doi.org/10.1016/S0019-9958(84)80014-5
Honda, K., Yoshida, N., Carbone, M.: Multiparty asynchronous session types. In: POPL, pp. 273–284. ACM (2008). https://doi.org/10.1145/1328438.1328472
Hu, R., Yoshida, N., Honda, K.: Session-based distributed programming in java. In: Vitek, J. (ed.) ECOOP 2008. LNCS, vol. 5142, pp. 516–541. Springer, Heidelberg (2008). https://doi.org/10.1007/978-3-540-70592-5_22
Klensin, J.: SMTP, Request for Comments: 5321 (2008). https://datatracker.ietf.org/doc/html/rfc5321
Krcal, P., Yi, W.: Communicating timed automata: the more synchronous, the more difficult to verify. In: Ball, T., Jones, R.B. (eds.) CAV 2006. LNCS, vol. 4144, pp. 249–262. Springer, Heidelberg (2006). https://doi.org/10.1007/11817963_24
Lagaillardie, N., Neykova, R., Yoshida, N.: Implementing multiparty session types in rust. In: Bliudze, S., Bocchi, L. (eds.) COORDINATION 2020. LNCS, vol. 12134, pp. 127–136. Springer, Cham (2020). https://doi.org/10.1007/978-3-030-50029-0_8
Lagaillardie, N., Neykova, R., Yoshida, N.: Stay safe under panic: affine rust programming with multiparty session types. In: ECOOP. Leibniz International Proceedings in Informatics, Schloss Dagstuhl-Leibniz-Zentrum fuer Informatik (2022). https://doi.org/10.4230/LIPIcs.ECOOP.2022.4
Milner, R.: Communicating and Mobile systems - the Pi-Calculus. Cambridge University Press, Cambridge (1999)
Mostrous, D., Vasconcelos, V.T.: Affine Sessions. Logical Methods in Computer Science 14(4) (2018). https://doi.org/10.23638/LMCS-14(4:14)2018
Neykova, R.: Session types go dynamic or how to verify your Python conversations. EPTCS 137 (2013). https://doi.org/10.4204/EPTCS.137.8
Neykova, R., Hu, R., Yoshida, N., Abdeljallal, F.: A session type provider: compile-time API generation of distributed protocols with refinements in F#. In: CC, pp. 128–138. ACM (2018). https://doi.org/10.1145/3178372.3179495
Neykova, R., Yoshida, N., Hu, R.: SPY: local verification of global protocols. In: Legay, A., Bensalem, S. (eds.) RV 2013. LNCS, vol. 8174, pp. 358–363. Springer, Heidelberg (2013). https://doi.org/10.1007/978-3-642-40787-1_25
Vasconcelos, V.T., Casal, F., Almeida, B., Mordido, A.: Mixed sessions. In: ESOP 2020. LNCS, vol. 12075, pp. 715–742. Springer, Cham (2020). https://doi.org/10.1007/978-3-030-44914-8_26
Yoshida, N., Vasconcelos, V.T.: Language primitives and type discipline for structured communication-based programming revisited: two systems for higher-order session communication. Electron. Notes Theor. Comput. Sci. 171(4), 73–93 (2007). https://doi.org/10.1016/j.entcs.2007.02.056
Yoshida, N., Zhou, F., Ferreira, F.: Communicating finite state machines and an extensible toolchain for multiparty session types. In: Bampis, E., Pagourtzis, A. (eds.) FCT 2021. LNCS, vol. 12867, pp. 18–35. Springer, Cham (2021). https://doi.org/10.1007/978-3-030-86593-1_2
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2023 IFIP International Federation for Information Processing
About this paper
Cite this paper
Pears, J., Bocchi, L., King, A. (2023). Safe Asynchronous Mixed-Choice for Timed Interactions. In: Jongmans, SS., Lopes, A. (eds) Coordination Models and Languages. COORDINATION 2023. Lecture Notes in Computer Science, vol 13908. Springer, Cham. https://doi.org/10.1007/978-3-031-35361-1_12
Download citation
DOI: https://doi.org/10.1007/978-3-031-35361-1_12
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-031-35360-4
Online ISBN: 978-3-031-35361-1
eBook Packages: Computer ScienceComputer Science (R0)