skip to main content
research-article
Open Access
Artifacts Available
Artifacts Evaluated & Functional

Modular verification for almost-sure termination of probabilistic programs

Published:10 October 2019Publication History
Skip Abstract Section

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.

References

  1. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  2. Christel Baier and Joost-Pieter Katoen. 2008. Principles of Model Checking. MIT Press.Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. 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 ScholarGoogle Scholar
  4. Michel Berkelaar, Kjell Eikland, Peter Notebaert, et al. 2004. lpsolve: Open source (mixed-integer) linear programming system. Eindhoven U. of Technology (2004).Google ScholarGoogle Scholar
  5. Olivier Bournez and Florent Garnier. 2005. Proving Positive Almost-Sure Termination. In RTA. 323–337.Google ScholarGoogle Scholar
  6. Aleksandar Chakarov and Sriram Sankaranarayanan. 2013. Probabilistic Program Analysis with Martingales. In CAV. 511–526.Google ScholarGoogle Scholar
  7. Krishnendu Chatterjee and Hongfei Fu. 2019. Termination of Nondeterministic Recursive Probabilistic Programs. In VMCAI.Google ScholarGoogle Scholar
  8. Krishnendu Chatterjee, Hongfei Fu, and Amir Kafshdar Goharshady. 2016a. Termination Analysis of Probabilistic Programs Through Positivstellensatz’s. In CAV. 3–22.Google ScholarGoogle Scholar
  9. 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 ScholarGoogle Scholar
  10. 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 ScholarGoogle Scholar
  11. Krishnendu Chatterjee, Petr Novotný, and Ðorđe Žikelić. 2017. Stochastic invariants for probabilistic termination. In POPL. 145–160.Google ScholarGoogle Scholar
  12. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  13. Michael Colón, Sriram Sankaranarayanan, and Henny Sipma. 2003. Linear Invariant Generation Using Non-linear Constraint Solving. In CAV. 420–432.Google ScholarGoogle Scholar
  14. Javier Esparza, Andreas Gaiser, and Stefan Kiefer. 2012. Proving Termination of Probabilistic Programs Using Patterns. In CAV. 123–138.Google ScholarGoogle Scholar
  15. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  16. Julius Farkas. 1894. A Fourier-féle mechanikai elv alkalmazásai (Hungarian). Mathematikaiés Természettudományi Értesitö 12 (1894), 457–472.Google ScholarGoogle Scholar
  17. Luis María Ferrer Fioriti and Holger Hermanns. 2015. Probabilistic Termination: Soundness, Completeness, and Compositionality. In POPL. 489–501.Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Robert W. Floyd. 1967. Assigning meanings to programs. Mathematical Aspects of Computer Science 19 (1967), 19–33.Google ScholarGoogle ScholarCross RefCross Ref
  19. Nate Foster, Dexter Kozen, Konstantinos Mamouras, Mark Reitblatt, and Alexandra Silva. 2016. Probabilistic NetKAT. In ESOP. Springer, 282–309.Google ScholarGoogle Scholar
  20. 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 ScholarGoogle Scholar
  21. Noah D Goodman and Andreas Stuhlmüller. 2014. The Design and Implementation of Probabilistic Programming Languages. http://dippl.org . (2014).Google ScholarGoogle Scholar
  22. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  23. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  24. Wim H. Hesselink. 1993. Proof Rules for Recursive Procedures. Formal Asp. Comput. 5, 6 (1993), 554–570.Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Wassily Hoeffding. 1963. Probability Inequalities for Sums of Bounded Random Variables. J. Amer. Statist. Assoc. 58, 301 (1963), 13–30.Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Mingzhang Huang, Hongfei Fu, and Krishnendu Chatterjee. 2018. New Approaches for Almost-Sure Termination of Probabilistic Programs. In APLAS. 181–201.Google ScholarGoogle Scholar
  27. 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 ScholarGoogle Scholar
  28. Claire Jones. 1989. Probabilistic Non-Determinism. Ph.D. Dissertation. The University of Edinburgh.Google ScholarGoogle Scholar
  29. David M. Kahn. 2017. Undecidable Problems for Probabilistic Network Programming. In MFCS. 68:1–68:17.Google ScholarGoogle Scholar
  30. 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 ScholarGoogle Scholar
  31. Benjamin Lucien Kaminski, Joost-Pieter Katoen, and Christoph Matheja. 2018. On the hardness of analyzing probabilistic programs. Acta Informatica (2018), 1–31.Google ScholarGoogle Scholar
  32. Shmuel Katz and Zohar Manna. 1975. A Closer Look at Termination. Acta Inf. 5 (1975), 333–352. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. 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 ScholarGoogle ScholarCross RefCross Ref
  34. Martin Lukasiewycz. 2008. JavaILP - Java Interface to ILP Solvers, http://javailp.sourceforge.net/. (2008). http://javailp. sourceforge.net/Google ScholarGoogle Scholar
  35. Hosam Mahmoud. 2008. Pólya urn models. Chapman and Hall/CRC.Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. Christopher D Manning, Christopher D Manning, and Hinrich Schütze. 1999. Foundations of statistical natural language processing. MIT press.Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. Colin McDiarmid. 1998. Concentration. In Probabilistic Methods for Algorithmic Discrete Mathematics. 195–248.Google ScholarGoogle Scholar
  38. Annabelle McIver and Carroll Morgan. 2004. Developing and Reasoning About Probabilistic Programs in pGCL. In PSSE. 123–155.Google ScholarGoogle Scholar
  39. Annabelle McIver and Carroll Morgan. 2005. Abstraction, Refinement and Proof for Probabilistic Systems. Springer.Google ScholarGoogle Scholar
  40. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  41. Van Chan Ngo, Quentin Carbonneaux, and Jan Hoffmann. 2018. Bounded expectations: resource analysis for probabilistic programs. In PLDI. 496–512.Google ScholarGoogle Scholar
  42. Federico Olmedo, Benjamin Lucien Kaminski, Joost-Pieter Katoen, and Christoph Matheja. 2016. Reasoning about Recursive Probabilistic Programs. In LICS. 672–681.Google ScholarGoogle Scholar
  43. 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 ScholarGoogle Scholar
  44. Sriram Sankaranarayanan, Henny B Sipma, and Zohar Manna. 2004. Constraint-based linear-relations analysis. In SAS 2004. Springer, 53–68.Google ScholarGoogle ScholarCross RefCross Ref
  45. Alexander Schrijver. 2003. Combinatorial Optimization - Polyhedra and Efficiency. Springer.Google ScholarGoogle Scholar
  46. Adam Ścibior, Zoubin Ghahramani, and Andrew D Gordon. 2015. Practical probabilistic programming with monads. In ACM SIGPLAN Notices, Vol. 50. ACM, 165–176.Google ScholarGoogle Scholar
  47. 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 ScholarGoogle Scholar
  48. Sebastian Thrun. 2000. Probabilistic algorithms in robotics. Ai Magazine 21, 4 (2000), 93.Google ScholarGoogle Scholar
  49. Sebastian Thrun. 2002. Probabilistic robotics. Commun. ACM 45, 3 (2002), 52–57.Google ScholarGoogle ScholarDigital LibraryDigital Library
  50. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  51. Di Wang, Jan Hoffmann, and Thomas W. Reps. 2018. PMAF: an algebraic framework for static analysis of probabilistic programs. In PLDI. 513–528.Google ScholarGoogle Scholar
  52. 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 ScholarGoogle Scholar
  53. David Williams. 1991. Probability with Martingales. Cambridge University Press.Google ScholarGoogle Scholar

Index Terms

  1. Modular verification for almost-sure termination of probabilistic programs

        Recommendations

        Comments

        Login options

        Check if you have access through your login credentials or your institution to get full access on this article.

        Sign in

        Full Access

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader
        About Cookies On This Site

        We use cookies to ensure that we give you the best experience on our website.

        Learn more

        Got it!