skip to main content
article
Open access

Slicing as a program transformation

Published: 01 April 2007 Publication History

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.
[2]
Back, R. J. R. 1980. Correctness preserving program refinements. Mathematical Centre Tracts No. 131, Mathematisch Centrum, Amsterdam.
[3]
Back, R. J. R. 1988. A calculus of refinements for program derivations. Acta Inf. 25, 593--624.
[4]
Back, R. J. R. and von Wright, J. 1990. Refinement concepts formalised in higher-order logic. Formal Aspects Comput. 2, 247--272.
[5]
Balzer, R. 1969. EXDAMS---EXtendable debugging and monitoring system. In Proceedings of the AFIPS SJCC.
[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).
[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.
[8]
Binkley, D., Harman, M., and Danicic, S. 2003. Amorphous program slicing. J. Syst. Softw. 68, (Oct.) 45--64.
[9]
Binkley, D. and Gallagher, K. 1996. A survey of program slicing. In Advances in Computers, M. Zelkowitz, ed. Academic Press, San Diego, CA.
[10]
Bohm, C. and Jacopini, G. 1966. Flow diagrams, Turing machines and languages with only two formation rules. Commun. ACM 9, (May), 366--371.
[11]
Canfora, G., Cimitile, A., and de Lucia, A. 1998. Conditioned program slicing. Inf. Softw. Technol. 40, 595--607.
[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.
[13]
Danicic, S. 1999. Dataflow minimal slicing. Ph.D. thesis, London University.
[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.).
[15]
Dijkstra, E. W. 1976. A Discipline of Programming. Prentice-Hall, Englewood Cliffs, NJ.
[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).
[17]
Harman, M. and Danicic, S. 1997. Amorphous program slicing. In the 5th IEEE International Workshop on Program Comprehension (IWPC) (Dearborn, MI, May).
[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.).
[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).
[20]
Horwitz, S., Reps, T., and Binkley, D. 1990. Interprocedural slicing using dependence graphs. ACM Trans. Program. Lang. Syst. 12, (Jan.), 26--60.
[21]
Karp, C. R. 1964. Languages with Expressions of Infinite Length. North-Holland, Amsterdam.
[22]
Korel, B. and Laski, J. 1988. Dynamic program slicing. Inf. Process. Lett. 29, (Oct.), 155--163.
[23]
Morgan, C. C. 1994. Programming from Specifications, 2nd ed. Prentice-Hall, Englewood Cliffs, NJ.
[24]
Morgan, C. C. and Robinson, K. 1987. Specification statements and refinements. IBM J. Res. Develop. 31.
[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.
[26]
Stoy, J. E. 1977. Denotational Semantics: The Scott-Strachy Approach to Programming Language Theory. MIT Press, Cambridge, MA.
[27]
Tennet, R. D. 1976. The denotational semantics of programming languages. Commun. ACM 19, (Aug.), 437--453.
[28]
Tip, F. 1995. A survey of program slicing techniques. J. Program. Lang. 3, (Sept.), 121--189.
[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).
[30]
Ward, M. 1989. Proving program refinements and transformations. Ph.D. thesis, Oxford University.
[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.
[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.
[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.
[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.
[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.
[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.
[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).
[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.
[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).
[40]
Ward, M. 2004. Pigs from sausages? Reengineering from assembler to C via FermaT transformations. Sci. Comput. Program. 52, 213--255.
[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.
[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).
[43]
Weiser, M. 1984a. Program slicing. IEEE Trans. Softw. Eng. 10, (Jul.), 352--357.
[44]
Weiser, M. 1984b. Programmers use slices when debugging. Commun. ACM 25. (Jul.), 352--357.
[45]
Yang, H. and Ward, M. 2003. Successful Evolution of Software Systems. Artech House. ISBN 1-58053-349-3.
[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.
[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).

Cited By

View all

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Transactions on Programming Languages and Systems
ACM Transactions on Programming Languages and Systems  Volume 29, Issue 2
April 2007
327 pages
ISSN:0164-0925
EISSN:1558-4593
DOI:10.1145/1216374
Issue’s Table of Contents

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 01 April 2007
Published in TOPLAS Volume 29, Issue 2

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. FermaT
  2. Slicing
  3. formal methods
  4. program transformation
  5. reengineering
  6. reverse engineering

Qualifiers

  • Article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)85
  • Downloads (Last 6 weeks)9
Reflects downloads up to 24 Dec 2024

Other Metrics

Citations

Cited By

View all

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Login options

Full Access

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media