## Precise constraint-based type inference for Java (2001)

### Cached

### Download Links

- [www.cs.jhu.edu]
- [www.cs.jhu.edu]
- [pl.cs.jhu.edu]
- [www.cs.jhu.edu]
- [www.cs.jhu.edu]
- DBLP

### Other Repositories/Bibliography

Venue: | Lecture Notes in Computer Science |

Citations: | 52 - 6 self |

### BibTeX

@INPROCEEDINGS{Wang01preciseconstraint-based,

author = {Tiejun Wang and Scott F. Smith},

title = {Precise constraint-based type inference for Java},

booktitle = {Lecture Notes in Computer Science},

year = {2001},

pages = {99--117}

}

### Years of Citing Articles

### OpenURL

### Abstract

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 CPA loses 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 CPA with 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 DCPA is significantly more accurate than CPA and the efficiency of DCPA is close to CPA. 1

### Citations

318 | Control-flow Analysis of Higher-Order Languages or Taming Lambda
- Shivers
- 1991
(Show Context)
Citation Context ...For example, a method may apply to arguments of dierent types, and objects of the same class may haveselds assigned with values of dierent types. A monomorphic type inference algorithm such as 0CFA [S=-=hi9-=-1] analyzes each method at the same type across dierent call sites, and lets all objects created from the same class share the same type, resulting in a signicant precison loss on polymorphic programs... |

224 | Type inclusion constraints and type inference
- Aiken, Wimmers
- 1993
(Show Context)
Citation Context ...tances of the framework. Other functional frameworks for polyvariant analysis have been proposed, including [PP98, JW95]. 2.1 The Types Our type system is based on Aiken-Wimmers-style set constraints =-=[AW93]-=-. The types are close to those described in [EST95], which gives set constraints for an object-oriented language. The aforecited paper presents constraints for a toy object-oriented language, I-Loop, ... |

176 | Precise concrete type inference for object oriented languages
- Plevyak, Chien
- 1994
(Show Context)
Citation Context ...contours of CPA and DCPA, we can see that DCPA's eciency is very close to CPA; furthermore, realistic Java applications can be analyzed. 6 Related Work Plevyak and Chien's iterativesow analysis (IFA) =-=[PC94]-=- is a precise constraintbased analysis of object-oriented programs. To the best of our knowledge, IFA is the only system in the literature capable of analyzing data polymorphic programs precisely. IFA... |

130 | Scalable propagation-based call graph construction algorithms - Tip, Palsberg - 2000 |

123 | Practical virtual method call resolution for Java - Sundaresan, Hendren, et al. - 2000 |

115 | Call graph construction in object-oriented languages - Grove, DeFouw, et al. - 1997 |

112 | Componential set-based analysis
- Flanagan, Felleisen
- 1999
(Show Context)
Citation Context ...bage collector will collect them. There are additional constraint-based optimizations which could be included in our system to further improve its performance, including constraint graph minimization =-=[FF97]-=- and precise garbage collection. 5 Experimental Results Benchmark results are presented in Table 5. The following benchmark programs were used: jlex 1 is a lexical analyzer generator; toba 2 is a Java... |

105 | Sound polymorphic type inference for objects
- Eifrig, Smith, et al.
- 1995
(Show Context)
Citation Context ...ks for polyvariant analysis have been proposed, including [PP98, JW95]. 2.1 The Types Our type system is based on Aiken-Wimmers-style set constraints [AW93]. The types are close to those described in =-=[EST95-=-], which gives set constraints for an object-oriented language. The aforecited paper presents constraints for a toy object-oriented language, I-Loop, which diers in some respects from Java. Here we gi... |

75 | A unified treatment of flow analysis in higher-order languages - Jagannathan, Weeks - 1995 |

65 | Pratical experience with an application extractor for java, in - Tip, Laffra, et al. - 1999 |

