This Article 
   
 Share 
   
 Bibliographic References 
   
 Add to: 
 
Digg
Furl
Spurl
Blink
Simpy
Google
Del.icio.us
Y!MyWeb
 
 Search 
   
Complexity of Points-To Analysis of Java in the Presence of Exceptions
June 2001 (vol. 27 no. 6)
pp. 481-512

Abstract—At each program point, points-to analysis for statically typed object-oriented programming languages (e.g., Java, C++) determines those objects to which a reference may refer (or a pointer may point) during execution. Points-to analysis is necessary for any semantics-based software tools for object-oriented systems. Our new complexity results for points-to analysis distinguish the difficulty of intraprocedural and interprocedural points-to analyses for languages with combinations of single-level types (i.e., types with data members only of primitive type), exceptions with or without subtyping, and dynamic dispatch. Our results include: 1) The first polynomial-time algorithm for points-to analysis in the presence of exceptions that handles a robust subset of Java without threads and can be applied to C++; 2) proof that the above algorithm is safe, in general, and provably precise on programs with single-level types and exceptions without subtyping, but not dynamic dispatch, thus, this case is in P; 3) proof that an interprocedural points-to analysis problem with single-level types and exceptions with subtyping, but without dynamic dispatch, is PSPACE-hard, while the intraprocedural problem is PSPACE-complete. Other complexity characterizations of points-to analysis in programs without exceptions are presented, including an algorithm with worst-case bound of ${\rm O}(n^5)$, which improves over the ${\rm O}(n^{7})$ worst-case bound achievable from previous approaches of Reps et al. [53] and Landi and Ryder [42].

