skip to main content
article

Interprocedural slicing using dependence graphs

Published:01 April 2004Publication History
Skip Abstract Section

Abstract

A slice of a program with respect to a program point p and variable x consists of all statements of the program that might affect the value of x at point p. This paper concerns the problem of interprocedural slicing -- generating a slice of an entire program, where the slice crosses the boundaries of procedure calls. To solve this problem, we introduce a new kind of graph to represent programs, called a system dependence graph, which extends previous dependence representations to incorporate collections of procedures (with procedure calls) rather than just monolithic programs. Our main result is an algorithm for interprocedural slicing that uses the new representation.The chief difficulty in interprocedural slicing is correctly accounting for the calling context of a called procedure. To handle this problem, system dependence graphs include some data-dependence edges that represent transitive dependencies due to the effects of procedure calls, in addition to the conventional direct-dependence edges. These edges are constructed with the aid of an auxiliary structure that represents calling and parameter-linkage relationships. This structure takes the form of an attribute grammar. The step of computing the required transitive-dependence edges is reduced to the construction of the subordinate characteristic graphs for the grammar's nonterminals.

References

  1. H. Agrawal. On slicing programs with jump statements. In Conf. on Prog. Lang. Design and Impl., pages 302--312, 1994.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. T. Ball and S. Horwitz. Slicing programs with arbitrary control-flow. In Int. Workshop on Automated and Algorithmic Debugging, pages 206--222, 1993.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. T. Ball and S. K. Rajamani. Bebop: A path-sensitive interprocedural dataflow engine. In Workshop on Prog. Analysis for Softw. Tools and Eng., New York, NY, June 2001. ACM Press.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. U. Bannerjee. Speedup of Ordinary Programs. PhD thesis, Dept. of Comp. Sci., Univ. of Illinois, Urbana, IL, October 1979.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. M. Benedikt, P. Godefroid, and T. Reps. Model checking of unrestricted hierarchical state machines. In ICALP '01, 2001.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. D. Binkley. Multi-Procedure Program Integration. PhD thesis, Comp. Sci. Dept., Univ. of Wisconsin, Madison, WI, August 1991. Tech. Rep. TR-1038.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. D. Binkley. Precise executable interprocedural slices. Let. on Prog. Lang. and Syst., 2:31--45, 1993.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. D. Callahan. The program summary graph and flow-sensitive interprocedural data flow analysis. In Conf. on Prog. Lang. Design and Impl., pages 47--56, New York, NY, 1988. ACM Press.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. D. Callahan, K. D. Cooper, K. Kennedy, and L. Torczon. Interprocedural constant propagation. In Symp. on Comp. Construct., pages 152--161, 1986.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. D.R. Chase, M. Wegman, and F. Zadeck. Analysis of pointers and structures. In Conf. on Prog. Lang. Design and Impl., pages 296--310, New York, NY, 1990. ACM Press.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. J.-D. Choi and J. Ferrante. Static slicing in the presence of goto statements. Trans. on Prog. Lang. and Syst., 16(4):1096--1113, 1994.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. K.D. Cooper and K. Kennedy. Interprocedural side-effect analysis in linear time. In Conf. on Prog. Lang. Design and Impl., pages 57--66, New York, NY, 1988. ACM Press.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. P. Cousot and R. Cousot. Static determination of dynamic properties of recursive procedures. In E. J. Neuhold, editor, Formal Descriptions of Programming Concepts, (IFIP WG 2.2, St. Andrews, Canada, August 1977), pages 237--277. North-Holland, 1978.]]Google ScholarGoogle Scholar
  14. M. Das, S. Lerner, and M. Seigle. ESP: Path-sensitive program verification in polynomial time. In Conf. on Prog. Lang. Design and Impl., pages 57--68, New York, NY, 2002. ACM Press.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. M. B. Dwyer, J. C. Corbett, J. Hatcliff, S. Sokolowski, and H. Zheng. Slicing multi-threaded Java programs: A case study. Tech. Rep. 99-7, Dept. of Comp. and Inf. Sci., Kansas State Univ., Manhattan, KS, February 1999.]]Google ScholarGoogle Scholar
  16. M. Emami, R. Ghiya, and L. Hendren. Context-sensitive interprocedural points-to analysis in the presence of function pointers. In Conf. on Prog. Lang. Design and Impl., New York, NY, 1994. ACM Press.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. J. Ferrante, K. Ottenstein, and J. Warren. The program dependence graph and its use in optimization. Trans. on Prog. Lang. and Syst., 3(9):319--349, 1987.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. G. Goff, K. Kennedy, and C.-W. Tseng. Practical dependence testing. In Conf. on Prog. Lang. Design and Impl., pages 15--29, New York, NY, 1991. ACM Press.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. S. Horwitz, P. Pfeiffer, and T. Reps. Dependence analysis for pointer variables. In Conf. on Prog. Lang. Design and Impl., pages 28--40, New York, NY, 1989. ACM Press.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. S. Horwitz, T. Reps, and D. Binkley. Interprocedural slicing using dependence graphs. Trans. on Prog. Lang. and Syst., 12(1):26--60, January 1990.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. S. Horwitz, T. Reps, and M. Sagiv. Demand interprocedural dataflow analysis. In Symp. on the Found. of Softw. Eng., pages 104--115, New York, NY, October 1995. ACM Press.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. S. Horwitz, T. Reps, and M. Sagiv. Demand interprocedural dataflow analysis. report TR-1283, Comp. Sci. Dept., Univ. of Wisconsin, August 1995. Available at "http://www.cs.wisc.edu/wpis/papers/tr1283r.ps".]]Google ScholarGoogle Scholar
  23. S. Horwitz, T. Reps, M. Sagiv, and G. Rosay. Speeding up slicing. In Symp. on the Found. of Softw. Eng., pages 11--20, New York, NY, December 1994. ACM Press.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. U. Kastens. Ordered attribute grammars. Acta Inf., 13(3):229--256, 1980.]]Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. D.E. Knuth. Semantics of context-free languages. Math. Syst. Theory, 2:127--145, 1968.]]Google ScholarGoogle ScholarCross RefCross Ref
  26. J. Krinke. Static slicing of threaded programs. In Workshop on Prog. Analysis for Softw. Tools and Eng., June 1998.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. S. Kumar and S. Horwitz. Better slicing of programs with jumps and switches. In Colloq on Formal Approaches in Softw. Eng., pages 96--112, 2002.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. J. R. Larus and P. N. Hilfinger. Detecting conflicts between structure accesses. In Conf. on Prog. Lang. Design and Impl., pages 21--34, New York, NY, 1988. ACM Press.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. D. E. Maydan, J. L. Hennessy, and M. S. Lam. Efficient and exact data dependence analysis. In Conf. on Prog. Lang. Design and Impl., pages 1--14, New York, NY, 1991. ACM Press.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. M. Nanda and S. Ramesh. Slicing concurrent programs. In Symp. on Softw. Testing and Analysis, August 2000.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. K. J. Ottenstein and L. M. Ottenstein. The program dependence graph in a software development environment. In Softw. Eng. Symp. on Practical Softw. Dev. Environments, pages 177--184, New York, NY, 1984. ACM Press.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. W. Pugh and D. Wonnacott. Eliminating false data dependences using the Omega test. In Conf. on Prog. Lang. Design and Impl., pages 140--151, New York, NY, 1992. ACM Press.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. G. Ramalingam. Context-sensitive synchronization-sensitive analysis is undecidable. Trans. on Prog. Lang. and Syst., 22(2):416--430, 2000.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. J. Rehof and M. Fähndrich. Type-base flow analysis: From polymorphic subtyping to CFL-reachability. In Symp. on Princ. of Prog. Lang., pages 54--66, New York, NY, 2001. ACM Press.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. T. Reps. Demand interprocedural program analysis using logic databases. In R. Ramakrishnan, editor, Applications of Logic Databases. Kluwer Academic Publishers, 1994.]]Google ScholarGoogle Scholar
  36. T. Reps. Shape analysis as a generalized path problem. In Symp. on Part. Eval. and Semantics-Based Prog. Manip., pages 1--11, New York, NY, June 1995. ACM Press.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. T. Reps. On the sequential nature of interprocedural program-analysis problems. Acta Inf., 33:739--757, 1996.]]Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. T. Reps. Program analysis via graph reachability. Inf. and Softw. Tech., 40(11--12):701--726, November 1998.]]Google ScholarGoogle Scholar
  39. T. Reps. Undecidability of context-sensitive data-dependence analysis. Trans. on Prog. Lang. and Syst., 22(1):162--186, January 2000.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. T. Reps, S. Horwitz, and D. Binkley, U.S. Patent Number 5,161,216, Interprocedural slicing of computer programs using dependence graphs, November 1992.]]Google ScholarGoogle Scholar
  41. T. Reps, S. Horwitz, and M. Sagiv. Precise interprocedural dataflow analysis via graph reachability. In Symp. on Princ. of Prog. Lang., pages 49--61, New York, NY, 1995. ACM Press.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  42. T. Reps and G. Rosay. Precise interprocedural chopping. In Symp. on the Found. of Softw. Eng., New York, NY, October 1995. ACM Press.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  43. T. Reps, M. Sagiv, and S. Horwitz. Interprocedural dataflow analysis via graph reachability. Tech. Rep. TR 94-14, Datalogisk Institut, Univ. of Copenhagen, 1994. Available at "http://www.cs.wisc.edu/wpis/papers/diku-tr94-14.ps".]]Google ScholarGoogle Scholar
  44. M. Sagiv, T. Reps, and S. Horwitz. Precise interprocedural dataflow analysis with applications to constant propagation. Theor. Comp. Sci., 167:131--170, 1996.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  45. M. Sharir and A. Pnueli. Two approaches to interprocedural data flow analysis. In S. S. Muchnick and N. D. Jones, editors, Program Flow Analysis: Theory and Applications, chapter 7, pages 189--234. Prentice-Hall, Englewood Cliffs, NJ, 1981.]]Google ScholarGoogle Scholar
  46. S. Sinha, M. Harrold, and G. Rothermel. System-dependence-graph-based slicing of programs with arbitrary control flow. In Int. Conf. on Softw. Eng., pages 432--441, Wash., DC, 1999. IEEE Comp. Soc.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  47. M. Weiser. Program slicing. In Int. Conf. on Softw. Eng., pages 439--441, Wash., DC, 1981. IEEE Comp. Soc.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  48. M. Weiser. Program slicing. Trans. on Softw. Eng., SE-10(4):352--357, July 1984.]]Google ScholarGoogle ScholarDigital LibraryDigital Library
  49. R. P. Wilson and M. S. Lam. Efficient context-sensitive pointer analysis for C programs. In Conf. on Prog. Lang. Design and Impl., pages 1--12, New York, NY, 1995. ACM Press.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  50. M. J. Wolfe. Optimizing Supercompilers for Supercomputers. PhD thesis, Dept. of Comp. Sci., Univ. of Illinois, Urbana, IL, October 1982.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  51. M. Yannakakis. Graph-theoretic methods in database theory. In Symp. on Princ. of Database Syst., pages 230--242, 1990.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  52. Babich78. Babich, W. A. and Jazayeri, M., "The method of attributes for data flow analysis: Part II. Demand analysis," Acta Informatica 10(3) pp. 265--272 (October 1978).]]Google ScholarGoogle ScholarDigital LibraryDigital Library
  53. Banning79. Banning, J. P., "An efficient way to find the side effects of procedure calls and the aliases of variables," pp. 29--41 in Conference Record of the Sixth ACM Symposium on Principles of Programming Languages, (San Antonio, TX, Jan. 29--31, 1979), ACM, New York (1979).]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  54. Callahan88. Callahan, D., "The program summary graph and flow-sensitive interprocedural data flow analysis," Proceedings of the ACM SIGPLAN 88 Conference on Programming Language Design and Implementation, (Atlanta, GA, June 22--24, 1988), ACM SIGPLAN Notices, (June 1988).]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  55. Cooper88. Cooper, K. D. and Kennedy, K., "Interprocedural side-effect analysis in linear time," Proceedings of the ACM SIGPLAN 88 Conference on Programming Language Design and Implementation, (Atlanta, GA, June 22--24, 1988), ACM SIGPLAN Notices, (June 1988).]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  56. Ferrante87. Ferrante, J., Ottenstein, K., and Warren, J., "The program dependence graph and its use in optimization," ACM Transactions on Programming Languages and Systems 9(3) pp. 319--349 (July 1987).]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  57. Horwitz87. Horwitz, S., Prins, J., and Reps, T., "Integrating non-interfering versions of programs," TR-690, Computer Sciences Department, University of Wisconsin, Madison, WI (March 1987).]]Google ScholarGoogle Scholar
  58. Horwitz88. Horwitz, S., Prins, J., and Reps, T., "Integrating non-interfering versions of programs," pp. 133--145 in Conference Record of the Fifteenth ACM Symposium on Principles of Programming Languages, (San Diego, CA, January 13--15, 1988), ACM, New York (1988).]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  59. Horwitz88a. Horwitz, S., Reps, T., and Binkley, D., "Interprocedural slicing using dependence graphs," TR-756, Computer Sciences Department, University of Wisconsin, Madison, WI (March 1988).]]Google ScholarGoogle Scholar
  60. Kastens80. Kastens, U., "Ordered attribute grammars," Acta Inf. 13(3) pp. 229--256 (1980).]]Google ScholarGoogle ScholarDigital LibraryDigital Library
  61. Knuth68. Knuth, D. E., "Semantics of context-free languages," Math. Syst. Theory 2(2) pp. 127--145 (June 1968).]]Google ScholarGoogle ScholarCross RefCross Ref
  62. Kou77. Kou, L. T., "On live-dead analysis for global data flow problems," Journal of the ACM 24(3) pp. 473--483 (July 1977).]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  63. Kuck72. Kuck, D. J., Muraoka, Y., and Chen, S. C., "On the number of operations simultaneously executable in FORTRAN-like programs and their resulting speed-up," IEEE Trans. on Computers C-21(12) pp. 1293--1310 (December 1972).]]Google ScholarGoogle Scholar
  64. Myers81. Myers, E., "A precise inter-procedural data flow algorithm," pp. 219--230 in Conference Record of the Eighth ACM Symposium on Principles of Programming Languages, (Williamsburg, VA, January 26--28, 1981), ACM, New York (1981).]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  65. Ottenstein84. Ottenstein, K. J. and Ottenstein, L. M., "The program dependence graph in a software development environment," Proceedings of the ACM SIGSOFTISIGPLAN Software Engineering Symposium on Practical Software Development Environments, (Pittsburgh, PA, Apr. 23--25, 1984), ACM SIGPLAN Notices 19(5) pp. 177--184 (May 1984).]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  66. Reps88. Reps, T. and Yang, W., "The semantics of program slicing," Tech. Rep. in preparation, Computer Sciences Department, University of Wisconsin, Madison, WI (Spring 1988).]]Google ScholarGoogle Scholar
  67. Waite83. Waite, W. M. and Goos, G., Compiler Construction, Springer-Verlag, New York (1983).]]Google ScholarGoogle Scholar
  68. Weiser84. Weiser, M., "Program slicing," IEEE Transactions on Software Engineering SE-10(4) pp. 352--357 (July 1984).]]Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Interprocedural slicing using dependence graphs
    Index terms have been assigned to the content through auto-classification.

    Recommendations

    Comments

    Login options

    Check if you have access through your login credentials or your institution to get full access on this article.

    Sign in

    Full Access

    • Published in

      cover image ACM SIGPLAN Notices
      ACM SIGPLAN Notices  Volume 39, Issue 4
      20 Years of the ACM SIGPLAN Conference on Programming Language Design and Implementation 1979-1999: A Selection
      April 2004
      673 pages
      ISSN:0362-1340
      EISSN:1558-1160
      DOI:10.1145/989393
      Issue’s Table of Contents

      Copyright © 2004 Authors

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 1 April 2004

      Check for updates

      Qualifiers

      • article

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader