Multiparty Session Types for Safe Runtime Adaptation in an Actor Language (Extended version)

Human fallibility, unpredictable operating environments, and the heterogeneity of hardware devices are driving the need for software to be able to adapt as seen in the Internet of Things or telecommunication networks. Unfortunately, mainstream programming languages do not readily allow a software component to sense and respond to its operating environment, by discovering, replacing, and communicating with components that are not part of the original system design, while maintaining static correctness guarantees. In particular, if a new component is discovered at runtime, there is no guarantee that its communication behaviour is compatible with existing components. We address this problem by using multiparty session types with explicit connection actions, a type formalism used to model distributed communication protocols. By associating session types with software components, the discovery process can check protocol compatibility and, when required, correctly replace components without jeopardising safety. We present the design and implementation of EnsembleS, the first actor-based language with adaptive features and a static session type system, and apply it to a case study based on an adaptive DNS server. We formalise the type system of EnsembleS and prove the safety of well-typed programs, making essential use of recent advances in non-classical multiparty session types. 2012 ACM Subject Classification Software and its engineering → Concurrent programming languages

[1]  Gustavo Alonso,et al.  R-OSGi: Distributed Applications Through Software Modularization , 2007, Middleware.

[2]  Gul A. Agha,et al.  ACTORS - a model of concurrent computation in distributed systems , 1985, MIT Press series in artificial intelligence.

[3]  Nobuko Yoshida,et al.  The Scribble Protocol Language , 2013, TGC.

[4]  Martin May,et al.  The autonomic network architecture (ANA) , 2010, IEEE Journal on Selected Areas in Communications.

[5]  Romain Demangeon,et al.  Nested Protocols in Session Types , 2012, CONCUR.

[6]  Amr Sabry,et al.  The essence of compiling with continuations , 1993, PLDI '93.

[7]  Barry Porter,et al.  REX: A Development Platform and Online Learning Approach for Runtime Emergent Software Systems , 2016, OSDI.

[8]  Atsushi Igarashi,et al.  A generic type system for the Pi-calculus , 2001, POPL '01.

[9]  Wouter Joosen,et al.  LooCI: a loosely-coupled component infrastructure for networked embedded systems , 2009, MoMM.

[10]  Crystal Chang Din,et al.  Session-Based Compositional Analysis for Actor-Based Languages Using Futures , 2016, ICFEM.

[11]  Luca Padovani,et al.  Mailbox Types for Unordered Interactions , 2018, ECOOP.

[12]  Mariangiola Dezani-Ciancaglini,et al.  Self-adaptive multiparty sessions , 2014, Service Oriented Computing and Applications.

[13]  Antonio F. Gómez-Skarmeta,et al.  Light-Weight Multicast DNS and DNS-SD (lmDNS-SD): IPv6-Based Resource and Service Discovery for the Web of Things , 2012, 2012 Sixth International Conference on Innovative Mobile and Internet Services in Ubiquitous Computing.

[14]  Vasco Thudichum Vasconcelos,et al.  Affine Sessions , 2014, COORDINATION.

[15]  Hayo Thielecke,et al.  Modelling environments in call-by-value programming languages , 2003, Inf. Comput..

[16]  David E. Culler,et al.  The dynamic behavior of a data dissemination protocol for network programming at scale , 2004, SenSys '04.

[17]  Dimitrios Kouzapas,et al.  Typechecking protocols with Mungo and StMungo: A session type toolchain for Java , 2017, Sci. Comput. Program..

[18]  Simon Fowler,et al.  An Erlang Implementation of Multiparty Session Actors , 2016, ICE.

[19]  Paul Harvey A linguistic approach to concurrent, distributed, and adaptive programming across heterogeneous platforms , 2015 .

[20]  Luca Padovani,et al.  Global progress for dynamically interleaved multiparty sessions , 2014, Mathematical Structures in Computer Science.

[21]  Frank S. de Boer,et al.  A Complete Guide to the Future , 2007, ESOP.

[22]  Sam Lindley,et al.  Exceptional asynchronous session types: session types without tiers , 2019, Proc. ACM Program. Lang..

[23]  Filippo Visintainer,et al.  Cooperative Systems in Motorway Environment: The Example of Trento Test Site in Italy , 2013 .

