Precise Constraint-Based Type Inference for Java

  • Authors:
  • Tiejun Wang;Scott F. Smith

  • Affiliations:
  • -;-

  • Venue:
  • ECOOP '01 Proceedings of the 15th European Conference on Object-Oriented Programming
  • Year:
  • 2001

Quantified Score

Hi-index 0.00

Visualization

Abstract

Precise type information is invaluable for analysis and optimization of object-oriented programs. Some forms of polymorphism found in object-oriented languages pose significant difficulty for type inference, in particular data polymorphism. Agesen's Cartesian Product Algorithm (CPA) can analyze programs with parametric polymorphism in a reasonably precise and efficient manner, but CPAl oses precision for programs with data polymorphism. This paper presents a precise constraintbased type inference system for Java. It uses Data-Polymorphic CPA (DCPA), a novel constraint-based type inference algorithm which extends CPAwit h the ability to accurately and efficiently analyze data polymorphic programs. The system is implemented for the full Java language, and is used to statically verify the correctness of Java downcasts. Benchmark results are given which show that DCPAi s significantly more accurate than CPAan d the efficiency of DCPAis close to CPA.