55 | Concrete type inference: Delivering object-oriented applications
- Agesen
- 1996
(Show Context)
Citation Context ...ithm, and these will be discussed in Section 4. 3 Data Polymorphic Analysis In this section, data polymorphism and our DCPA closure algorithm are dened. 3.1 Motivation Data polymorphism is dened in [A=-=ge96-=-] as the ability of an imperative program variable to hold values of dierent types at run-time. For example, aseld declared to be of type Object in Java can store objects of any class. Hence objects c... |

52 | The cartesian product algorithm - Agesen - 1995 |

43 | From polyvariant flow information to intersection and union types - Palsberg, Pavlopoulou |

23 | A franiework for type inference with subtyping - Pottier - 1998 |

16 |
Modular type-based reverse engineering of parameterized types in Java code
- Duggan
- 1999
(Show Context)
Citation Context ..., his system is fully context-sensitive and always instantiates a type scheme dierently in every dierent context. Duggan has also proposed a system to automatically detect polymorphic Java classes. [D=-=ug99]-=-. His proposal does not appear to be as precise as ours. It is currently not implemented or tested with benchmarks and so its feasibility and performance are unclear. The analysis we produce here is p... |

13 | From polyvariant information to intersection and union types. A substantially revised version of [PP98]. Available at http://www.cs.purdue.edu/homes/palsberg/paper/popl98.ps.gz - Palsberg, Pavlopoulou - 1999 |

10 | Polyvariant flow analysis with constrained types
- Smith, Wang
- 2000
(Show Context)
Citation Context ...nstraint-based type inference that can model parametric polymorphism as well as data polymorphism. This is an object-oriented version of a framework we defined for a functional language with state in =-=[SW00]-=-. We implement 0CFA, CPA and DCPA for the full Java language and get good perPrecise Constraint-Based Type Inference for Java 3 formance. We also make a series of implementation optimizations to gain... |

9 | A uni treatment of analysis in higher-order languages - Jagannathan, Weeks - 1995 |

3 |
Partial online cycle elimination in inclusion constraint graphs
- Fhndrich, Foster, et al.
- 1998
(Show Context)
Citation Context ...itional heuristics to detect when more contours can be safely shared, use of unication in certain special cases to reduce constraint set size, and a novel on-line version of the cycle elimination of [=-=AFFS98]-=-. This paper is the third in a series of papers. Thesrst paper [SW00a] developed the constraint-based framework for polymorphic analysis in a functional setting. The second paper [SW00b] developed the... |

2 |
Optimizing a solver of polymorphism constraints: SEMI
- Callahan
- 1999
(Show Context)
Citation Context ..., our system detects data polymorphism online, and does not need generational iteration. Only benmark results on small programs are reported in [PC94], and its scalability is questionable. O'Callahan =-=[Cal99-=-] has built a system for the analysis of Java bytecode. The system is used for static verication of Java down-casts. His type schemes are much more compact yet less precise than the constraint-based t... |

1 |
Polyvariant analysis with constrained types
- Smith, Wang
- 2000
(Show Context)
Citation Context ...onstraint-based type inference that can model parametric polymorphism as well as data polymorphism. This is an object-oriented version of a framework we dened for a functional language with state in [=-=SW00-=-a]. We give a precise denition of what data polymorphism in object-oriented languages is, and show how DCPA can analyze it eectively. We implement CPA for the full Java language and get good performan... |

1 | Precise inference of polymorphic constrained types (preprint). http://www.cs.jhu.edu/hog/constraints/papers/dcpafoundations. ps.gz
- Smith, Wang
- 2000
(Show Context)
Citation Context ...imination of [AFFS98]. This paper is the third in a series of papers. Thesrst paper [SW00a] developed the constraint-based framework for polymorphic analysis in a functional setting. The second paper =-=[SW00b]-=- developed the mathematical foundation of DCPA, and proved DCPA is type-sound over a simple functional language. The current paper focuses on how the algorithm can be applied in practice to objectorie... |