Skip to main content
Log in

Efficient comparison of program slices

  • Published:
Acta Informatica Aims and scope Submit manuscript

Abstract

Theslice of a program with respect to a componentc is a projection of the program that includes all components that might affect (either directly or transitively) the values of the variables used atc. Slices can be extracted particularly easily from a program representation called a program dependence graph, originally introduced as an intermediate program representation for performing optimizing, vectorizing, and parallelizing transformations. This paper presents a linear-time algorithm for determining whether two slices of a program dependence graph are isomorphic.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  1. Allen, J.R.: Dependence analysis for subscripted variables and its application to program transformations. Ph.D. Thesis, Department of Mathematics Sciences, Rice University, Houston, TX, 1983

    Google Scholar 

  2. Ball, T.: Personal communication 1991

  3. Binkley, D.: Multi-procedure program integration. Ph.D. dissertation and Technical Report 1038, Computer Sciences Department University of Wisconsin, Madison, WI, 1991

    Google Scholar 

  4. Cytron, R., Ferrante, J., Rosen, B.K., Wegman, M.N., Zadeck, K.: An efficient method of computing static single assignment form. Conference Record of the Sixteenth ACM Symposium on Principles of Programming Languages, pp. 25–35, New York, ACM 1989

    Google Scholar 

  5. Ferrante, J., Ottenstein, K., Warren, J.: The program dependence graph and its use in optimization. ACM Trans. Program. Lang. Syst.9(3) 319–349 (1987)

    Google Scholar 

  6. Hoffmann, C.M.: Group-theoretic algorithms and graph isomorphism (Lect. Notes Comput. Sci., Vol. 136). Berlin Heidelberg New York: Springer 1982

    Google Scholar 

  7. Horwitz, S., Prins, J., Reps, T.: On the adequacy of program dependence graphs for representing programs. Conference Record of the 15th ACM Symposium on Principles of Programming Languages, pp. 146–157. New York: ACM 1988

    Google Scholar 

  8. Horwitz, S., Prins, J., Reps, T.: Integrating non-interfering versions of programs. ACM Trans. Program. Lang. Systems11(3), 345–387 (1989)

    Google Scholar 

  9. Horwitz, S.: Identifying the semantic and textual differences between two versions of a program. Proceedings of the SIGPLAN 90 Conference on Programming Language Design and Implementation. ACM SIGPLAN Notices25(6), 234–246 1990

    Google Scholar 

  10. Horwitz, S., Reps, T., Binkley, D.: Interprocedural slicing using dependence graphs. ACM Trans. Program. Lang. Systems12(1), 26–60 (1990)

    Google Scholar 

  11. Kuck, D.J., Muraoka, Y., Chen, S.C.: On the number of operations simultaneously executable in FORTRAN-like programs and their resulting speed-up. IEEE Trans. Comput.C-21, 1293–1310 (1972)

    Google Scholar 

  12. Luks, E.: Isomorphism of bounded valence can be tested in polynomial time. Proceedings of the Twenty-First IEEE Symposium on Foundations of Computer Science, pp. 42–49. Washington, DC: IEEE Computer Society 1980

    Google Scholar 

  13. Ottenstein, K.J., Ottenstein, L.M.: The program dependence graph in a software development environment. Proceedings of the ACM SIGSOFT/SIGPLAN Software Engineering Symposium on Practical Software Development Environments. ACM SIGPLAN Notices19(5), 177–184 (1984)

    Google Scholar 

  14. Reps, T., Yang, W.: The semantics of program slicing. Technical Report 777, Department of Computer Sciences, University of Wisconsin, Madison, WI, 1988

    Google Scholar 

  15. Reps, T.: Demonstration of a prototype tool for program integration. Technical Report 819, Department of Computer Sciences, University of Wisconsin, Madison, WI, 1989

    Google Scholar 

  16. Reps, T.: The Wisconsin program-integration system reference manual. Unpublished document. Computer Sciences Department, University of Wisconsin, Madison, WI, 1990

    Google Scholar 

  17. Reps, T.: Algebraic properties of program integration. Sci. Comput. Program. In press

  18. Weiser, M.: Program slicing. IEEE Trans. Software EngeSE-10(4), 352–357 (1984)

    Google Scholar 

  19. Yang, W., Horwitz, S., Reps, T.: Detecting program components with equivalent behaviors. Technical Report 840, Department of Computer Sciences, University of Wisconsin, Madison, WI, 1989

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Additional information

This work was supported in part by a David and Lucile Packard Fellowship for Science and Engineering, by the National Science Foundation under grants DCR-8552602 and CCR-8958530, by the Defense Advanced Research Projects Agency, monitored by the Office of Naval Research under contract N00014-88-K-0590, and by grants from IBM, DEC, Xerox, 3M, Eastman Kodak, and the Cray Research Foundation.

Rights and permissions

Reprints and permissions

About this article

Cite this article

Horwitz, S., Reps, T. Efficient comparison of program slices. Acta Informatica 28, 713–732 (1991). https://doi.org/10.1007/BF01261653

Download citation

  • Received:

  • Issue Date:

  • DOI: https://doi.org/10.1007/BF01261653

Keywords

Navigation