Flexible Polyvariance in Constraint-Based Analyses
Cormac Flanagan · 1999
Existing constraint-based analyses only support a limited form of polyvariance, based on syntactic clues such as let-polymorphism. These analyses become imprecise when the call sites for a particular function are not syntactically obvious, such as in object-oriented method invocations, or when a function is referenced across a module boundary. This paper describes how to extend the constraint-based approach to encompass a much wider range of polyvariance strategies. We achieve this by deferring decisions about when to instantiate constraint schemas to the solution phase, where these decisions can exploit information inferred about the program’s run-time behavior. Our approach yields a polyvariant constraint-based analysis framework parameterized over a strategy for controlling schema instantiation. Instantiations of the framework cover a hierarchy of analyses with different cost/precision tradeoffs. The framework combines the efficiency benefits of staged, constraintbased analyses with the flexible polyvariance strategies of monolithic analysis frameworks. 1