Assertion-based slicing and slice graphs

This paper revisits the idea of slicing programs based on their axiomatic semantics, rather than using criteria based on control/data dependencies. We show how the forward propagation of preconditions and the backward propagation of postconditions can be combined in a new slicing algorithm that is more precise than the existing specification-based algorithms. The algorithm is based on (a) a precise test for removable statements, and (b) the construction of a slice graph, a program control flow graph extended with semantic labels and additional edges that “short-circuit” removable commands. It improves on previous approaches in two aspects: it does not fail to identify removable commands; and it produces the smallest possible slice that can be obtained (in a sense that will be made precise). Iteration is handled through the use of loop invariants and variants to ensure termination. The paper also discusses in detail applications of these forms of slicing, including the elimination of (conditionally) unreachable and dead code, and compares them to other related notions.

[1]  K. Rustan M. Leino,et al.  The Spec# Programming System: An Overview , 2004, CASSIS.

[2]  Thomas A. Alspaugh,et al.  An architectural pattern for non-functional dependability requirements , 2005, ACM SIGSOFT Softw. Eng. Notes.

[3]  J. Filliâtre,et al.  ACSL: ANSI/ISO C Specification Language , 2008 .

[4]  Pedro Rangel Henriques,et al.  Assertion-based Slicing and Slice Graphs , 2010, SEFM.

[5]  Yong Rae Kwon,et al.  Program slicing based on specification , 2001, SAC.

[6]  David W. Binkley,et al.  Program slicing , 2008, 2008 Frontiers of Software Maintenance.

[7]  Aniello Cimitile,et al.  Conditioned program slicing , 1998, Inf. Softw. Technol..

[8]  Bor-Yuh Evan Chang,et al.  Boogie: A Modular Reusable Verifier for Object-Oriented Programs , 2005, FMCO.

[9]  Mark Harman,et al.  Pre/post conditioned slicing , 2001, Proceedings IEEE International Conference on Software Maintenance. ICSM 2001.

[10]  C. A. R. Hoare,et al.  An axiomatic basis for computer programming , 1969, CACM.

[11]  Jim Woodcock,et al.  Proceedings of the Third International Symposium of Formal Methods Europe on Industrial Benefit and Advances in Formal Methods , 1996, FME 1996.

[12]  Martin P. Ward Properties of Slicing Definitions , 2009, 2009 Ninth IEEE International Working Conference on Source Code Analysis and Manipulation.

[13]  Bertrand Meyer,et al.  Applying 'design by contract' , 1992, Computer.

[14]  Bernhard Beckert,et al.  The KeY tool , 2005, Software & Systems Modeling.

[15]  J. J. Whelan,et al.  5th international conference on software engineering , 1981, SOEN.

[16]  Cormac Flanagan,et al.  Avoiding exponential explosion: generating compact verification conditions , 2001, POPL '01.

[17]  Johnson M. Hart,et al.  Program Slicing Using Weakest Preconditions , 1996, FME.

[18]  Pedro Rangel Henriques,et al.  GamaSlicer: an online laboratory for program verification and analysis , 2010, LDTA.

[19]  Bill Broyles Notes , 1907, The Classical Review.

[20]  Baowen Xu,et al.  A brief survey of program slicing , 2005, SOEN.

[21]  Michael D. Ernst,et al.  An overview of JML tools and applications , 2003, International Journal on Software Tools for Technology Transfer.

[22]  Edsger W. Dijkstra,et al.  A Discipline of Programming , 1976 .

[23]  Mark Harman,et al.  Backward conditioning: a new program specialisation technique and its application to program comprehension , 2001, Proceedings 9th International Workshop on Program Comprehension. IWPC 2001.

[24]  Jorge Sousa Pinto,et al.  Verification conditions for source-level imperative programs , 2011, Comput. Sci. Rev..