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.
Thanks to Gordon Stewart for comments on earlier drafts.
- 2.Amtoft, T., Banerjee, A.: A theory of slicing for probabilistic control flow graphs. Technical Report CIS TR 2015-1, Kansas State University, July 2015. http://people.cis.ksu.edu/~tamtoft/Papers/Amt+Ban:ProbSlice-2015/long.pdf
- 4.Blazy, S., Maroneze, A., Pichardie, D.: Verified validation of program slicing. In: Proceedings of the 2015 Conference on Certified Programs and Proofs, CPP 2015, pp. 109–117. ACM, New York (2015)Google Scholar
- 6.Gordon, A.D., Henzinger, T.A., Nori, A.V., Rajamani, S.K.: Probabilistic programming. In: Dwyer, M.B., Herbsleb, J. (eds.) ICSE, Future of Software Engineering track, FOSE 2014, pp. 167–181. ACM, New York (2014)Google Scholar
- 7.Hur, C.-K., Nori, A.V., Rajamani, S.K., Samuel, S.: Slicing probabilistic programs. In: Pingali, K. (ed.) Proceedings of the 35th ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI 2014, pp. 133–144. ACM, New York (2014)Google Scholar
- 11.Ranganath, V.P., Amtoft, T., Banerjee, A., Hatcliff, J., Dwyer, M.B.: A new foundation for control dependence and slicing for modern program structures. ACM Trans. Program. Lang. Syst. (TOPLAS), 29(5), Aug 2007. (A special issue with extended versions of selected papers from the 14th European Symposium on Programming (ESOP’05))Google Scholar
- 12.Tip, F.: A survey of program slicing techniques. J. Program. Lang. 3, 121–189 (1995)Google Scholar
- 13.Wasserrab, D.: From Formal Semantics to Verified Slicing. Ph.D. thesis, Karlsruher Institut für Technologie (2010)Google Scholar