Advertisement

Program specialization via program slicing

  • Thomas Reps
  • Todd Turnidge
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 1110)

Abstract

This paper concerns the use of program slicing to perform a certain kind of program-specialization operation. We show that the specialization operation that slicing performs is different from the specialization operations performed by algorithms for partial evaluation, supercompilation, bifurcation, and deforestation. To study the relationship between slicing and these operations in a simplified setting, we consider the problem of slicing functional programs. We identify two different goals for what we mean by “slicing a functional program” and give algorithms that correspond to each of them.

Keywords

Projection Function Partial Evaluation Original Program Access Path Call Site 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    Ballance, R.A., Maccabe, A.B., and Ottenstein, K.J., “The program dependence web: A representation supporting control-, data-, and demand-driven interpretation of imperative languages,” Proceedings of the ACM SIGPLAN 90 Conference on Programming Language Design and Implementation, (White Plains, NY, June 20-22, 1990), ACM SIGPLAN Notices 25(6) pp. 257–271 (June 1990).Google Scholar
  2. 2.
    Bates, S. and Horwitz, S., “Incremental program testing using program dependence graphs,” pp. 384–396 in Conference Record of the Twentieth ACM Symposium on Principles of Programming Languages, (Charleston, SC, January 10–13, 1993), ACM, New York, NY (1993).Google Scholar
  3. 3.
    Binkley, D., “Using semantic differencing to reduce the cost of regression testing,” Proceedings of the 1992 Conference on Software Maintenance (Orlando, FL, November 9–12, 1992), pp. 41–50 (1992).Google Scholar
  4. 4.
    Cartwright, R. and Felleisen, M., “The semantics of program dependence,” Proceedings of the ACM SIGPLAN 89 Conference on Programming Language Design and Implementation, (Portland, OR, June 21-23, 1989), ACM SIGPLAN Notices 24(7) pp. 13–27 (July 1989).Google Scholar
  5. 5.
    Das, M., Reps, T., and Van Hentenryck, P., “Semantic foundations of binding-time analysis for imperative programs,” pp. 100–110 in Proceedings of the ACM SIGPLAN Symposium on Partial Evaluation and Semantics-Based Program Manipulation (PEPM 95), (La Jolla, California, June 21–23, 1995), ACM, New York, NY (1995).Google Scholar
  6. 6.
    Ferrante, J., Ottenstein, K., and Warren, J., “The program dependence graph and its use in optimization,” ACM Trans. Program. Lang. Syst. 9(3) pp. 319–349 (July 1987).Google Scholar
  7. 7.
    Field, J., “A simple rewriting semantics for realistic imperative programs and its application to program analysis,” Proceedings of the SIGPLAN Workshop on Partial Evaluation and Semantics-Based Program Manipulation, (San Francisco, CA, June 1992), Technical Report YALEU/DCS/RR-909, Department of Computer Science, Yale University, New Haven, CT (1992).Google Scholar
  8. 8.
    Futamura, Y. and Nogi, K., “Generalized partial computation,” pp. 133–152 in Partial Evaluation and Mixed Computation: Proceedings of the IFIP TC2 Workshop on Partial Evaluation and Mixed Computation, (Gammel Avernaes, Denmark, October 18-24, 1987), ed. D. BjΦrner, A.P. Ershov, and N.D. Jones, North-Holland, New York, NY (1988).Google Scholar
  9. 9.
    Gallagher, K.B., “Using program slicing in software maintenance,” Ph.D. dissertation and Tech. Rep. CS-90-05, Computer Science Department, University of Maryland, Baltimore Campus, Baltimore, MD (January 1990).Google Scholar
  10. 10.
    Gallagher, K.B. and Lyle, J.R., “Using program slicing in software maintenance,” IEEE Transactions on Software Engineering SE-17(8) pp. 751–761 (August 1991).Google Scholar
  11. 11.
    Horwitz, S., Pfeiffer, P., and Reps, T., “Dependence analysis for pointer variables,” Proceedings of the ACM SIGPLAN 89 Conference on Programming Language Design and Implementation, (Portland, OR, June 21-23, 1989), ACM SIGPLAN Notices 24(7) pp. 28–40 (July 1989).Google Scholar
  12. 12.
    Horwitz, S., Prins, J., and Reps, T., “Integrating non-interfering versions of programs,” ACM Trans. Program. Lang. Syst. 11(3) pp. 345–387 (July 1989).Google Scholar
  13. 13.
    Horwitz, S., Reps, T., and Binkley, D., “Interprocedural slicing using dependence graphs,” ACM Trans. Program. Lang. Syst. 12(1) pp. 26–60 (January 1990).Google Scholar
  14. 14.
    Horwitz, S., “Identifying the semantic and textual differences between two versions of a program,” Proceedings of the ACM SIGPLAN 90 Conference on Programming Language Design and Implementation, (White Plains, NY, June 20-22, 1990), ACM SIGPLAN Notices 25(6) pp. 234–245 (June 1990).Google Scholar
  15. 15.
    Hughes, J., “Backwards analysis of functional programs,” pp. 187–208 in Partial Evaluation and Mixed Computation: Proceedings of the IFIP TC2 Workshop on Partial Evaluation and Mixed Computation, (Gammel Avernaes, Denmark, October 18-24, 1987), ed. D. BjΦrner, A.P. Ershov, and N.D. Jones, North-Holland, New York, NY (1988).Google Scholar
  16. 16.
    Jones, N.D. and Muchnick, S.S., “Flow analysis and optimization of Lisp-like structures,” pp. 102–131 in Program Flow Analysis: Theory and Applications, ed. S.S. Muchnick and N.D. Jones, Prentice-Hall, Englewood Cliffs, NJ (1981).Google Scholar
  17. 17.
    Jones, N.D., “Automatic program specialization: A reexamination from basic principles,” pp. 225–282 in Partial Evaluation and Mixed Computation: Proceedings of the IFIP TC2 Workshop on Partial Evaluation and Mixed Computation, (Gammel Avernaes, Denmark, October 18-24, 1987), ed. D. BjΦrner, A.P. Ershov, and N.D. Jones, North-Holland, New York, NY (1988).Google Scholar
  18. 18.
    Jones, N.D., Gomard, C.K., and Sestoft, P., Partial Evaluation and Automatic Program Generation, Prentice-Hall International, Englewood Cliffs, NJ (1993).Google Scholar
  19. 19.
    Kuck, D.J., Kuhn, R.H., Leasure, B., Padua, D.A., and Wolfe, M., “Dependence graphs and compiler optimizations,” pp. 207–218 in Conference Record of the Eighth ACM Symposium on Principles of Programming Languages, (Williamsburg, VA, January 26-28, 1981), ACM, New York, NY (1981).Google Scholar
  20. 20.
    Launchbury, J., Projection Factorizations in Partial Evaluation, Cambridge University Press, Cambridge, UK (1991).Google Scholar
  21. 21.
    Liu, Y.A. and Teitelbaum, T., “Caching intermediate results for program improvement,” in Proceedings of the ACM SIGPLAN Symposium on Partial Evaluation and Semantics-Based Program Manipulation (PEPM 95), (La Jolla, California, June 21-23, 1995), ACM, New York, NY (1995).Google Scholar
  22. 22.
    Livadas, P.E. and Rosenstein, A., “Slicing in the presence of pointer variables,” Technical Report SERC-TR-74-F, Software Engineering Research Center, University of Florida, Gainesville, FL (June 1994).Google Scholar
  23. 23.
    Lyle, J. and Weiser, M., “Experiments on slicing-based debugging tools,” in Proceedings of the First Conference on Empirical Studies of Programming, (June 1986), Ablex Publishing Co. (1986).Google Scholar
  24. 24.
    Lyle, J.R., Wallace, D.R., Graham, J.R., Gallagher, K.B., Poole, J.P., and Binkley, D.W., “Unravel: A CASE tool to assist evaluation of high integrity software,” Report NISTIR 5691, National Institute for Standards and Technology, Gaithersburg, MD (August 1995).Google Scholar
  25. 25.
    Mogensen, T., “Partially static structures in a self-applicable partial evaluator,” pp. 325–347 in Partial Evaluation and Mixed Computation: Proceedings of the IFIP TC2 Workshop on Partial Evaluation and Mixed Computation, (Gammel Avernaes, Denmark, October 18-24, 1987), ed. D. BjΦrner, A.P. Ershov, and N.D. Jones, North-Holland, New York, NY (1988).Google Scholar
  26. 26.
    Mogensen, T., “Separating binding times in language specifications,” pp. 12–25 in Fourth International Conference on Functional Programming and Computer Architecture, (London, UK, Sept. 11-13, 1989), ACM Press, New York, NY (1989).Google Scholar
  27. 27.
    Ning, J.Q., Engberts, A., and Kozaczynski, W., “Automated support for legacy code understanding,” Commun. of the ACM 37(5) pp. 50–57 (May 1994).Google Scholar
  28. 28.
    Ottenstein, K.J. and 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, (Pittsburgh, PA, Apr. 23-25, 1984), ACM SIGPLAN Notices 19(5) pp. 177–184 (May 1984).Google Scholar
  29. 29.
    Pfeiffer, P. and Selke, R.P, “On the adequacy of dependence-based representations for programs with heaps,” in Proceedings of the International Conference on Theoretical Aspects of Computer Software (TACS '91), (Sendai, Japan, September 1991), Lecture Notes in Computer Science, Vol. 526, ed. T. Ito and A.R. Meyer, Springer-Verlag, New York, NY (1991).Google Scholar
  30. 30.
    Ramalingam, G. and Reps, T., “Semantics of program representation graphs,” TR-900, Computer Sciences Department, University of Wisconsin, Madison, WI (December 1989).Google Scholar
  31. 31.
    Reps, T. and Yang, W., “The semantics of program slicing and program integration,” pp. 360–374 in Proceedings of the Colloquium on Current Issues in Programming Languages, (Barcelona, Spain, March 13-17, 1989), Lecture Notes in Computer Science, Vol. 352, Springer-Verlag, New York, NY (1989).Google Scholar
  32. 32.
    Reps, T., “Shape analysis as a generalized path problem,” pp. 1–11 in Proceedings of the ACM SIGPLAN Symposium on Partial Evaluation and Semantics-Based Program Manipulation (PEPM 95), (La Jolla, California, June 21-23, 1995), ACM, New York, NY (1995).Google Scholar
  33. 33.
    Reynolds, J.C., “Automatic computation of data set definitions,” pp. 456–461 in Information Processing 68: Proceedings of the IFIP Congress 68, North-Holland, New York, NY (1968).Google Scholar
  34. 34.
    Romanenko, S., “Arity raiser and its use in program specialization,” pp. 341–360 in Proceedings of the Third European Symposium on Programming, (Copenhagen, Denmark, May 15-18, 1990), Lecture Notes in Computer Science, Vol. 432, ed. N. Jones, Springer-Verlag, New York, NY (1990).Google Scholar
  35. 35.
    Selke, R.P, “A rewriting semantics for program dependence graphs,” pp. 12–24 in Conference Record of the Sixteenth ACM Symposium on Principles of Programming Languages, (Austin, TX, Jan. 11-13, 1989), ACM, New York, NY (1989).Google Scholar
  36. 36.
    Sestoft, P., “Automatic call unfolding in a partial evaluator,” pp. 485–506 in Partial Evaluation and Mixed Computation: Proceedings of the IFIP TC2 Workshop on Partial Evaluation and Mixed Computation, (Gammel Avernaes, Denmark, October 18-24, 1987), ed. D. BjΦrner, A.P. Ershov, and N.D. Jones, North-Holland, New York, NY (1988).Google Scholar
  37. 37.
    Tip, F., “A survey of program slicing techniques,” Journal of Programming Languages 3 pp. 121–181(1995).Google Scholar
  38. 38.
    Turchin, V.F., “The concept of a supercompiler,” ACM Trans. Program. Lang. Syst. 8(3) pp. 292–325 (July 1986).Google Scholar
  39. 39.
    Wadler, P. and Hughes, R.J.M., “Projections for strictness analysis,” pp. 385–407 in Third Conference on Functional Programming and Computer Architecture, (Portland, OR, Sept. 14-16, 1987), Lecture Notes in Computer Science, Vol. 274, ed. G. Kahn, Springer-Verlag, New York, NY (1987).Google Scholar
  40. 40.
    Wadler, P., “Deforestation: Transforming programs to eliminate trees,” Theoretical Computer Science 73 pp. 231–248 (1990).Google Scholar
  41. 41.
    Weise, D., Crew, R.F., Ernst, M., and Steensgaard, B., “Value dependence graphs: Representation without taxation,” pp. 297–310 in Conference Record of the Twenty-First ACM Symposium on Principles of Programming Languages, (Portland, OR, Jan. 16-19, 1994), ACM, New York, NY (1994).Google Scholar
  42. 42.
    Weiser, M., “Reconstructing sequential behavior from parallel behavior projections,” Information Processing Letters 17 pp. 129–135 (October 1983).Google Scholar
  43. 43.
    Weiser, M., “Program slicing,” IEEE Transactions on Software Engineering SE-10(4) pp. 352–357 (July 1984).Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1996

Authors and Affiliations

  • Thomas Reps
    • 1
  • Todd Turnidge
    • 1
  1. 1.Computer Sciences DepartmentUniversity of Wisconsin-MadisonMadisonUSA

Personalised recommendations