skip to main content
article
Free Access

Slicing as a program transformation

Published:01 April 2007Publication History
Skip Abstract Section

Abstract

The aim of this article is to provide a unified mathematical framework for program slicing which places all slicing work for sequential programs on a sound theoretical foundation. The main advantage to a mathematical approach is that it is not tied to a particular representation. In fact the mathematics provides a sound basis for any particular representation. We use the WSL (wide-spectrum language) program transformation theory as our framework. Within this framework we define a new semantic relation, semirefinement, which lies between semantic equivalence and semantic refinement. Combining this semantic relation, a syntactic relation (called reduction), and WSL's remove statement, we can give mathematical definitions for backwards slicing, conditioned slicing, static and dynamic slicing, and semantic slicing as program transformations in the WSL transformation theory. A novel technique of “encoding” operational semantics within a denotational semantics allows the framework to handle “operational slicing”. The theory also enables the concept of slicing to be applied to nondeterministic programs. These transformations are implemented in the industry-strength FermaT transformation system.

References

  1. Agrawal, H. and Horgan, J. R. 1990. Dynamic program slicing. SIGPLAN Not. 25, (Jun.), 246--256. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Back, R. J. R. 1980. Correctness preserving program refinements. Mathematical Centre Tracts No. 131, Mathematisch Centrum, Amsterdam.Google ScholarGoogle Scholar
  3. Back, R. J. R. 1988. A calculus of refinements for program derivations. Acta Inf. 25, 593--624. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Back, R. J. R. and von Wright, J. 1990. Refinement concepts formalised in higher-order logic. Formal Aspects Comput. 2, 247--272.Google ScholarGoogle ScholarCross RefCross Ref
  5. Balzer, R. 1969. EXDAMS---EXtendable debugging and monitoring system. In Proceedings of the AFIPS SJCC.Google ScholarGoogle Scholar
  6. Beszedas, A., Farago, C., Szabo, Z. M., Csirik, J., and Gyimothy, T. 2002. Union slices for program maintenance. In 18th International Conference on Software Maintenance (ICSM) (Montreal, Quebec, Oct. 3--6). Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Bilardi, G. and Pingali, K. 1999. The static single assignment form and its computation. Tech. Rep., Cornell University, July. http://www.cs.cornell.edu/Info/Projects/Bernoulli/papers/ssa.ps.Google ScholarGoogle Scholar
  8. Binkley, D., Harman, M., and Danicic, S. 2003. Amorphous program slicing. J. Syst. Softw. 68, (Oct.) 45--64. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Binkley, D. and Gallagher, K. 1996. A survey of program slicing. In Advances in Computers, M. Zelkowitz, ed. Academic Press, San Diego, CA.Google ScholarGoogle Scholar
  10. Bohm, C. and Jacopini, G. 1966. Flow diagrams, Turing machines and languages with only two formation rules. Commun. ACM 9, (May), 366--371. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Canfora, G., Cimitile, A., and de Lucia, A. 1998. Conditioned program slicing. Inf. Softw. Technol. 40, 595--607.Google ScholarGoogle ScholarCross RefCross Ref
  12. Cytron, R., Ferrante, J., Rosen, B. K., Wegman, M. N., and Zadeck, F. K. 1991. Efficiently computing static single assignment form and the control dependance graph. ACM Trans. Program. Lang. Syst. 13, (Jul.), 451--490. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Danicic, S. 1999. Dataflow minimal slicing. Ph.D. thesis, London University.Google ScholarGoogle Scholar
  14. De Lucia., A., Harman, M., Hierons, R., and Krinke, J. 2003. Unions of slices are not slices. In the 7th European Conference on Software Maintenance and Reengineering (Benevento, Italy, Mar.). Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Dijkstra, E. W. 1976. A Discipline of Programming. Prentice-Hall, Englewood Cliffs, NJ. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Forgacs, I. and Gyimothy, T. 1997. An efficient interprocedural slicing method for large programs. In Proceedings of the SEKE, 9th International Conference on Software Engineering and Knowledge Engineering (Madrid, Spain).Google ScholarGoogle Scholar
  17. Harman, M. and Danicic, S. 1997. Amorphous program slicing. In the 5th IEEE International Workshop on Program Comprehension (IWPC) (Dearborn, MI, May). Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Harman, M., Danicic, S., and Hierons, R. M. 2000. ConSIT: A conditioned program slicer. In the 5th IEEE International Conference on Software Maintenance (ICSM) (San Jose, CA, Oct.). Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Harmon, M., Hu, L., Munro, M., and Zhang, X. 2001. GUSTT: An amorphous slicing system which combines slicing and transformation. In Proceedings of the 8th Working Conference on Reverse Engineering (WCRE) (Los Alamitos, CA). Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Horwitz, S., Reps, T., and Binkley, D. 1990. Interprocedural slicing using dependence graphs. ACM Trans. Program. Lang. Syst. 12, (Jan.), 26--60. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Karp, C. R. 1964. Languages with Expressions of Infinite Length. North-Holland, Amsterdam.Google ScholarGoogle Scholar
  22. Korel, B. and Laski, J. 1988. Dynamic program slicing. Inf. Process. Lett. 29, (Oct.), 155--163. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Morgan, C. C. 1994. Programming from Specifications, 2nd ed. Prentice-Hall, Englewood Cliffs, NJ. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Morgan, C. C. and Robinson, K. 1987. Specification statements and refinements. IBM J. Res. Develop. 31. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Pingali, K. and Bilardi, G. 1997. Optimal control dependence computation and the Roman Chariots problem. ACM Trans. Program. Lang. Syst., (May). http://www.cs.cornell.edu/Info/Projects/Bernoulli/papers/toplas97.ps. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Stoy, J. E. 1977. Denotational Semantics: The Scott-Strachy Approach to Programming Language Theory. MIT Press, Cambridge, MA. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Tennet, R. D. 1976. The denotational semantics of programming languages. Commun. ACM 19, (Aug.), 437--453. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. Tip, F. 1995. A survey of program slicing techniques. J. Program. Lang. 3, (Sept.), 121--189.Google ScholarGoogle Scholar
  29. Venkatesh, G. A. 1991. The semantic approach to program slicing. SIGPLAN Not. 26, 107--119. In Proceedings of the SIGPLAN Conference on Programming Language Design and Implementation (Jun. 26--28). Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Ward, M. 1989. Proving program refinements and transformations. Ph.D. thesis, Oxford University. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. Ward, M. 1990. Derivation of a sorting algorithm. Tech. Rep., Durham University. http://www.cse.dmu.ac.uk/~m-ward/martin/papers/foundation2-t.ps.gz.Google ScholarGoogle Scholar
  32. Ward, M. 1993. Abstracting a specification from code. J. Softw. Maintenance Res. Pract. 5, (Jun.), 101--122. http://www.cse.dmu.ac.uk/~m-ward/martin/papers/prog-spec.ps.gz.Google ScholarGoogle ScholarCross RefCross Ref
  33. Ward, M. 1994a. Foundations for a practical theory of program refinement and transformation. Tech. Rep., Durham University. http://www.cse.dmu.ac.uk/~m-ward/martin/papers/foundation2-t.ps.gz.Google ScholarGoogle Scholar
  34. Ward, M. 1994b. Reverse engineering through formal transformation Knuth's Polynomial Addition algorithm. Comput. J. 37, 795--813. http://www.cse.dmu.ac.uk/~m-ward/martin/papers/poly-t.ps.gz.Google ScholarGoogle ScholarCross RefCross Ref
  35. Ward, M. 1995. A definition of abstraction. J. Softw. Maintenance Res. Pract. 7, (Nov.), 443--450. http://www.cse.dmu.ac.uk/~m-ward/martin/papers/abstraction-t.ps.gz. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. Ward, M. 1996. Derivation of data intensive algorithms by formal transformation. IEEE Trans. Softw. Eng. 22, (Sept.), 665--686. http://www.cse.dmu.ac.uk/~m-ward/martin/papers/sw-alg.ps.gz. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. Ward, M. 1999. Assembler to C migration using the FermaT transformation system. In the International Conference on Software Maintenance (Oxford, UK, Aug. 30--Sept. 3). Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. Ward, M. 2000. Reverse engineering from assembler to formal specifications via program transformations. In Proceedings of the 7th Working Conference on Reverse Engineering (Brisbane, Queensland, Australia, Nov. 23--25). http://www.cse.dmu.ac.uk/~m-ward/martin/papers/wcre2000.ps.gz. Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. Ward, M. 2001. The formal transformation approach to source code analysis and manipulation. In the IEEE International Workshop on Source Code Analysis and Manipulation (Florence, Italy, Nov. 10).Google ScholarGoogle ScholarCross RefCross Ref
  40. Ward, M. 2004. Pigs from sausages? Reengineering from assembler to C via FermaT transformations. Sci. Comput. Program. 52, 213--255. Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. Ward, M. and Bennett, K. H. 1995. Formal methods to aid the evolution of software. Int. J. Softw. Eng. Knowl. Eng. 5, 25--47. http://www.cse.dmu.ac.uk/~m-ward/martin/papers/evolution-t.ps.gz.Google ScholarGoogle ScholarCross RefCross Ref
  42. Ward, M., Zedan, H., and Hardcastle, T. 2005. Conditioned semantic slicing via abstraction and refinement in FermaT. In the 9th European Conference on Software Maintenance and Reengineering (CSMR) (Manchester, UK, Mar. 21--23). Google ScholarGoogle ScholarDigital LibraryDigital Library
  43. Weiser, M. 1984a. Program slicing. IEEE Trans. Softw. Eng. 10, (Jul.), 352--357.Google ScholarGoogle ScholarDigital LibraryDigital Library
  44. Weiser, M. 1984b. Programmers use slices when debugging. Commun. ACM 25. (Jul.), 352--357. Google ScholarGoogle ScholarDigital LibraryDigital Library
  45. Yang, H. and Ward, M. 2003. Successful Evolution of Software Systems. Artech House. ISBN 1-58053-349-3. Google ScholarGoogle ScholarDigital LibraryDigital Library
  46. Younger, E. J. and Ward, M. 1993. Inverse engineering is a simple real time program. J. Softw. Maintenance Res. Pract. 6, 197--234. http://www.cse.dmu.ac.uk/~m-ward/martin/papers/eddy-t.ps.gz.Google ScholarGoogle ScholarCross RefCross Ref
  47. Zhang, X., Munro, M., Harman, M., and Hu, L. 2002. Mechanized operational semantics of WSL. In the IEEE International Workshop on Source Code Analysis and Manipulation (SCAM) (Los Alamitos, CA). Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Slicing as a program transformation

      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

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader
      About Cookies On This Site

      We use cookies to ensure that we give you the best experience on our website.

      Learn more

      Got it!