MODULAR SESSION TYPES FOR OBJECTS

被引:12
作者
Gay, Simon J. [1 ]
Gesbert, Nils [2 ]
Ravara, Antonio [3 ]
Vasconcelos, Vasco T. [4 ]
机构
[1] Univ Glasgow, Glasgow G12 8QQ, Lanark, Scotland
[2] Grenoble INP Ensimag, Grenoble, France
[3] Univ Nova Lisboa, P-1200 Lisbon, Portugal
[4] Univ Lisbon, Lisbon, Portugal
基金
英国工程与自然科学研究理事会;
关键词
typestate; session types; object-oriented calculus; Non-uniform method availability; CHECKING; LANGUAGE; STATE;
D O I
10.2168/LMCS-11(4:12)2015
中图分类号
TP301 [理论、方法];
学科分类号
081202 ;
摘要
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 semantics, 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.
引用
收藏
页数:76
相关论文
共 76 条
[1]  
Aldrich J., 2009, P ONW
[2]  
Almeida PS, 1997, LECT NOTES COMPUT SC, V1241, P32, DOI 10.1007/BFb0053373
[3]  
Ancona D., 2014, BETTY WG3 LANGUAGES
[4]  
BAKER HG, 1995, SIGPLAN NOTICES, V30, P45, DOI 10.1145/199818.199860
[5]  
Beckman NE, 2008, OOPSLA 2008 NASHVILLE, CONFERENCE PROCEEDINGS, P227
[6]  
Bernardi G., 2014, COMMUNICATION
[7]  
Bierhoff K, 2009, LECT NOTES COMPUT SC, V5653, P195, DOI 10.1007/978-3-642-03013-0_10
[8]  
Bierhoff K, 2008, ICSE'08 PROCEEDINGS OF THE THIRTIETH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING, P971
[9]  
Bierhoff K, 2007, OOPSLA: 22ND INTERNATIONAL CONFERENCE ON OBJECT-ORIENTED PROGRAMMING, SYSTEMS, LANGUAGES, AND APPLICATIONS, PROCEEDINGS, P301
[10]  
Bierhoff Kevin., 2005, ACM SIGSOFT Software Engineering Notes, V30, P217