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 jeapordising 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.
翻译:人类的堕落性、不可预测的操作环境以及硬件装置的异质性正在促使软件需要能够适应,正如在Things互联网或电信网络的互联网上所看到的那样。 不幸的是,主流编程语言并不能够通过发现、替换和与不属于原系统设计组成部分的部件进行通信,从而让软件组件能够感知和应对其操作环境,同时保持静态的正确性保障。特别是,如果在运行时发现一个新的部件,则无法保证其通信行为与现有部件相容。我们通过使用多部分会话类型来解决这一问题,包括明确的连接动作,一种用于模式分布式通信协议的型式形式主义。通过将会话类型与软件组件联系起来,发现过程可以检查协议兼容性,并在必要时正确替换部件,而不会损害安全。我们介绍EnsembleS的设计和实施,这是第一个具有适应性特点和静态会话类型系统的基于行为者语言,并应用于基于适应性DNS服务器的案例研究。我们正式建立Ensble S 类型系统,并证明完善型式程序的安全性。