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

作为无限自相似部分图积的Java子类型

Java Subtyping as an Infinite Self-Similar Partial Graph Product

Moez A. AbdelGawad

摘要:

由于支持变量注释,例如Java类型,Java和其他泛型名义类型的OO程序设计语言中的子类型关系既有趣又复杂。在这些语言中,基础对象类型之间的子类型关系,即,没有类型变量的,是定义完整OO子类型关系的基础,即,包括类型变量。作为类型集合上的排序关系,面向对象程序设计语言中的子类型关系总是可以表示为有向图。为了更好地理解Java中的子类型关系的一些微妙之处,在本文中,我们提出了如何使用两个新的操作(二元操作和一元操作)在有向图上精确地构建地面Java类型之间的子类型关系。我们使用的二元运算称为部分笛卡尔图积,它在本质上类似于标准图积和群积。它的定义特别是基于标准笛卡尔图积的定义。我们相信,在构建基础泛型Java子类型关系时使用图操作揭示了子类型关系的一些不直接明显的结构,不仅在Java中,而且更普遍地,在主流泛型名义类型OO程序设计语言中,如C#,Scala和Kotlin。因此,我们相信,精确地描述图操作可以用来显式地构建这些语言中的子类型关系,正如我们在本文中所做的那样,可以显着提高我们对这些语言的类型系统的特征的理解,如命名类型和方差注释,以及这些特征对名义型OOP中的名义子类型的依赖性。

英文摘要:

Due to supporting variance annotations, such as wildcard types, the subtyping relation in Java and other generic nominally-typed OO programming languages is both interesting and intricate. In these languages, the subtyping relation between ground object types, i.e., ones with no type variables, is the basis for defining the full OO subtyping relation, i.e., that includes type variables. As an ordering relation over the set of types, the subtyping relation in object-oriented programming languages can always be represented as a directed graph. In order to better understand some of the subtleties of the subtyping relation in Java, in this paper we present how the subtyping relation between ground Java types can be precisely constructed using two new operations (a binary operation and a unary one) on directed graphs. The binary operation we use, called a partial Cartesian graph product, is similar in its essence to standard graph products and group products. Its definition is based in particular on that of the standard Cartesian graph product. We believe the use of graph operations in constructing the ground generic Java subtyping relation reveals some of the not-immediately-obvious structure of the subtyping relation not only in Java but, more generally, also in mainstream generic nominally-typed OO programming languages such as C#, Scala and Kotlin. Accordingly, we believe that describing precisely how graph operations can be used to explicitly construct the subtyping relation in these languages, as we do in this paper, may significantly improve our understanding of features of the type systems of these languages such as wildcard types and variance annotations, and of the dependency of these features on nominal subtyping in nominally-typed OOP.

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

↑