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.
Similar content being viewed by others
References
Tip F. A survey of program slicing techniques. J Progr Lang, 1995, 3(3): 121–189
Binkley D, Gallagher K B. Program slicing. Advan Comput, 1996, 43: 1–50
Harman M, Hierons R M. An overview of program slicing. Software Focus, 2001, 2(3): 85–92
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
Kamkar M. An overview and comparative classification of program slicing techniques. J Syst Software, 1995, 31(3): 197–214
Chen Z-Q. Technical research on program slicing based on dependence analysis (in Chinese). Dissertation for the Doctoral Degree. Nanjing: Southeast University, 2002
Weiser M. Program slicing. IEEE T Software Eng, 1984, 16(5): 498–509
Ottenstein K J, Ottenstein L M. The program dependence graph in a software development environment. ACM SIGPLAN Not, 1984, 19(5): 177–184
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
Hausler P A. Denotational program slicing. In: 22th Annual Hawaii International Conference on System Sciences. Hawaii: IEEE CS Press, 1989. 486–495
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
Venkatesh G A. The semantic approach to program slicing. ACM SIGPLAN Not, 1991, 26(6): 107–119
Moggi E. Notions of computation and monads. Inform Comput, 1991, 93: 55–92
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
Zhang Y Z, Xu B W. A survey of semantic description frameworks for programming languages. ACM SIGPLAN Not, 2004, 39(3): 14–30
Moggi E. An abstract view of programming languages. LFCS Report, ECS-LFCS-90-113. University of Edinburgh, 1989
Espinosa D. Semantic Lego. Ph.D. Thesis. Columbia: Columbia University, 1995
Liang S. Modular monadic semantics and compilation. Ph.D. Thesis. Yale: University of Yale, 1998
Wadler P. Comprehending monads. In: Kahn G, ed. ACM Conference on Lisp and Functional Programming. Nice, France: ACM Press, 1990. 61–78
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
Wadler P. Monads for functional programming. Lecture Notes on Advanced Functional Programming Techniques. LNCS 925. Berlin: Springer-Verlag, 1995. 24–52
Wansbrough K. A modular monadic action semantics. Master Thesis. Auckland: University of Auckland, 1997
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
Zhang Y Z, Labra J E, del Rio A C. A monadic program slicer. ACM SIGPLAN Not, 2006, 41(5): 30–38
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
Horwitz S, Prins J, Reps T. Integrating non-interfering versions of programs. ACM Trans Program Language System, 1989, 11(3): 345–387
Canfora G, Cimitile A, De Lucia A. Conditioned program slicing. Inform Software Tech, 1998, 40(11/12): 595–607
Harman M, Binkley D, Danicic S. Amorphous program slicing. J Syst Software, 2003, 68(1): 45–64
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
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
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
Author information
Authors and Affiliations
Corresponding author
Additional information
Supported by the Natural Science Research Plan for High School of Jiangsu Province (Grant No. 05KJD520151)
Rights 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
Received:
Accepted:
Issue Date:
DOI: https://doi.org/10.1007/s11432-007-0061-2