[24]  Reiner Hähnle,et al.  ABS: A Core Language for Abstract Behavioral Specification , 2010, FMCO.

[25]  Hridesh Rajan,et al.  Order types: static reasoning about message races in asynchronous message passing concurrency , 2017, AGERE!@SPLASH.

[26]  Philip Wadler,et al.  Featherweight Java: a minimal core calculus for Java and GJ , 2001, TOPL.

[27]  Gianluigi Zavattaro,et al.  Composing Services with JOLIE , 2007, Fifth European Conference on Web Services (ECOWS'07).

[28]  Tao Gu,et al.  Toward an OSGi-based infrastructure for context-aware applications , 2004, IEEE Pervasive Computing.

[29]  Nobuko Yoshida,et al.  A Linear Decomposition of Multiparty Sessions for Safe Distributed Programming , 2017, ECOOP.

[30]  Paul Harvey,et al.  A Virtual Machine for the Insense Language , 2013, 2013 International Conference on MOBILe Wireless MiddleWARE, Operating Systems, and Applications.

[31]  Mario Bravetti,et al.  Adaptable processes , 2011, Log. Methods Comput. Sci..

[32]  Vasco Thudichum Vasconcelos,et al.  Session Typing for a Featherweight Erlang , 2011, COORDINATION.

[33]  Kohei Honda,et al.  Types for Dyadic Interaction , 1993, CONCUR.

[34]  Cinzia Di Giusto,et al.  Disciplined structured communications with disciplined runtime adaptation , 2015, Sci. Comput. Program..

[35]  Julian Rathke,et al.  Dynamic Software Update for Message Passing Programs , 2012, APLAS.

[36]  Felix Wortmann,et al.  Internet of Things , 2015, Business & Information Systems Engineering.

[37]  Robin Milner,et al.  Communicating and mobile systems - the Pi-calculus , 1999 .

[38]  Nobuko Yoshida,et al.  Explicit Connection Actions in Multiparty Session Types , 2017, FASE.

[39]  Ilaria Castellani,et al.  Self-adaptation and secure information flow in multiparty communications , 2016, Formal Aspects of Computing.

[40]  Robert Atkey,et al.  Parameterised notions of computation , 2006, J. Funct. Program..

[41]  Ivan Lanese,et al.  Dynamic Choreographies: Theory And Implementation , 2017, Log. Methods Comput. Sci..

[42]  Mario Bravetti,et al.  Towards the Verification of Adaptable Processes , 2012, ISoLA.

[43]  Carl Hewitt,et al.  A Universal Modular ACTOR Formalism for Artificial Intelligence , 1973, IJCAI.

[44]  Nobuko Yoshida,et al.  Let it recover: multiparty protocol-induced recovery , 2017, CC.

[45]  Andrew Herbert,et al.  Mobile Java objects , 1999, Distributed Syst. Eng..

[46]  Colin S. Gordon Lifting Sequential Effects to Control Operators , 2020, ECOOP.

[47]  Paul Harvey,et al.  Adaptable Actors: Just What The World Needs , 2017, PLOS@SOSP.

[48]  Fritz Hohl,et al.  Mole – Concepts of a mobile agent system , 1999, World Wide Web.

[49]  Vasco Thudichum Vasconcelos,et al.  Language Primitives and Type Discipline for Structured Communication-Based Programming Revisited: Two Systems for Higher-Order Session Communication , 1998, SecReT@ICALP.

[50]  Paul Harvey,et al.  Multiparty Session Types for Safe Runtime Adaptation in an Actor Language (Artifact) , 2021, Dagstuhl Artifacts Ser..

[51]  Nobuko Yoshida,et al.  Multiparty asynchronous session types , 2008, POPL '08.

[52]  Bernardo Toninho,et al.  Combining behavioural types with security analysis , 2015, J. Log. Algebraic Methods Program..

[53]  Nobuko Yoshida,et al.  Multiparty Session Actors , 2014 .

[54]  Jorge A. Pérez,et al.  An Event-Based Approach to Runtime Adaptation in Communication-Centric Systems , 2015, WS-FM.

[55]  Nobuko Yoshida,et al.  Less is more: multiparty session types revisited , 2019, Proc. ACM Program. Lang..