arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1205.5344cs.PL
收藏

对象的模块化会话类型

Modular session types for objects

Simon J. Gay, Nils Gesbert, António Ravara, Vasco T. Vasconcelos

摘要:

会话类型允许指定通信协议的类型--理论上,这样就可以通过静态类型检查来验证协议实现。我们扩展了以前的工作,分布式面向对象语言的会话类型在三个方面。(1)我们将会话类型附加到类定义,以指定方法调用的可能序列。(2)我们允许会话类型(协议)实现模块化,即划分为可单独调用的方法。(3)我们将会话类型的通信通道视为对象,将它们的会话类型与类的会话类型集成在一起。其结果是一个优雅的统一的通信渠道和他们的会话类型,分布式面向对象编程,和一种形式的typestate支持非统一的对象,即对象,动态改变可用的方法集。我们定义了语法,操作se-mantics,一个健全的类型系统,和一个健全的和完整的类型检查算法的一个小的分布式的基于类的面向对象的语言与结构子类型。静态类型保证通道上的消息序列和对象上的方法调用序列都符合类型理论规范,从而确保类型安全。该语言包括会话类型的预期特性,如委托,以及面向对象编程的预期特性,如本地状态的封装。

英文摘要:

Session types allow communication protocols to be specified type-theoretically so that protocol implementations can be verified by static type checking. We extend previous work on session types for distributed object-oriented languages in three ways. (1) We attach a session type to a class definition, to specify the possible sequences of method calls. (2) We allow a session type (protocol) implementation to be modularized, i.e. partitioned into separately-callable methods. (3) We treat session-typed communication channels as objects, integrating their session types with the session types of classes. The result is an elegant unification of communication channels and their session types, distributed object-oriented programming, and a form of typestate supporting non-uniform objects, i.e. objects that dynamically change the set of available methods. We define syntax, operational se-mantics, a sound type system, and a sound and complete type checking algorithm for a small distributed class-based object-oriented language with structural subtyping. Static typing guarantees that both sequences of messages on channels, and sequences of method calls on objects, conform to type-theoretic specifications, thus ensuring type-safety. The language includes expected features of session types, such as delegation, and expected features of object-oriented programming, such as encapsulation of local state.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