Title
An Interval-Based Inference of Variant Parametric Types
Abstract
Variant parametric types represent the successful integration of subtype and parametric polymorphism to support a more flexible subtyping for Java like languages. A key feature that helps strengthen this integration is the use-site variance. Depending on how the fields are used, each variance denotes a covariant, a contravariant, an invariant or a bivariant subtyping. By annotating variance properties on each type argument to a parametric class, programmers can choose various desirable variance properties for each use of the parametric class. Although Java library classes have been successfully refactored to use variant parametric types, these mechanisms are often criticized, due to the difficulty of choosing appropriate variance annotations. Several algorithms have been proposed for automatically refactoring legacy Java code to use generic libraries, but none can support the full flexibility of the use-site variance-based subtyping. This paper addresses this difficulty by proposing a novel interval-based approach to inferring both the variance annotations and the type arguments. Each variant parametric type is regarded as an interval type with two type bounds, a lower bound for writing and an upper bound for reading. We propose a constraint-based inference algorithm that works on a per method basis, as a summary-based analysis.
Year
DOI
Venue
2009
10.1007/978-3-642-00590-9_9
ESOP
Keywords
Field
DocType
appropriate variance annotation,variance property,parametric class,use-site variance,various desirable variance property,variant parametric type,variance annotation,parametric polymorphism,type argument,interval-based inference,variant parametric types,interval type,polymorphism,algorithm design,upper bound,lower bound
Covariance and contravariance,Programming language,Computer science,Theoretical computer science,Type inference,Artificial intelligence,Type variable,Inference,Parametric polymorphism,Parametric statistics,Subtyping,Java,Machine learning
Conference
Volume
ISSN
Citations 
5502
0302-9743
5
PageRank 
References 
Authors
0.43
13
4
Name
Order
Citations
PageRank
Florin Craciun1408.19
Wei-Ngan Chin286863.37
Guanhua He3687.50
Shengchao Qin471162.81