Browsing by Author "Smith, Daniel"
Now showing 1 - 2 of 2
Results Per Page
Sort Options
Item Completing the Java type system(2008) Smith, Daniel; Cartwright, RobertThe recent introduction of type variables and wildcards to the Java language, while greatly enriching the expressivity of the type system, comes with prohibitions against a variety of natural and useful expressions. Principal among these is the declaration of type variables with lower (" super ") bounds, naturally motivated by the support for such bounds on wildcards. We describe two variations on the Java type system that enhance the current language specification with support for these features. These variations must address the inference of method type arguments, and in so doing improve the inference algorithm so that it is both sound and complete. The first, simpler variation makes use of union types ; the second more closely matches the current Java type system and formalizes its notion of "infinite types," as produced by static analysis.Item Designing type inference for typed object-oriented languages(2010) Smith, Daniel; Cartwright, Robert S.Type-checked object-oriented languages have typically been designed with extremely simple type systems. However, there has recently been intense interest in extending such languages with more sophisticated types and subtyping relationships. JAVA and C# are mainstream languages that have been successfully extended with generic classes and methods; SCALA, FORTRESS, and X10 are new languages that adopt more advanced typing features, such as arrows, tuples, unions, intersections, dependent types, and existentials. Presently, the type inference performed by these languages is unstable and evolving. This thesis explores problems arising in the design of a type inference specification for such languages. We first present a formal description of subtyping in the context of a variety of advanced typing features. We then demonstrate how our formal subtyping algorithm can be easily re-expressed to produce a type inference algorithm, and observe that this algorithm is general enough to address a variety of important type-checking problems. Finally, we apply this theory to a case study of the JAVA language's type system. We express JAVA'S types and inference algorithm in terms of our formal theory and note a variety of opportunities for improvement. We then describe the results of applying an improved type inference implementation to a selection of existing JAVA code, noting that, without introducing significant backwards-incompatibility problems for these programs, we've managed to significantly reduce the need for annotated method invocations.