Verified Validation of Program Slicing

Program slicing is a well-known program transformation which simplifies a program wrt a given criterion while preserving its semantics. Since the seminal paper published by Weiser in 1981, program slicing is still widely used in various application domains. State of the art program slicers operate over program dependence graphs (PDG), a sophisticated data structure combining data and control dependences. In this paper, we follow the a posteriori validation approach to formally verify (in Coq) a general program slicer. Our validator for program slicing is efficient and validates the results of a run of an unverified program slicer. Program slicing is interesting for a posteriori validation because the correctness proof of program slicing requires to compute new supplementary information from the PDG, thus decoupling the slicing algorithm from its proof. Our semantics-preserving program slicer is integrated into the CompCert formally verified compiler. It operates over an intermediate language of the compiler having the same expressiveness as C. Our experiments show that our formally verified validator scales on large realistic programs.

[1]  David Pichardie,et al.  Formal Verification of a C Value Analysis Based on Abstract Interpretation , 2013, SAS.

[2]  Daniel Wasserrab From formal semantics to verified slicing: a modular framework with applications in language based security , 2011 .

[3]  Santosh Nagarakatte,et al.  Formal verification of SSA-based optimizations for LLVM , 2013, PLDI.

[4]  Chris Okasaki,et al.  Fast Mergeable Integer Maps , 1998 .

[5]  Gilles Barthe,et al.  A Formally Verified SSA-Based Middle-End - Static Single Assignment Meets CompCert , 2012, ESOP.

[6]  Xavier Leroy,et al.  A Formally-Verified C Static Analyzer , 2015, POPL.

[7]  Julien Signoles,et al.  Designing a Generic Graph Library Using ML Functors , 2007, Trends in Functional Programming.

[8]  Benjamin Grégoire,et al.  A Structured Approach to Proving Compiler Optimizations Based on Dataflow Analysis , 2004, TYPES.

[9]  Matthew B. Dwyer,et al.  A new foundation for control dependence and slicing for modern program structures , 2005, TOPL.

[10]  Ken Kennedy,et al.  AS imple, Fast Dominance Algorithm , 1999 .

[11]  Flemming Nielson,et al.  Principles of Program Analysis , 1999, Springer Berlin Heidelberg.

[12]  Steve Zdancewic,et al.  Mechanized Verification of Computing Dominators for Formalizing Compilers , 2012, CPP.

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

[14]  David Cachera,et al.  Extracting a Data Flow Analyser in Constructive Logic , 2004, ESOP.

[15]  Frank Tip,et al.  A survey of program slicing techniques , 1994, J. Program. Lang..

[16]  Xavier Leroy,et al.  Formal verification of translation validators: a case study on instruction scheduling optimizations , 2008, POPL '08.

[17]  George C. Necula,et al.  Translation validation for an optimizing compiler , 2000, PLDI '00.

[18]  Solange Coupet-Grimal,et al.  A Uniform and Certified Approach for Two Static Analyses , 2004, TYPES.

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

[20]  Torben Amtoft,et al.  Slicing for modern program structures: a theory for eliminating irrelevant loops , 2008, Inf. Process. Lett..

[21]  Steven S. Muchnick,et al.  Advanced Compiler Design and Implementation , 1997 .

[22]  David Pichardie,et al.  Formal Verification of Loop Bound Estimation for WCET Analysis , 2013, VSTTE.

[23]  Robert E. Tarjan,et al.  A fast algorithm for finding dominators in a flowgraph , 1979, TOPL.

[24]  Wuu Yang,et al.  The Semantics of Program Slicing and Program Integration , 1989, TAPSOFT, Vol.2.

[25]  Milo M. K. Martin,et al.  Formalizing the LLVM intermediate representation for verified program transformations , 2012, POPL '12.

[26]  Daniel Wasserrab,et al.  Formalizing a Framework for Dynamic Slicing of Program Dependence Graphs in Isabelle/HOL , 2008, TPHOLs.

[27]  Timothy J. Harvey,et al.  AS imple, Fast Dominance Algorithm , 1999 .

[28]  Tobias Nipkow,et al.  A machine-checked model for a Java-like language, virtual machine, and compiler , 2006, TOPL.

[29]  Joe D. Warren,et al.  The program dependence graph and its use in optimization , 1987, TOPL.

[30]  Xavier Leroy,et al.  Formal verification of a realistic compiler , 2009, CACM.

[31]  Tobias Nipkow,et al.  Abstract Interpretation of Annotated Commands , 2012, ITP.

[32]  Pedro Rangel Henriques,et al.  Assertion-based slicing and slice graphs , 2010, 2010 8th IEEE International Conference on Software Engineering and Formal Methods.