Abstract
Dedicated to the memory of Sebastian Danicic.
We present a theory for slicing imperative probabilistic programs containing random assignments and “observe” statements for conditioning. We represent such programs as probabilistic control-flow graphs (pCFGs) whose nodes modify probability distributions. This allows direct adaptation of standard machinery such as data dependence, postdominators, relevant variables, and so on, to the probabilistic setting. We separate the specification of slicing from its implementation:
(1) first, we develop syntactic conditions that a slice must satisfy (they involve the existence of another disjoint slice such that the variables of the two slices are probabilistically independent of each other);
(2) next, we prove that any such slice is semantically correct;
(3) finally, we give an algorithm to compute the least slice.
To generate smaller slices, we may in addition take advantage of knowledge that certain loops will terminate (almost) always.
Our results carry over to the slicing of structured imperative probabilistic programs, as handled in recent work by Hur et al. For such a program, we can define its slice, which has the same “normalized” semantics as the original program; the proof of this property is based on a result proving the adequacy of the semantics of pCFGs w.r.t. the standard semantics of structured imperative probabilistic programs.
- Torben Amtoft. 2008. Slicing for modern program structures: A theory for eliminating irrelevant loops. Inf. Proc. Lett. 106, 2 (Apr. 2008), 45--51. DOI:https://doi.org/10.1016/j.ipl.2007.10.002Google Scholar
Digital Library
- Torben Amtoft and Anindya Banerjee. 2016. A theory of slicing for probabilistic control flow graphs. In Proceedings of the 19th International Conference on Foundations of Software Science and Computation Structures (FoSSaCS’16) (Lecture Notes in Computer Science), Bart Jacobs and Christof Löding (Eds.), Vol. 9634. Springer-Verlag, 180--196. DOI:https://doi.org/10.1007/978-3-662-49630-5_11Google Scholar
Cross Ref
- Thomas Ball and Susan Horwitz. 1993. Slicing programs with arbitrary control flow. In Proceedings of the 1st International Workshop on Automated and Algorithmic Debugging (AADEBUG’93) (LNCS), Peter Fritzon (Ed.), Vol. 749. Springer-Verlag, London, UK, 206--222. DOI:https://doi.org/10.1007/BFb0019410Google Scholar
Cross Ref
- Richard W. Barraclough, David Binkley, Sebastian Danicic, Mark Harman, Robert M. Hierons, Ákos Kiss, Mike Laurence, and Lahcen Ouarbya. 2010. A trajectory-based strict semantics for program slicing. Theoret. Comput. Sci. 411, 11 (2010), 1372--1386. DOI:https://doi.org/10.1016/j.tcs.2009.10.025Google Scholar
Digital Library
- Benjamin Bichsel, Timon Gehr, and Martin Vechev. 2018. Fine-grained semantics for probabilistic programs. In Programming Languages and Systems (ESOP’18) (LNCS), Amal Ahmed (Ed.), Vol. 10801. Springer International Publishing, Cham, 145--185. DOI:https://doi.org/10.1007/978-3-319-89884-1_6Google Scholar
- Sandrine Blazy, Andre Maroneze, and David Pichardie. 2015. Verified validation of program slicing. In Proceedings of the Conference on Certified Programs and Proofs (CPP’15). ACM, New York, NY, 109--117. DOI:https://doi.org/10.1145/2676724.2693169Google Scholar
Digital Library
- Olivier Bouissou, Eric Goubault, Sylvie Putot, Aleksandar Chakarov, and Sriram Sankaranarayanan. 2016. Uncertainty propagation using probabilistic affine forms and concentration of measure inequalities. In Proceedings of the 22nd International Conference on Tools and Algorithms for the Construction and Analysis of Systems (TACAS’16) (LNCS), Marsha Chechik and Jean-François Raskin (Eds.), Vol. 9636. Springer Berlin, 225--243. DOI:https://doi.org/10.1007/978-3-662-49674-9_13Google Scholar
Digital Library
- Aleksandar Chakarov and Sriram Sankaranarayanan. 2013. Probabilistic program analysis with martingales. In Computer Aided Verification, Natasha Sharygina and Helmut Veith (Eds.). Lecture Notes in Computer Science, Vol. 8044. Springer Berlin, 511--526. DOI:https://doi.org/10.1007/978-3-642-39799-8_34Google Scholar
- Sebastian Danicic, Richard W. Barraclough, Mark Harman, John D. Howroyd, Ákos Kiss, and Michael R. Laurence. 2011. A unifying theory of control dependence and its application to arbitrary program structures. Theoret. Comput. Sci. 412, 49 (Nov. 2011), 6809--6842. DOI:https://doi.org/10.1016/j.tcs.2011.08.033Google Scholar
Digital Library
- Luis María Ferrer Fioriti and Holger Hermanns. 2015. Probabilistic termination: Soundness, completeness, and compositionality. In Proceedings of the 42ndACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL’15). 489--501. DOI:https://doi.org/10.1145/2676726.2677001Google Scholar
Digital Library
- Andrew D. Gordon, Thomas A. Henzinger, Aditya V. Nori, and Sriram K. Rajamani. 2014. Probabilistic programming. In Proceedings of the International Conference on Software Engineering (ICSE), Future of Software Engineering Track (FOSE’14), Matthew B. Dwyer and James Herbsleb (Eds.). ACM, New York, NY, 167--181. DOI:https://doi.org/10.1145/2593882.2593900Google Scholar
- Friedrich Gretz, Joost-Pieter Katoen, and Annabelle McIver. 2014. Operational versus weakest pre-expectation semantics for the probabilistic guarded command language. Perf. Eval. 73 (Mar. 2014), 110--132. DOI:https://doi.org/10.1016/j.peva.2013.11.004Google Scholar
- Chung-Kil Hur, Aditya V. Nori, Sriram K. Rajamani, and Selva Samuel. 2014. Slicing probabilistic programs. In Proceedings of the 35th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI’14), Keshav Pingali (Ed.). ACM, New York, NY, 133--144. DOI:https://doi.org/10.1145/2594291.2594303Google Scholar
Digital Library
- Benjamin Lucien Kaminski and Joost-Pieter Katoen. 2015. On the hardness of almost— termination. In Proceedings of the 40th International Symposium on Mathematical Foundations of Computer Science (MFCS’15) Proceedings, Part I, Giuseppe F. Italiano, Giovanni Pighizzini, and Donald T. Sannella (Eds.). Springer Berlin, 307--318. DOI:https://doi.org/10.1007/978-3-662-48057-1_24Google Scholar
- Benjamin Lucien Kaminski, Joost-Pieter Katoen, Christoph Matheja, and Federico Olmedo. 2016. Weakest precondition reasoning for expected run-times of probabilistic programs. In Proceedings of the 25th European Symposium on Programming (ESOP'16), Peter Thiemann (Ed.). Lecture Notes in Computer Science, vol. 9632. 364–389. https://doi.org/10.1007/978-3-662-49498-1_15Google Scholar
Digital Library
- Dexter Kozen. 1981. Semantics of probabilistic programs. J. Comput. Syst. Sci. 22 (1981), 328--350. DOI:https://doi.org/10.1016/0022-0000(81)90036-2Google Scholar
Cross Ref
- Dexter Kozen. 1985. A probabilistic PDL. J. Comput. Syst. Sci. 30, 2 (Apr. 1985), 162--178. DOI:https://doi.org/10.1016/0022-0000(85)90012-1Google Scholar
Cross Ref
- Jean-Christophe Léchenet, Nikolai Kosmatov, and Pascale Le Gall. 2016. Cut branches before looking for bugs: Sound verification on relaxed slices. In Proceedings of the Fundamental Approaches to Software Engineering Conference (FASE’16) (LNCS), Vol. 9633. Springer Verlag, 179--196. DOI:https://doi.org/10.1007/978-3-662-49665-7_11Google Scholar
Digital Library
- Annabelle McIver, Carroll Morgan, Benjamin Lucien Kaminski, and Joost-Pieter Katoen. 2018. A new proof rule for almost-sure termination. In Proceedings of the ACM on Programming Languages 2, POPL (2018), 33:1–33:28. DOI:https://doi.org/10.1145/3158121Google Scholar
Digital Library
- David Monniaux. 2001. An abstract analysis of the probabilistic termination of programs. In Proceedings of the 8th International Static Analysis Symposium (SAS’01) (Lecture Notes in Computer Science), Vol. 2126. Springer Verlag, 111--126. DOI:https://doi.org/10.1007/3-540-47764-0_7Google Scholar
Cross Ref
- Federico Olmedo, Friedrich Gretz, Nils Jansen, Benjamin Lucien Kaminski, Joost-Pieter Katoen, and Annabelle McIver. 2018. Conditioning in probabilistic programming. ACM Trans. Prog. Lang. Syst. 40, 1, Article 4 (Jan. 2018), 50 pages. DOI:https://doi.org/10.1145/3156018Google Scholar
Digital Library
- Prakash Panangaden. 2009. Labelled Markov Processes. Imperial College Press.Google Scholar
Digital Library
- Andy Podgurski and Lori A. Clarke. 1990. A formal model of program dependences and its implications for software testing, debugging, and maintenance. IEEE Trans. Softw. Eng. 16, 9 (Sept. 1990), 965--979. DOI:https://doi.org/10.1109/32.58784Google Scholar
Digital Library
- Venkatesh Prasad Ranganath, Torben Amtoft, Anindya Banerjee, John Hatcliff, and Matthew B. Dwyer. 2007. A new foundation for control dependence and slicing for modern program structures. ACM Trans. Prog. Lang. Syst. 29, 5, Article 27 (Aug. 2007). DOI:https://doi.org/10.1145/1275497.1275502Google Scholar
Digital Library
- David A. Schmidt. 1986. Denotational Semantics, a Methodology for Language Development. Allyn and Bacon, Boston.Google Scholar
- Frank Tip. 1995. A survey of program slicing techniques. J. Prog. Lang. 3 (1995), 121--189.Google Scholar
- Daniel Wasserrab. 2010. From Formal Semantics to Verified Slicing. Ph.D. Dissertation. Karlsruher Institut für Technologie.Google Scholar
- Mark Weiser. 1984. Program slicing. IEEE Trans. Softw. Eng. 10, 4 (July 1984), 352--357. DOI:https://doi.org/10.1109/TSE.1984.5010248Google Scholar
- Glynn Winskel. 1993. The Formal Semantics of Programming Languages. The MIT Press.Google Scholar
Digital Library
Index Terms
A Theory of Slicing for Imperative Probabilistic Programs
Recommendations
Abstract Program Slicing: An Abstract Interpretation-Based Approach to Program Slicing
In the present article, we formally define the notion of abstract program slicing, a general form of program slicing where properties of data are considered instead of their exact value. This approach is applied to a language with numeric and reference ...
Slicing of probabilistic programs based on specifications
AbstractThis paper presents the first slicing approach for probabilistic programs based on specifications. We show that when probabilistic programs are accompanied by their specifications in the form of pre- and post-condition, we can exploit ...
Highlights- Probabilistic programs support slicing based on specification.
- The presence of ...
Slicing probabilistic programs
PLDI '14: Proceedings of the 35th ACM SIGPLAN Conference on Programming Language Design and ImplementationProbabilistic programs use familiar notation of programming languages to specify probabilistic models. Suppose we are interested in estimating the distribution of the return expression r of a probabilistic program P. We are interested in slicing the ...






Comments