Type-base flow analysis: from polymorphic subtyping to CFL-reachability

We present a novel approach to scalable implementation of type-based flow analysis with polymorphic subtyping. Using a new presentation of polymorphic subytping with instantiation constraints, we are able to apply context-free language (CFL) reachability techniques to type-based flow analysis. We develop a CFL-based algorithm for computing flow-information in time O(n³), where n is the size of the typed program. The algorithm substantially improves upon the best previously known algorithm for flow analysis based on polymorphic subtyping with complexity O(n8). Our technique also yields the first demand-driven algorithm for polymorphic subtype-based flow-computation. It works directly on higher-order programs with structured data of finite type (unbounded data structures are incorporated via finite approximations), supports context-sensitive, global flow summariztion and includes polymorphic recursion.

[1]  Jens Palsberg,et al.  Optimal Representations of Polymorphic Types with Subtyping (Extended Abstract) , 1997, TACS.

[2]  Christian Mossin Higher-Order Value Flow Graphs , 1998, Nord. J. Comput..

[3]  John C. Mitchell,et al.  Foundations for programming languages , 1996, Foundation of computing series.

[4]  Geoffrey Smith,et al.  Principal Type Schemes for Functional Programs with Overloading and Subtyping , 1994, Sci. Comput. Program..

[5]  Josef Svenningsson,et al.  A Usage Analysis with Bounded Usage Polymorphism and Subtyping , 2000, IFL.

[6]  Stefan Kaes Type inference in the presence of overloading, subtyping and recursive types , 1992, LFP '92.

[7]  Thomas W. Reps,et al.  Interconvertibility of a class of set constraints and context-free-language reachability , 2000, Theor. Comput. Sci..

[8]  Thomas W. Reps,et al.  Precise interprocedural dataflow analysis via graph reachability , 1995, POPL '95.

[9]  Prateek Mishra,et al.  Polymorphic Subtype Inference: Closing the Theory-Practice Gap , 1989, TAPSOFT, Vol.2.

[10]  François Pottier,et al.  Simplifying subtyping constraints , 1996, ICFP '96.

[11]  Thomas W. Reps,et al.  Program analysis via graph reachability , 1997, Inf. Softw. Technol..

[12]  Matthias Felleisen,et al.  Componential set-based analysis , 1997, TOPL.

[13]  Robert O'Callahan,et al.  Lackwit: A Program Understanding Tool Based on Type Inference , 1997, Proceedings of the (19th) International Conference on Software Engineering.

[14]  Pavel Curtis Constrained qualification in polymorphic type analysis , 1990 .

[15]  Flemming Nielson,et al.  Principles of Program Analysis , 1999, Springer Berlin Heidelberg.

[16]  Nevin Heintze Control-Flow Analysis and Type Systems , 1995, SAS.

[17]  Scott F. Smith,et al.  Subtyping Constrained Types , 1996, SAS.

[18]  Thomas W. Reps,et al.  Undecidability of context-sensitive data-dependence analysis , 2000, TOPL.

[19]  Thomas Reps,et al.  Interconveritibility of Set Constraints and Context-Free Language Reachability , 1997, PEPM.

[20]  Fritz Henglein,et al.  Type inference with polymorphic recursion , 1993, TOPL.

[21]  Fritz Henglein,et al.  Polymorphic Recursion and Subtype Qualifications: Polymorphic Binding-Time Analysis in Polynomial Time , 1995, SAS.

[22]  Mihalis Yannakakis,et al.  Graph-theoretic methods in database theory , 1990, PODS.

[23]  Alan Mycroft,et al.  Polymorphic Type Schemes and Recursive Definitions , 1984, Symposium on Programming.

[24]  Jakob Rehof,et al.  Scalable context-sensitive flow analysis using instantiation constraints , 2000, PLDI '00.

[25]  Thomas W. Reps,et al.  Demand interprocedural dataflow analysis , 1995, SIGSOFT FSE.

[26]  David Melski Interconvertibility of Set Constraints and Context-free Language Reachability 1 , 1996 .

[27]  Jakob Rehof,et al.  From Polymorphic Subtyping to CFL Reachability: Context-Sensitive Flow Analysis Using Instantiation Constraints , 2000 .

[28]  David A. McAllester,et al.  Linear-time subtransitive control flow analysis , 1997, PLDI '97.

[29]  Jakob Rehof Minimal typings in atomic subtyping , 1997, POPL '97.

[30]  Manuel Fähndrich,et al.  Making Set-Constraint Program Analyses Scale , 1996 .

[31]  Alexander Aiken,et al.  Polymorphic versus Monomorphic Flow-Insensitive Points-to Analysis for C , 2000, SAS.

[32]  Scott F. Smith,et al.  Sound polymorphic type inference for objects , 1995, OOPSLA.