Skip to main content
Log in

A novel formal approach to program slicing

  • Published:
Science in China Series F: Information Sciences Aims and scope Submit manuscript

Abstract

Program slicing is a well-known program analysis technique that extracts the elements of a program related to a particular computation. The current slicing methods, however, are singular (mainly based on a program or system dependence graph), and lack good reusability and flexibility. In this paper, we present a novel formal method for program slicing, modular monadic program slicing, which abstracts the computation of program slicing as a slice monad transformer, and applies it to semantic descriptions of the program analyzed in a modular way, forming the corresponding monadic slicing algorithms. The modular abstraction mechanism allows our slicing method to possess excellent modularity and language-flexibility properties. We also give the related axioms of our slice monad transformer, the proof of the correctness and the implementation of monadic slicing algorithms. We reveal the relations of our algorithms and graph-reachable slicing algorithms.

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. Tip F. A survey of program slicing techniques. J Progr Lang, 1995, 3(3): 121–189

    Google Scholar 

  2. Binkley D, Gallagher K B. Program slicing. Advan Comput, 1996, 43: 1–50

    Article  Google Scholar 

  3. Harman M, Hierons R M. An overview of program slicing. Software Focus, 2001, 2(3): 85–92

    Article  Google Scholar 

  4. Li B X, Zheng G L, et al. An approach to analyzing and understanding program — program slicing. J Comput Res Develop (in Chinese), 2000, 37(3): 284–291

    Google Scholar 

  5. Kamkar M. An overview and comparative classification of program slicing techniques. J Syst Software, 1995, 31(3): 197–214

    Article  Google Scholar 

  6. Chen Z-Q. Technical research on program slicing based on dependence analysis (in Chinese). Dissertation for the Doctoral Degree. Nanjing: Southeast University, 2002

    Google Scholar 

  7. Weiser M. Program slicing. IEEE T Software Eng, 1984, 16(5): 498–509

    Google Scholar 

  8. Ottenstein K J, Ottenstein L M. The program dependence graph in a software development environment. ACM SIGPLAN Not, 1984, 19(5): 177–184

    Article  Google Scholar 

  9. Hwang J C, Du M W, Chou C R. The influence of language semantics on program slices. In: International Conference on Computer Languages. Florida: IEEE CS Press, 1988. 120–127

    Chapter  Google Scholar 

  10. Hausler P A. Denotational program slicing. In: 22th Annual Hawaii International Conference on System Sciences. Hawaii: IEEE CS Press, 1989. 486–495

    Google Scholar 

  11. Ouarbya L, Danicic S, Daoudi M, et al. A denotational interprocedural program slicer. In: Aiken P, ed. 9th IEEE Working Conference on Reverse Engineering, Virginia: IEEE CS Press, 2002. 181–189

    Google Scholar 

  12. Venkatesh G A. The semantic approach to program slicing. ACM SIGPLAN Not, 1991, 26(6): 107–119

    Article  MathSciNet  Google Scholar 

  13. Moggi E. Notions of computation and monads. Inform Comput, 1991, 93: 55–92

    Article  MATH  MathSciNet  Google Scholar 

  14. Mosses P D. Semantics, modularity, and rewriting logic. In: Kirchner C, Kirchner H, eds. 2nd. International Workshop on Rewriting Logic and its Applications. ENTCS 15. Netherlands: Elsevier Press, 1998. 404–421

    Google Scholar 

  15. Zhang Y Z, Xu B W. A survey of semantic description frameworks for programming languages. ACM SIGPLAN Not, 2004, 39(3): 14–30

    Article  Google Scholar 

  16. Moggi E. An abstract view of programming languages. LFCS Report, ECS-LFCS-90-113. University of Edinburgh, 1989

  17. Espinosa D. Semantic Lego. Ph.D. Thesis. Columbia: Columbia University, 1995

    Google Scholar 

  18. Liang S. Modular monadic semantics and compilation. Ph.D. Thesis. Yale: University of Yale, 1998

    Google Scholar 

  19. Wadler P. Comprehending monads. In: Kahn G, ed. ACM Conference on Lisp and Functional Programming. Nice, France: ACM Press, 1990. 61–78

    Chapter  Google Scholar 

  20. Wadler P. The essence of functional programming. In: Sethi R, ed. 19th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages. New Mexico: ACM Press, 1992. 1–14

    Chapter  Google Scholar 

  21. Wadler P. Monads for functional programming. Lecture Notes on Advanced Functional Programming Techniques. LNCS 925. Berlin: Springer-Verlag, 1995. 24–52

    Google Scholar 

  22. Wansbrough K. A modular monadic action semantics. Master Thesis. Auckland: University of Auckland, 1997

    Google Scholar 

  23. Labra J E, Luengo M C, Cueva J M, et al. A language prototyping system using modular monadic semantics. Workshop on Language Definitions, Tools and Applications, LDTA’01, Netherlands, 2001

  24. Zhang Y Z, Labra J E, del Rio A C. A monadic program slicer. ACM SIGPLAN Not, 2006, 41(5): 30–38

    Article  Google Scholar 

  25. Zhang Y Z, Xu B W, Labra J E. A formal method for program slicing. The 16th Australian Software Engineering Conference, ASWEC 2005, Brisbane, Australia, 2005, 140–148

  26. Horwitz S, Prins J, Reps T. Integrating non-interfering versions of programs. ACM Trans Program Language System, 1989, 11(3): 345–387

    Article  Google Scholar 

  27. Canfora G, Cimitile A, De Lucia A. Conditioned program slicing. Inform Software Tech, 1998, 40(11/12): 595–607

    Article  Google Scholar 

  28. Harman M, Binkley D, Danicic S. Amorphous program slicing. J Syst Software, 2003, 68(1): 45–64

    Article  Google Scholar 

  29. Zhang Y Z, Xu B W, Shi L, et al. Modular monadic program slicing. In: Yau S, Cheung P, eds. 28th Annual International Computer Software and Applications Conference, COMPSAC’04. Hong Kong: IEEE CS Press, 2004. 66–71

    Chapter  Google Scholar 

  30. Papaspyrou N S. A resumption monad transformer and its applications in the semantics of concurrency. Technical Report CSD-SW-TR-2-01, National Technical University of Athens, 2001

  31. Wu Z Q, Zhang Y Z, Xu B W. Modular Monadic Slicing in the Presence of Pointers. In: Alexandrov V N, Albada G D, Sloot P M, et al., eds. 6th International Conference on Computational Science. LNCS 3994. Reading UK: Springer-Verlag, 2006. 748–756

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Zhang YingZhou.

Additional information

Supported by the Natural Science Research Plan for High School of Jiangsu Province (Grant No. 05KJD520151)

Rights and permissions

Reprints and permissions

About this article

Cite this article

Zhang, Y. A novel formal approach to program slicing. SCI CHINA SER F 50, 657–670 (2007). https://doi.org/10.1007/s11432-007-0061-2

Download citation

  • Received:

  • Accepted:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s11432-007-0061-2

Keywords

Navigation