A Subtyping Scheme for Nominal and Structural Types Based on Class Graph Equivalence

研究成果: Conference contribution同行評審

摘要

Subtyping and multiple inheritance are the essential features of oo and component-based programming languages, in particular with the presence of interfaces and contracts. More general, the composability of these constructs admitting the subtype relation powers the reusability, modular, flexibility and reliability of oo-based systems. While nominal classes allow annotation of user intention to the types, operations on interfaces and contracts naturally result structural constructs. Structural types are also necessary if we need the types to have value-semantics, so that they can be transferred around in distributed systems. Building a type system that allows the coexistence of nominal and structural classes, while maintaining the usual subtype relation is critical and challenging. We present a subtyping scheme that encodes a class to a directed and edge-labeled graph, which has the convenience to handle recursive types. The names of a class and its superclasses are encoded as tags to label the edges of the graph, turning the nominal construct into a structural one. This encoding allows us to unify the handling of class relations into graph relations. We define the class representation, canonical form, value-identity and subtype relation in the notion of graphs, and justify our subtyping scheme in the cases of multiple inheritance, class intersection and union. Our scheme is general, easy to implement and compatible with most of the existing oo type systems, providing a solid base for further oo language and tool development.

原文English
主出版物標題ICBTA 2021 - 2021 4th International Conference on Blockchain Technology and Applications
發行者Association for Computing Machinery
頁面151-157
頁數7
ISBN(電子)9781450387460
DOIs
出版狀態Published - 17 12月 2021
事件4th International Conference on Blockchain Technology and Applications, ICBTA 2021 - Virtual, Online, China
持續時間: 17 12月 202119 12月 2021

出版系列

名字ACM International Conference Proceeding Series

Conference

Conference4th International Conference on Blockchain Technology and Applications, ICBTA 2021
國家/地區China
城市Virtual, Online
期間17/12/2119/12/21

指紋

深入研究「A Subtyping Scheme for Nominal and Structural Types Based on Class Graph Equivalence」主題。共同形成了獨特的指紋。

引用此