Papers
Topics
Authors
Recent
Gemini 2.5 Flash
Gemini 2.5 Flash
156 tokens/sec
GPT-4o
7 tokens/sec
Gemini 2.5 Pro Pro
45 tokens/sec
o3 Pro
4 tokens/sec
GPT-4.1 Pro
38 tokens/sec
DeepSeek R1 via Azure Pro
28 tokens/sec
2000 character limit reached

Java Subtyping as an Infinite Self-Similar Partial Graph Product (1805.06893v2)

Published 18 May 2018 in cs.PL

Abstract: 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.

Citations (12)

Summary

We haven't generated a summary for this paper yet.