[1] D. Atkinson and W. Griswold, “The Design of Whole-Program Analysis Tools,” Proc. 18th Int'l Conf. Software Eng., pp. 16–27, 1996.
[2] D. Atkinson and W. Griswold, “Effective Whole-Program Analysis in the Presence of Pointers,” Proc. ACM SIGSOFT '98 Symp. Foundations of Software Eng., pp. 46–55, Nov. 1998.
[3] O. Agesen, “The Cartesian Product Algorithm: Simple and Precise Type Inference of Parametric Polymorphism,” Proc. European Conf. Object-Oriented Programming (ECOOP '95), 1995.
[4] L.O. Andersen, “Program Analysis and Specialization for the C Programming Language,” PhD thesis, DIKU, Univ. of Copenhagen, 1994, also available as DIKU report 94/19.
[5] Jeffrey M. Barth,“A practical interprocedural data-flow analysis algorithm,”Commun. ACM, vol. 21, no. 9, pp. 724–736, Sept. 1978.
[6] M. Burke, P. Carini, J.-D. Choi, and M. Hind, “Flow-Insensitive Interprocedural Alias Analysis in the Presence of Pointers,” Proc. Seventh Int'l Workshop Languages and Compilers for Parallel Computing, pp. 234–250, Aug. 1994.
[7] S. Bates and S. Horwitz, “Incremental Program Testing Using Program Dependence Graphs,” Proc. 20th ACM Symp. Principles of Programming Languages, Jan. 1993.
[8] D.F. Bacon and P.F. Sweeney, “Fast Static Analysis of C++ Virtual Function Calls,” Proc. 11th Ann. Conf. Object-Oriented Programming Systems, Languages, and Applications, pp. 324–341, Oct. 1996.
[9] J.-D. Choi, M. Burke, and P. Carini, “Efficient Flow-Sensitive Interprocedural Computation of Pointer-Induced Aliases and Side Effects,” Proc. 20th Ann. ACM Symp. Principles of Programming Languages, pp. 232-245, Jan. 1993.
[10] R. Chatterjee, “Modular Data-Flow Analysis of Statically Typed Object-Oriented Programming Languages,” PhD thesis, Dept. of Computer Science, Rutgers Univ., Oct. 1999.
[11] P.R. Carini, M. Hind, and H. Srinivasan, “Flow-Sensitive Type Analysis for C++,” Research Report RC 20267, IBM T.J. Watson Research Center, 1995.
[12] B.G. Cooper, “Ambitious Data Flow Analysis of Procedural Programs,” master's thesis, Univ. of Minnesota, May 1989.
[13] D.S. Coutant, “Retargetable High-Level Alias Analysis,” Conf. Record 13th Ann. ACM Symp. Principles of Programming Languages, pp. 110–118, Jan. 1986.
[14] R. Chatterjee and B. Ryder, “Scalable, Flow-Sensitive Type-Inference for Statically Typed O-O Languages,” Technical Report DCS-TR-326, Dept. of Computer Science, Rutgers Univ., 1997.
[15] R. Chatterjee and B.G. Ryder, “Data-Flow-Based Testing of Object-Oriented Libraries,” Technical Report DCS-TR-382, Dept. of Computer Science, Rutgers Univ., Mar. 1999.
[16] R. Chatterjee, B.G. Ryder, and W.A. Landi, “Complexity of Concrete Type-Inference in the Presence of Exceptions,” Proc. European Symp. Programming, pp. 57–74, Apr. 1998.
[17] R. Chatterjee, B. Ryder, and W. Landi, “Relevant Context Inference,” Proc. ACM SIGPLAN/SIGACT Symp. Principles of Programming Languages, 1999.
[18] G. DeFouw, D. Grove, and C. Chambers, “Fast Interprocedural Class Analysis,” Proc. ACM SIGPLAN/SIGACT Symp. Principles of Programming Languages, pp. 222–336, 1998.
[19] A. Diwan, J.E.B. Moss, and K.S. McKinley, “Simple and Effective Analysis of Statically-Typed Object-Oriented Programs,” Proc. 11th Ann. Conf. Object-Oriented Programming Systems, Languages, and Applications, pp. 292–305, Oct. 1996.
[20] M. Emami, R. Ghiya, and L.J. Hendren, “Context-Sensitive Interprocedural Points-to Analysis in the Presence of Function Pointers,” Proc. Conf. Programming Language Design and Implementation, pp. 242-257, 1994.
[21] P. Frankl and O. Iakounenko, “Further Empirical Studies of Test Effectiveness,” Proc. ACM SIGSOFT Sixth Symp. Foundations of Software Eng., SIGSOFT Software Eng. Notes, vol. 23, no. 6, pp. 153-162, Nov. 1998.
[22] P.G. Frankl and S.N Weiss,“An experimental comparison of the effectiveness of branch testing and data flow testing,” IEEE Transactions on Software Engineering, vol. 19, no. 8, Oct. 1993, pp. 774-787.
[23] D. Grove, G. DeFouw, J. Dean, and C. Chambers, “Call Graph Constrction in Object-Oriented Languages,” Proc. ACM SIGPLAN Conf. Object-Oriented Programing Systems, Languages, and Applications (OOPSLA '97), pp. 108–124, Oct. 1997.
[24] R. Ghiya and L. Hendren, “Putting Pointer Analysis to Work,” Conf. Record 25th Ann. ACM SIGACT/SIGPLAN Symp. Principles of Programming Languages, pp. 121–133, 1998.
[25] J. Gil and A. Itai, “The Complexity of Type Analysis of Object Oriented Programs,” Proc. European Conf. Object-Oriented Programming, July 1998.
[26] J. Gosling, B. Joy, and G. Steele, The Java Language Specification, Addison-Wesley, Reading, Mass., 1996.
[27] K. Gallagher and J. Lyle, “Using Program Slicing in Software Maintenance,” IEEE Trans. Software Eng., Aug. 1991, pp. 751-761.
[28] R. Gupta and M.L. Soffa, “Hybrid Slicing: An Approach for Refining Static Slices Using Dynamic Information,” Proc. Third ACM SIGSOFT Symp. Foundations of Software Eng., pp. 29–40, 1996.
[29] C.A. Guarna, “A Technique for Analyzing Pointer and Structure References in Parallel Restructuring Compilers,” Proc. Int'l Conf. Parallel Processing, pp. 212–220, 1988.
[30] W.L. Harrison III and Z. Ammarguellat, “Parcel and Miprac: Parallelizers for Symbolic and Numeric Programs,” Proc. Int'l Workshop Compilers for Parallel Computers, pp. 329–346, Dec. 1990.
[31] M.J. Harrold and N. Ci, “Reuse-Driven Interprocedural Slicing,” Proc. 20th Int'l Conf. Software Eng., pp. 74–83, Apr. 1998.
[32] M. Hutchins, H. Foster, T. Goradia, and T. Ostrand, “Experiments on the Effectiveness of Dataflow- and Controlflow-Based Test Adequacy Criteria,” Proc. Int'l Conf. Software Eng., pp. 191–200, May 1994.
[33] M. Hind and A. Pioli, “Assessing the Effects of Flow Sensitivity on Pointer Alias Analysis,” Proc. Int'l Static Analysis Symp. (SAS '98), pp. 57–81, Sept. 1998.
[34] S. Horwitz, T. Reps, and D. Binkley, “Interprocedural Slicing Using Dependence Graphs,” ACM Trans. Programming Languages and Systems. vol. 12, no. 1, pp. 26-60, Jan. 1990.
[35] M.J. Harrold and M.L. Soffa, “Selecting and Using Data for Integration Testing,” IEEE Software, vol. 8, no. 2, pp. 58–65, Mar. 1991.
[36] M.J. Harrold and M.L. Soffa, "Efficient Computation of Interprocedural Definition-Use Chains," ACM Trans. Programming Languages and Systems, vol. 16, no. 2, pp. 175-204, Mar. 1994.
[37] J.E. Hopcroft and J.D. Ullman, Introduction to Automata Theory, Languages and Computation. Addison-Wesley, Apr. 1979.
[38] J.B. Kam and J.D. Ullman, “Global Data Flow Analysis and Iterative Algorithms,” J. ACM, vol. 23, no. 1, pp. 158–171, 1976.
[39] W.A. Landi, “Interprocedural Aliasing in the Presence of Pointers,” Technical Report LCSR-TR-174 and PhD Thesis, Dept. of Computer Science, Rutgers Univ., 1992.
[40] W.A. Landi, “Undecidability of Static Analysis,” ACM Letters on Programming Languages and Systems, vol. 1, no. 4, pp. 323–337, 1992.
[41] L. Larsen and M.J. Harrold, ”Slicing Object-Oriented Software,” Proc. Int'l Conf. Software Eng., pp. 495–505, Mar. 1996.
[42] W.A. Landi and B.G. Ryder, “Pointer-Induced Aliasing: A Problem Classification,” Proc. ACM SIGPLAN/SIGACT Symp. Principles of Programming Languages, pp. 93–103, Jan. 1991.
[43] W. Landi and B.G. Ryder, "A Safe Approximate Algorithm for Pointer-Induced Aliasing," Proc. ACM SIGPLAN'92 Conf. Programming Language Design and Implementation (PLDI'92), pp. 235-248, 1992. published as SIGPLAN Notices, vol. 27, no. 7.
[44] W. Landi, B.G. Ryder, and S. Zhang, “Interprocedural Modification Side Effect Analysis with Pointer Aliasing,” Proc. ACM SIGPLAN Conf. Programming Language Design and Implementation, pp. 56-67, June 1993.
[45] T.J. Marlowe, W.A. Landi, B.G. Ryder, J. Choi, M. Burke, and P. Carini, “Pointer-Induced Aliasing: A Clarification,” ACM SIGPLAN Notices, vol. 28, no. 9, pp. 67–70, Sept. 1993.
[46] K.J. Ottenstein and L.M. Ottenstein, ”The Program Dependence Graph in a Software Development Environment,” ACM SIGPLAN Notices, vol. 19, no. 5, pp. 177–184, May 1984.
[47] T.J. Ostrand, “Data-Flow Testing with Pointers and Function Calls,” Proc. Pacific Northwest Software Quality Conf., Oct. 1990.
[48] C.H. Papadimitriou, Computational Complexity. Addison-Wesley, 1994.
[49] J. Plevyak and A. Chien, “Precise Concrete Type Inference for Object-Oriented Languages,” Proc. Ninth Ann. Conf. Object-Oriented Programming Systems, Languages, and Applications, pp. 324–340, Oct. 1994.
[50] H.D. Pande, W.A. Landi, and B.G. Ryder, "Interprocedural Def-use Associations for C Systems with Single Level Pointers," IEEE Trans. Software Eng., vol. 20, no. 5, pp. 385-403, May 1994.
[51] H. Pande and B.G. Ryder, “Data-Flow-Based Virtual Function Resolution,” Proc. Third Int'l Symp. Static Analysis, 1996.
[52] J. Palsberg and M. Schwartzbach, “Object-Oriented Type Inference,” Proc. Conf. Object-Oriented Programming Systems, Languages, and Applications, pp. 146–161, Oct. 1991.
[53] T. Reps, S. Horowitz, and M. Sagiv, "Precise Interprocedural Dataflow Analysis via Graph Reachability," Proc. Conf. Record 14th Ann. ACM SIGACT/SIGPLAN Symp. Principles of Programming Languages, Jan. 1995.
[54] C. Ruggieri and T. Murtagh, “Lifetime Analysis of Dynamically Allocated Objects,” Conf. Record 15th Ann. ACM Symp. Principles of Programming Languages, pp. 285–293, Jan. 1988.
[55] M.P. Robillard and G.C. Murphy, “Analyzing Exception Flow in Java Programs,” Proc. ESEC/FSE '99 Seventh European Software Eng. Conf. and Seventh ACM SIGSOFT Symp. Foundations of Software Eng., pp. 322–337, Sept. 1999.
[56] T. Reps and G. Rosay, Precise Interprocedural Chopping SIGSOFT 95: Proc. Third ACM SIGSOFT Symp. the Foundations of Software Eng., Oct. 1995.
[57] E. Ruf, “Context-Insensitive Alias Analysis Reconsidered,” Proc. ACM SIGPLAN Conf. Programming Language Design and Implementation, pp. 13-31, June 1995.
[58] S. Sagiv, N. Francez, M. Rodeh, and R. Wilhelm, “A Logic-Based Approach to Data Flow Analysis,” Proc. Second Int'l Workshop Programming Language Implementation and Logic Programming, pp. 277–292, Aug. 1990.
[59] M. Shapiro and S. Horwitz, “The Effects of the Precision of Pointer Analysis,” Proc. Fourth Int'l Symp. Static Analysis (SAS '97), pp. 16–34, Sept. 1997.
[60] M. Shapiro and S. Horwitz, “Fast and Accurate Flow-Insensitive Points-To Analysis,” Conf. Record 24th Ann. ACM SIGACT/SIGPLAN Symp. Principles of Programming Languages, pp. 1–14, Jan. 1997.
[61] S. Sinha and M.J. Harrold, “Analysis of Programs That Contain Exception Handling Constructs,” Proc. Int'l Conf. Software Maintenance, pp. 348–357, Nov. 1998.
[62] S. Sinha, M.J. Harrold, and G. Rothermel, “System-Dependence-Graph-Based Slicing of Programs with Arbitrary Interprocedural Control Flow,” Proc. 21st Int'l Conf. Software Eng., pp. 432–441, May 1999.
[63] M. Sharir and A. Pnueli, “Two Approaches to Interprocedural Data Flow Analysis,” Program Flow Analysis: Theory and Applications, S. Muchnick and N. Jones, eds., pp. 189–234, 1981.
[64] B. Steensgaard, “Points-To Analysis in Almost Linear Time,” Proc. Symp. Principles of Programming Languages. pp. 32-41, Jan. 1996.
[65] B. Steensgaard, “Points-To Analysis in Almost Linear Time,” Proc. Symp. Principles of Programming Languages. pp. 32-41, Jan. 1996.
[66] N. Suzuki,“Inferring types in Smalltalk,” Proc. Eighth POPL, pp. 187-199, 1981.
[67] P. Tonella, G. Antoniol, R. Fiutern, and E. Merlo, “Flow-Insensitive C++ Pointers and Polymorphism Analysis and Its Application to Slicing,” Proc. 19th Int'l Conf. Software Eng. (ICSE '97), pp. 433–443, 1997.
[68] F. Tip, J.-D. Chio, J. Field, and G. Ramalingam, ”Slicing Class Hierarchies in C++,” Proc. Conf. Object-Oriented Programming Systems, Languages, and Applications, pp. 179–197, Oct. 1996.
[69] F. Tip, “A Survey of Program Slicing Technques,” J. Programming Languages, vol. 3, no. 3, pp. 121–189, 1996.
[70] G.A. Venkatesh,“The semantic approach to program slicing,” Proc. SIGPLAN’91 Conf. Programming Language Design and Implementation, pp. 107-119, June 1991.
[71] W.E. Weihl, ”Interprocedural Data Flow Analysis in the Presence of Pointers, Procedure Variables and Label Variables,” master's thesis, Massachusetts Inst. of Tech nology June 1980.
[72] M. Weiser, “Program Slicing,” IEEE Trans. Software Eng., vol. 10, no. 4, pp. 352–357, July 1984.
[73] E. Weyuker, “More Experience with Data Flow Testing,” IEEE Trans. Software Eng., vol. 19, no. 9, pp. 912–919, Sept. 1994.
[74] R.P. Wilson and M.S. Lam, “Efficient Context-Sensitive Pointer Analysis for C Programs,” Proc. Conf. Programming Language Design and Implementation. pp. 1-12, 1995.
[75] S. Zhang, B.G. Ryder, and W. Landi, “Program Decompositon for Pointer Aliasing: A Step Towards Pratical Analyses,” Proc. Symp. Foundations of Software Eng., pp. 81-92, 1996.
[76] S. Zhang, B.G. Ryder, and W.A. Landi, “Experiments with Combined Analysis for Pointer Aliasing,” Proc. ACM SIGPLAN Workshop Program Analysis and Software Tools for Eng., pp. 11–18, June 1998.

Index Terms:
Points-to analysis, Java, exceptions, complexity.
Citation:
Ramkrishna Chatterjee, Barbara G. Ryder, William A. Landi, "Complexity of Points-To Analysis of Java in the Presence of Exceptions," IEEE Transactions on Software Engineering, vol. 27, no. 6, pp. 481-512, June 2001, doi:10.1109/32.926173
Usage of this product signifies your acceptance of the Terms of Use.