Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
research-article
Open access

Modular verification for almost-sure termination of probabilistic programs

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

    Cited By

    View all
    • (2024)Quantitative Bounds on Resource Usage of Probabilistic ProgramsProceedings of the ACM on Programming Languages10.1145/36498248:OOPSLA1(362-391)Online publication date: 29-Apr-2024
    • (2024)A Complete Dependency Pair Framework for Almost-Sure Innermost Termination of Probabilistic Term RewritingFunctional and Logic Programming10.1007/978-981-97-2300-3_4(62-80)Online publication date: 15-May-2024
    • (2024)Lexicographic Ranking Supermartingales with Lazy Lower BoundsComputer Aided Verification10.1007/978-3-031-65633-0_19(420-442)Online publication date: 26-Jul-2024
    • Show More Cited By

    Index Terms

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

          Recommendations

          Comments

          Information & Contributors

          Information

          Published In

          cover image Proceedings of the ACM on Programming Languages
          Proceedings of the ACM on Programming Languages  Volume 3, Issue OOPSLA
          October 2019
          2077 pages
          EISSN:2475-1421
          DOI:10.1145/3366395
          Issue’s Table of Contents
          This work is licensed under a Creative Commons Attribution-NoDerivs International 4.0 License.

          Publisher

          Association for Computing Machinery

          New York, NY, United States

          Publication History

          Published: 10 October 2019
          Published in PACMPL Volume 3, Issue OOPSLA

          Permissions

          Request permissions for this article.

          Check for updates

          Badges

          Author Tags

          1. Almost-Sure Termination
          2. Probabilistic Programs
          3. Termination
          4. Verification

          Qualifiers

          • Research-article

          Funding Sources

          Contributors

          Other Metrics

          Bibliometrics & Citations

          Bibliometrics

          Article Metrics

          • Downloads (Last 12 months)118
          • Downloads (Last 6 weeks)8
          Reflects downloads up to 10 Aug 2024

          Other Metrics

          Citations

          Cited By

          View all
          • (2024)Quantitative Bounds on Resource Usage of Probabilistic ProgramsProceedings of the ACM on Programming Languages10.1145/36498248:OOPSLA1(362-391)Online publication date: 29-Apr-2024
          • (2024)A Complete Dependency Pair Framework for Almost-Sure Innermost Termination of Probabilistic Term RewritingFunctional and Logic Programming10.1007/978-981-97-2300-3_4(62-80)Online publication date: 15-May-2024
          • (2024)Lexicographic Ranking Supermartingales with Lazy Lower BoundsComputer Aided Verification10.1007/978-3-031-65633-0_19(420-442)Online publication date: 26-Jul-2024
          • (2024)From Innermost to Full Almost-Sure Termination of Probabilistic Term RewritingFoundations of Software Science and Computation Structures10.1007/978-3-031-57231-9_10(206-228)Online publication date: 6-Apr-2024
          • (2023)Asparagus: Automated Synthesis of Parametric Gas Upper-Bounds for Smart ContractsProceedings of the ACM on Programming Languages10.1145/36228297:OOPSLA2(882-911)Online publication date: 16-Oct-2023
          • (2023)On Lexicographic Proof Rules for Probabilistic TerminationFormal Aspects of Computing10.1145/358539135:2(1-25)Online publication date: 23-Jun-2023
          • (2023)Proving Almost-Sure Innermost Termination of Probabilistic Term Rewriting Using Dependency PairsAutomated Deduction – CADE 2910.1007/978-3-031-38499-8_20(344-364)Online publication date: 1-Jul-2023
          • (2023)A Higher-Order Language for Markov Kernels and Linear OperatorsFoundations of Software Science and Computation Structures10.1007/978-3-031-30829-1_5(89-112)Online publication date: 21-Apr-2023
          • (2022)Slicing of probabilistic programs based on specificationsScience of Computer Programming10.1016/j.scico.2022.102822220(102822)Online publication date: Aug-2022
          • (2022)Sound and Complete Certificates for Quantitative Termination Analysis of Probabilistic ProgramsComputer Aided Verification10.1007/978-3-031-13185-1_4(55-78)Online publication date: 7-Aug-2022
          • Show More Cited By

          View Options

          View options

          PDF

          View or Download as a PDF file.

          PDF

          eReader

          View online with eReader.

          eReader

          Get Access

          Login options

          Full Access

          Media

          Figures

          Other

          Tables

          Share

          Share

          Share this Publication link

          Share on social media