Abstract
In this paper we use a program transformational approach to obtain an asymptotically improved may-alias analysis algorithm. We derive an O(N3) time algorithm for computing an intra-procedural flow sensitive may-alias analysis, where N denotes the number of edges in the program control flow graph (CFG). Our algorithm improves the previous O(N5) time algorithm by Hind et al. [19]. Our time complexity improvement comes without any deterioration in space complexity. We also show that for a large subclass of programs in which the in-degree and out-degree of all CFG nodes is bounded by a constant, our algorithm is linear in the sum of the number of edges in the CFG of the program and the size of the output, i.e., the size of the computed alias information, and is therefore asymptotically optimal. Our transformational algorithm derivation technique also leads to a simplified yet precise analysis of time complexity.
Similar content being viewed by others
References
Aho, A., Hopcroft, J., and Ullman, J. Design and Analysis of Computer Algorithms. Addison-Wesley, Reading, MA, 1974.
Aho, A.V., Sethi, R., and Ullman, J.D. Compilers: Principles, Techniques, and Tools. Addison Wesley, 1988.
Birkhoff, G. Lattice Theory. American Mathematical Society, Providence, 1966.
Bloom, B. Ready simulation, bisimulation, and the semantics of CCS-like languages. PhD thesis, Massachusets Institute of Technology, 1989.
Burke, M. An interval-based approach to exhaustive and incremental interprocedural data-flow analysis. ACM Transactions on Programming Languages and Systems, 12(3) (1990) 341–395.
Cai, J. Fixed point computation and transformational programming. Technical Report DCS-TR-217, The State University of New Jersey, Rutgers, 1987. PhD. Thesis.
Cai, J. and Paige, R. Binding performance at language design time. In Proc. Fourteenth ACM Symp. on Principles of Programming Languages, Jan. 1987, pp. 85–97.
Cai, J. and Paige, R. Program derivation by fixed point computation. Science of Computer Programming, 11 (1988/89) 197–261.
Chase, D.R., Wegman, M., and Zadeck, F.K. Analysis of pointers and structures. In SIGPLAN’90 Conference on Programming Language Design and Implementation, 1990, pp. 296–310.
Choi, J.D., Burke, M., and Carini, P. Automatic construction of sparse data flow evaluation graphs. In 18th Annual ACM Symposium on Principles of Programming Languages, 1991, pp. 55–66.
Choi, J.D., Burke, M., and Carini, P. Efficient flow-sensitive interprocedural computation of pointer-induced aliases and side-effects. In 20th SIGACT-SIGPLAN ACM Symposium on the Principles of Programming Languages, 1993, pp. 232–245.
Choi, J.D. Gupta, M. Serrano, M., Sreedhar, V.C., and Midkiff, S. Escape analysis for Java. In Conference on Object-Oriented Programming Systems, Languages, and Applications, Nov. 1999.
Cousot, P. Asynchronous iterative methods for solving a fixed point system of monotone equations in a complete lattice. Res. rep. R.R. 88, Laboratoire IMAG, Université scientifique et médicale de Grenoble, Grenoble, France, Sep. 1977. 15 p.
Dewar, R., Grand, A., Liu, S., and Schwartz, J. Programming by refinement, as exemplified by the SETL representation sublanguage. TOPLAS, 1(1) (1979) 27–49.
Driscoll, J.R., Sarnak, N., Sleator, D.D., and Tarjan, R.E. Making data structures persistent. Journal of Computer and System Sciences, 38(1) (1989).
Earley, J. High level iterators and a method for automatically designing data structure representation. J. of Computer Languages, 1(4) (1976) 321–342.
Goyal, D. A language-theoretic approach to algorithms. PhD thesis, Computer Science Department, New York University, January 2000. available at http://cs.nyu.edu/deepak/ThinThesis.ps.
Hind, M. Pointer analysis: Haven’t we solved this problem yet? In 2001 ACM SIGPLAN-SIGSOFT Workshop on Program Analysis for Software Tools and Engineering (PASTE’01), Snowbird, Utah, June 2001.
Hind, M., Burke, M., Carini, P., and Choi, J.D. Interprocedural pointer alias analysis. ACM TOPLAS, 21(4) (1999) 848–894.
Horwitz, S., Pfeiffer, P., and Reps, T. Dependence analysis for pointer variables. In Programming Language Design and Implementation, 1989, pp. 28–40.
Kam, J.B. and Ullman, J.D. Monotone data flow analysis frameworks. Acta Informatica, 7 (1977) 305–317.
Kildall, G.A. A unified approach to global program optimization. In ACM Symp. on Principles of Prog. Lang., 1973, pp. 194–206.
Landi, W. Undecidability of static analysis. ACM Letters on Programming Languages and Systems, 1(4) (1992) 323–337.
Larus, J.R. and Hilfinger, P.N. Detecting conflicts between structure accesses. In Programming Language Design and Implementation, 1988, pp. 21–34.
Lassez, J.-L., Nguyen, V.L., and Sonenberg, L. Fixed point theorems and semantics: A folk tale. Information Processing Letters, 14(3) (1982) 112–116.
Paige, R. Formal differentiation: A program synthesis technique. UMI Research Press, 1981. Revision of Ph.D. thesis, NYU, Jun 1979.
Paige, R. and Koenig, S. Finite differencing of computable expressions. ACM Trans. on Programming Languages and Systems, 4(3) (1982) 401–454.
Paige, R., Tarjan, R., and Bonic, R. A linear time solution to the single function coarsest partition problem. Theoretical Computer Science, 40(1) (1985) 67–84.
Ramalingam, G. The undecidability of aliasing. ACM Transactions on Programming Languages and Systems, 16(6) (1994) 1467–1471.
Schonberg, E., Schwartz, J., and Sharir, M. An automatic technique for selection of data representations in SETL programs. ACM TOPLAS, 3(2) (1981) 126–143.
Schwartz, J. On Programming: An Interim Report on the SETL Project, Installments I and II. New York University, New York, 1974.
Schwartz, J., Dewar, R., Dubinsky, E., and Schonberg, E. Programming with Sets: An Introduction to SETL. Springer-Verlag, New York, 1986.
Steensgaard, B. Points-to analysis in almost linear time. In 23rd SIGACT-SIGPLAN ACM Symposium on the Principles of Programming Languages, 1996, pp. 32–41.
Suppes, P. Axiomatic Set Theory. Dover, 1972.
Tarski, A. A lattice-theoretical fixpoint theorem and its application. Pacific J. of Mathematics, 5 (1955) 285–309.
Author information
Authors and Affiliations
Corresponding author
Additional information
The work in this paper was done when the author was a graduate student at New York University. This paper was originally submitted when the author was a Research Staff Member at the IBM T.J. Watson Research Center.
Rights and permissions
About this article
Cite this article
Goyal, D. Transformational Derivation of an Improved Alias Analysis Algorithm. Higher-Order Symb Comput 18, 15–49 (2005). https://doi.org/10.1007/s10990-005-7005-6
Issue Date:
DOI: https://doi.org/10.1007/s10990-005-7005-6