A Theory of Slicing for Probabilistic Control Flow Graphs

We present a theory for slicing probabilistic imperative programs—containing random assignment and “observe” statements—represented as control flow graphs whose nodes transform probability distributions. We show that such a representation allows direct adaptation of standard machinery such as data and control dependence, postdominators, relevant variables, etc. to the probabilistic setting. We separate the specification of slicing from its implementation: first we develop syntactic conditions that a slice must satisfy; next we prove that any such slice is semantically correct; finally we give an algorithm to compute the least slice. A key feature of our syntactic conditions is that they involve two disjoint slices such that the variables of one slice are probabilistically independent of the variables of the other. This leads directly to a proof of correctness of probabilistic slicing.

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

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

[3]  David Pichardie,et al.  Verified Validation of Program Slicing , 2015, CPP.

[4]  Chung-Kil Hur,et al.  Slicing probabilistic programs , 2014, PLDI.

[5]  Lori A. Clarke,et al.  A Formal Model of Program Dependences and Its Implications for Software Testing, Debugging, and Maintenance , 1990, IEEE Trans. Software Eng..

[6]  Prakash Panangaden,et al.  Labelled Markov Processes , 2009 .

[7]  Holger Hermanns,et al.  Probabilistic Termination , 2015, POPL.

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

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

[10]  Thomas Ball,et al.  Slicing Programs with Arbitrary Control-flow , 1993, AADEBUG.

[11]  David Monniaux An Abstract Analysis of the Probabilistic Termination of Programs , 2001, SAS.

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

[13]  D. Clark,et al.  Correctness of Slicing Finite State Machines , 2013 .

[14]  Thomas A. Henzinger,et al.  Probabilistic programming , 2014, FOSE.

[15]  Sriram Sankaranarayanan,et al.  Probabilistic Program Analysis with Martingales , 2013, CAV.

[16]  Mark Harman,et al.  A unifying theory of control dependence and its application to arbitrary program structures , 2011, Theor. Comput. Sci..

[17]  Dexter Kozen,et al.  Semantics of probabilistic programs , 1979, 20th Annual Symposium on Foundations of Computer Science (sfcs 1979).

[18]  Joost-Pieter Katoen,et al.  On the Hardness of Almost-Sure Termination , 2015, MFCS.