Abstract
In this work, we consider the almost-sure termination problem for probabilistic programs that asks whether a given probabilistic program terminates with probability 1. Scalable approaches for program analysis often rely on modularity as their theoretical basis. In non-probabilistic programs, the classical variant rule (V-rule) of Floyd-Hoare logic provides the foundation for modular analysis. Extension of this rule to almost-sure termination of probabilistic programs is quite tricky, and a probabilistic variant was proposed by Fioriti and Hermanns in POPL 2015. While the proposed probabilistic variant cautiously addresses the key issue of integrability, we show that the proposed modular rule is still not sound for almost-sure termination of probabilistic programs.
Besides establishing unsoundness of the previous rule, our contributions are as follows: First, we present a sound modular rule for almost-sure termination of probabilistic programs. Our approach is based on a novel notion of descent supermartingales. Second, for algorithmic approaches, we consider descent supermartingales that are linear and show that they can be synthesized in polynomial time. Finally, we present experimental results on a variety of benchmarks and several natural examples that model various types of nested while loops in probabilistic programs and demonstrate that our approach is able to efficiently prove their almost-sure termination property.
- Sheshansh Agrawal, Krishnendu Chatterjee, and Petr Novotný. 2018. Lexicographic ranking supermartingales: an efficient approach to termination of probabilistic programs. PACMPL 2, POPL (2018), 34:1–34:32.Google Scholar
Digital Library
- Christel Baier and Joost-Pieter Katoen. 2008. Principles of Model Checking. MIT Press.Google Scholar
Digital Library
- Kevin Batz, Benjamin Lucien Kaminski, Joost-Pieter Katoen, Christoph Matheja, and Thomas Noll. 2019. Quantitative separation logic: a logic for reasoning about probabilistic pointer programs. In POPL.Google Scholar
- Michel Berkelaar, Kjell Eikland, Peter Notebaert, et al. 2004. lpsolve: Open source (mixed-integer) linear programming system. Eindhoven U. of Technology (2004).Google Scholar
- Olivier Bournez and Florent Garnier. 2005. Proving Positive Almost-Sure Termination. In RTA. 323–337.Google Scholar
- Aleksandar Chakarov and Sriram Sankaranarayanan. 2013. Probabilistic Program Analysis with Martingales. In CAV. 511–526.Google Scholar
- Krishnendu Chatterjee and Hongfei Fu. 2019. Termination of Nondeterministic Recursive Probabilistic Programs. In VMCAI.Google Scholar
- Krishnendu Chatterjee, Hongfei Fu, and Amir Kafshdar Goharshady. 2016a. Termination Analysis of Probabilistic Programs Through Positivstellensatz’s. In CAV. 3–22.Google Scholar
- Krishnendu Chatterjee, Hongfei Fu, Amir Kafshdar Goharshady, and Nastaran Okati. 2018. Computational Approaches for Stochastic Shortest Path on Succinct MDPs. In IJCAI 2018. 4700–4707.Google Scholar
- Krishnendu Chatterjee, Hongfei Fu, Petr Novotný, and Rouzbeh Hasheminezhad. 2016b. Algorithmic analysis of qualitative and quantitative termination problems for affine probabilistic programs. In POPL. 327–342.Google Scholar
- Krishnendu Chatterjee, Petr Novotný, and Ðorđe Žikelić. 2017. Stochastic invariants for probabilistic termination. In POPL. 145–160.Google Scholar
- Guillaume Claret, Sriram K Rajamani, Aditya V Nori, Andrew D Gordon, and Johannes Borgström. 2013. Bayesian inference using data flow analysis. In Joint Meeting on Foundations of Software Engineering. ACM, 92–102.Google Scholar
Digital Library
- Michael Colón, Sriram Sankaranarayanan, and Henny Sipma. 2003. Linear Invariant Generation Using Non-linear Constraint Solving. In CAV. 420–432.Google Scholar
- Javier Esparza, Andreas Gaiser, and Stefan Kiefer. 2012. Proving Termination of Probabilistic Programs Using Patterns. In CAV. 123–138.Google Scholar
- Kousha Etessami and Mihalis Yannakakis. 2009. Recursive Markov chains, stochastic grammars, and monotone systems of nonlinear equations. Journal of the ACM (JACM) 56, 1 (2009), 1.Google Scholar
Digital Library
- Julius Farkas. 1894. A Fourier-féle mechanikai elv alkalmazásai (Hungarian). Mathematikaiés Természettudományi Értesitö 12 (1894), 457–472.Google Scholar
- Luis María Ferrer Fioriti and Holger Hermanns. 2015. Probabilistic Termination: Soundness, Completeness, and Compositionality. In POPL. 489–501.Google Scholar
Digital Library
- Robert W. Floyd. 1967. Assigning meanings to programs. Mathematical Aspects of Computer Science 19 (1967), 19–33.Google Scholar
Cross Ref
- Nate Foster, Dexter Kozen, Konstantinos Mamouras, Mark Reitblatt, and Alexandra Silva. 2016. Probabilistic NetKAT. In ESOP. Springer, 282–309.Google Scholar
- Noah D Goodman, Vikash K Mansinghka, Daniel Roy, Keith Bonawitz, and Joshua B Tenenbaum. 2008. Church: a language for generative models. In UAI. AUAI Press, 220–229.Google Scholar
- Noah D Goodman and Andreas Stuhlmüller. 2014. The Design and Implementation of Probabilistic Programming Languages. http://dippl.org . (2014).Google Scholar
- Andrew D Gordon, Mihhail Aizatulin, Johannes Borgstrom, Guillaume Claret, Thore Graepel, Aditya V Nori, Sriram K Rajamani, and Claudio Russo. 2013. A model-learner pattern for Bayesian reasoning. In ACM SIGPLAN Notices, Vol. 48. ACM, 403–416.Google Scholar
Digital Library
- Andrew D Gordon, Thomas A Henzinger, Aditya V Nori, and Sriram K Rajamani. 2014. Probabilistic programming. In Proceedings of the on Future of Software Engineering. ACM, 167–181.Google Scholar
Digital Library
- Wim H. Hesselink. 1993. Proof Rules for Recursive Procedures. Formal Asp. Comput. 5, 6 (1993), 554–570.Google Scholar
Digital Library
- Wassily Hoeffding. 1963. Probability Inequalities for Sums of Bounded Random Variables. J. Amer. Statist. Assoc. 58, 301 (1963), 13–30.Google Scholar
Digital Library
- Mingzhang Huang, Hongfei Fu, and Krishnendu Chatterjee. 2018. New Approaches for Almost-Sure Termination of Probabilistic Programs. In APLAS. 181–201.Google Scholar
- Mingzhang Huang, Hongfei Fu, Krishnendu Chatterjee, and Amir Kafshdar Goharshady. 2019. Modular Verification for Almost-Sure Termination of Probabilistic Programs. arXiv preprint arXiv:1901.06087 (2019).Google Scholar
- Claire Jones. 1989. Probabilistic Non-Determinism. Ph.D. Dissertation. The University of Edinburgh.Google Scholar
- David M. Kahn. 2017. Undecidable Problems for Probabilistic Network Programming. In MFCS. 68:1–68:17.Google Scholar
- Benjamin Lucien Kaminski, Joost-Pieter Katoen, Christoph Matheja, and Federico Olmedo. 2016. Weakest Precondition Reasoning for Expected Run-Times of Probabilistic Programs. In ESOP. 364–389.Google Scholar
- Benjamin Lucien Kaminski, Joost-Pieter Katoen, and Christoph Matheja. 2018. On the hardness of analyzing probabilistic programs. Acta Informatica (2018), 1–31.Google Scholar
- Shmuel Katz and Zohar Manna. 1975. A Closer Look at Termination. Acta Inf. 5 (1975), 333–352. Google Scholar
Digital Library
- Orna Kupferman and Moshe Y. Vardi. 1997. Modular Model Checking. In Compositionality: The Significant Difference, International Symposium, COMPOS’97, Bad Malente, Germany, September 8-12, 1997. Revised Lectures (Lecture Notes in Computer Science), Willem P. de Roever, Hans Langmaack, and Amir Pnueli (Eds.), Vol. 1536. Springer, 381–401. Google Scholar
Cross Ref
- Martin Lukasiewycz. 2008. JavaILP - Java Interface to ILP Solvers, http://javailp.sourceforge.net/. (2008). http://javailp. sourceforge.net/Google Scholar
- Hosam Mahmoud. 2008. Pólya urn models. Chapman and Hall/CRC.Google Scholar
Digital Library
- Christopher D Manning, Christopher D Manning, and Hinrich Schütze. 1999. Foundations of statistical natural language processing. MIT press.Google Scholar
Digital Library
- Colin McDiarmid. 1998. Concentration. In Probabilistic Methods for Algorithmic Discrete Mathematics. 195–248.Google Scholar
- Annabelle McIver and Carroll Morgan. 2004. Developing and Reasoning About Probabilistic Programs in pGCL. In PSSE. 123–155.Google Scholar
- Annabelle McIver and Carroll Morgan. 2005. Abstraction, Refinement and Proof for Probabilistic Systems. Springer.Google Scholar
- Annabelle McIver, Carroll Morgan, Benjamin Lucien Kaminski, and Joost-Pieter Katoen. 2018. A new proof rule for almost-sure termination. PACMPL 2, POPL (2018), 33:1–33:28. Google Scholar
Digital Library
- Van Chan Ngo, Quentin Carbonneaux, and Jan Hoffmann. 2018. Bounded expectations: resource analysis for probabilistic programs. In PLDI. 496–512.Google Scholar
- Federico Olmedo, Benjamin Lucien Kaminski, Joost-Pieter Katoen, and Christoph Matheja. 2016. Reasoning about Recursive Probabilistic Programs. In LICS. 672–681.Google Scholar
- DM Roy, VK Mansinghka, ND Goodman, and JB Tenenbaum. 2008. A stochastic programming perspective on nonparametric Bayes. In Nonparametric Bayesian Workshop, Int. Conf. on Machine Learning, Vol. 22. 26.Google Scholar
- Sriram Sankaranarayanan, Henny B Sipma, and Zohar Manna. 2004. Constraint-based linear-relations analysis. In SAS 2004. Springer, 53–68.Google Scholar
Cross Ref
- Alexander Schrijver. 2003. Combinatorial Optimization - Polyhedra and Efficiency. Springer.Google Scholar
- Adam Ścibior, Zoubin Ghahramani, and Andrew D Gordon. 2015. Practical probabilistic programming with monads. In ACM SIGPLAN Notices, Vol. 50. ACM, 165–176.Google Scholar
- Steffen Smolka, Praveen Kumar, Nate Foster, Dexter Kozen, and Alexandra Silva. 2017. Cantor meets Scott: semantic foundations for probabilistic networks. In POPL. 557–571.Google Scholar
- Sebastian Thrun. 2000. Probabilistic algorithms in robotics. Ai Magazine 21, 4 (2000), 93.Google Scholar
- Sebastian Thrun. 2002. Probabilistic robotics. Commun. ACM 45, 3 (2002), 52–57.Google Scholar
Digital Library
- David Tolpin, Jan-Willem van de Meent, Hongseok Yang, and Frank Wood. 2016. Design and Implementation of Probabilistic Programming Language Anglican. In IFL. ACM, 6:1–6:12. Google Scholar
Digital Library
- Di Wang, Jan Hoffmann, and Thomas W. Reps. 2018. PMAF: an algebraic framework for static analysis of probabilistic programs. In PLDI. 513–528.Google Scholar
- Peixin Wang, Hongfei Fu, Amir Kafshdar Goharshady, Krishnendu Chatterjee, Xudong Qin, and Wenjun Shi. 2019. Cost Analysis of Nondeterministic Probabilistic Programs. In PLDI. 204–220.Google Scholar
- David Williams. 1991. Probability with Martingales. Cambridge University Press.Google Scholar
Index Terms
Modular verification for almost-sure termination of probabilistic programs
Recommendations
Lexicographic ranking supermartingales: an efficient approach to termination of probabilistic programs
Probabilistic programs extend classical imperative programs with real-valued random variables and random branching. The most basic liveness property for such programs is the termination property. The qualitative (aka almost-sure) termination problem ...
Stochastic invariants for probabilistic termination
POPL '17Termination is one of the basic liveness properties, and we study the termination problem for probabilistic programs with real-valued variables. Previous works focused on the qualitative problem that asks whether an input program terminates with ...
Stochastic invariants for probabilistic termination
POPL '17: Proceedings of the 44th ACM SIGPLAN Symposium on Principles of Programming LanguagesTermination is one of the basic liveness properties, and we study the termination problem for probabilistic programs with real-valued variables. Previous works focused on the qualitative problem that asks whether an input program terminates with ...






Comments