Complexity of Concrete Type-Inference in the Presence of Exceptions

Concrete type-inference for statically typed object-oriented programming languages (e.g., Java, C++) determines at each program point, those objects to which a reference may refer or a pointer may point during execution. A precise compile-time solution for this problem requires a flow-sensitive analysis. Our new complexity results for concrete type-inference distinguish the difficulty of the intraprocedural and interprocedural problem for languages with combinations of single-level types, exceptions with or without subtyping, and dynamic dispatch. Our results include: The first polynomial-time algorithm for concrete type-inference in the presence of exceptions, which handles Java without threads, and C++; Proofs that the above algorithm is always safe and provably precise on programs with single-level types, exceptions without subtyping, and without dynamic dispatch; Proof that intraprocedural concrete type-inference problem with single-level types and exceptions with subtyping is PSPACE-complete, while the interprocedural problem without dynamic dispatch is PSPACE-hard.

[1]  Jeffrey D. Ullman,et al.  Global Data Flow Analysis and Iterative Algorithms , 1976, J. ACM.

[2]  Bjarne Steensgaard,et al.  Points-to analysis in almost linear time , 1996, POPL '96.

[3]  Guy L. Steele,et al.  The Java Language Specification , 1996 .

[4]  Monica S. Lam,et al.  Efficient context-sensitive pointer analysis for C programs , 1995, PLDI '95.

[5]  William Landi,et al.  Undecidability of static analysis , 1992, LOPL.

[6]  Jeffrey D. Ullman,et al.  Introduction to Automata Theory, Languages and Computation , 1979 .

[7]  Jong-Deok Choi,et al.  Efficient flow-sensitive interprocedural computation of pointer-induced aliases and side effects , 1993, POPL '93.

[8]  Barbara G. Ryder,et al.  Program decomposition for pointer aliasing: a step toward practical analyses , 1996, SIGSOFT '96.

[9]  Jeffrey M. Barth A practical interprocedural data flow analysis algorithm , 1978, CACM.

[10]  Barbara G. Ryder,et al.  Data-Flow-Based Virtual Function Resolution , 1996, SAS.

[11]  Susan Horwitz,et al.  Fast and accurate flow-insensitive points-to analysis , 1997, POPL '97.

[12]  M. Burke,et al.  Eecient Flow-sensitive Interprocedural Computation of Pointer-induced Aliases and Side Eeects , 1993 .

[13]  Barbara G. Ryder,et al.  A safe approximate algorithm for interprocedural aliasing , 1992, PLDI '92.

[14]  Barbara G. Ryder,et al.  Pointer-induced aliasing: a problem classification , 1991, POPL '91.

[15]  Ole Agesen The Cartesian Product Algorithm: Simple and Precise Type Inference Of Parametric Polymorphism , 1995, ECOOP.

[16]  Jens Palsberg,et al.  Object-oriented type inference , 1991, OOPSLA '91.

[17]  Jong-Deok Choi,et al.  Pointer-induced aliasing: a clarification , 1993, SIGP.

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

[19]  Erik Ruf,et al.  Context-insensitive alias analysis reconsidered , 1995, PLDI '95.

[20]  Laurie J. Hendren,et al.  Context-sensitive interprocedural points-to analysis in the presence of function pointers , 1994, PLDI '94.

[21]  William Landi,et al.  Interprocedural aliasing in the presence of pointers , 1992 .

[22]  Andrew A. Chien,et al.  Precise Concrete Type Inference for Object-Oriented Languages , 1994, OOPSLA.