Automated Termination Analysis of Polynomial Probabilistic Programs

The termination behavior of probabilistic programs depends on the outcomes of random assignments. Almost sure termination (AST) is concerned with the question whether a program terminates with probability one on all possible inputs. Positive almost sure termination (PAST) focuses on termination in a finite expected number of steps. This paper presents a fully automated approach to the termination analysis of probabilistic while-programs whose guards and expressions are polynomial expressions. As proving (positive) AST is undecidable in general, existing proof rules typically provide sufficient conditions. These conditions mostly involve constraints on supermartingales. We consider four proof rules from the literature and extend these with generalizations of existing proof rules for (P)AST. We automate the resulting set of proof rules by effectively computing asymptotic bounds on polynomials over the program variables. These bounds are used to decide the sufficient conditions – including the constraints on supermartingales – of a proof rule. Our software tool Amber can thus check AST, PAST, as well as their negations for a large class of polynomial probabilistic programs, while carrying out the termination reasoning fully with polynomial witnesses. Experimental results show the merits of our generalized proof rules and demonstrate that Amber can handle probabilistic programs that are out of reach for other state-of-the-art tools.

[1]  Andreas Podelski,et al.  Proving program termination , 2011, Commun. ACM.

[2]  Jürgen Giesl,et al.  Polynomial Loops: Beyond Termination , 2020, LPAR.

[3]  Nikolaj Bjørner,et al.  Z3: An Efficient SMT Solver , 2008, TACAS.

[4]  M. Elisabeth Paté-Cornell,et al.  A Bayesian Model to Assess the Size of North Korea's Uranium Enrichment Program , 2015 .

[5]  Joost-Pieter Katoen,et al.  On the Hardness of Almost-Sure Termination , 2015, MFCS.

[6]  Annabelle McIver,et al.  Abstraction, Refinement and Proof for Probabilistic Systems , 2004, Monographs in Computer Science.

[7]  Dominik Wolfgang Gruntz,et al.  On computing limits in a symbolic manipulation system , 1996 .

[8]  Joost-Pieter Katoen,et al.  Weakest Precondition Reasoning for Expected Runtimes of Randomized Algorithms , 2018, J. ACM.

[9]  Andreas Podelski,et al.  Terminator: Beyond Safety , 2006, CAV.

[10]  Ezio Bartocci,et al.  Automatic Generation of Moment-Based Invariants for Prob-Solvable Loops , 2019, ATVA.

[11]  Ichiro Hasuo,et al.  Ranking and Repulsing Supermartingales for Reachability in Probabilistic Programs , 2018, ATVA.

[12]  Akihisa Yamada,et al.  Nagoya Termination Tool , 2014, RTA-TLCA.

[13]  Ugo Dal Lago,et al.  Probabilistic Termination by Monadic Affine Sized Typing , 2019, TOPL.

[14]  Joost-Pieter Katoen,et al.  Aiming low is harder: induction for lower bounds in probabilistic program verification , 2020, Proc. ACM Program. Lang..

[15]  Dexter Kozen,et al.  Semantics of probabilistic programs , 1979, 20th Annual Symposium on Foundations of Computer Science (sfcs 1979).

[16]  Dexter Kozen A Probabilistic PDL , 1985, J. Comput. Syst. Sci..

[17]  C. A. R. Hoare,et al.  An axiomatic basis for computer programming , 1969, CACM.

[18]  Rupak Majumdar,et al.  Fair Termination for Parameterized Probabilistic Concurrent Systems , 2017, TACAS.

[19]  Jürgen Giesl,et al.  Analyzing Program Termination and Complexity Automatically with AProVE , 2016, Journal of Automated Reasoning.

[20]  Annabelle McIver,et al.  A new proof rule for almost-sure termination , 2017, Proc. ACM Program. Lang..

[21]  Jochen Hoenicke,et al.  Ultimate Automizer and the Search for Perfect Interpolants - (Competition Contribution) , 2018, TACAS.

[22]  Annabelle McIver,et al.  Developing and Reasoning About Probabilistic Programs in pGCL , 2004, PSSE.

[23]  Proving almost-sure termination by omega-regular decomposition , 2020, PLDI.

[24]  Krishnendu Chatterjee,et al.  New Approaches for Almost-Sure Termination of Probabilistic Programs , 2018, APLAS.

[25]  Sriram Sankaranarayanan,et al.  Probabilistic Program Analysis with Martingales , 2013, CAV.

[26]  Ezio Bartocci,et al.  Mora - Automatic Generation of Moment-Based Invariants , 2020, TACAS.

[27]  Olivier Bournez,et al.  Proving Positive Almost-Sure Termination , 2005, RTA.

[28]  Krishnendu Chatterjee,et al.  Termination Analysis of Probabilistic Programs Through Positivstellensatz's , 2016, CAV.

[29]  Krishnendu Chatterjee,et al.  Stochastic invariants for probabilistic termination , 2016, POPL.

[30]  Erik B. Sudderth,et al.  NET‐VISA: Network Processing Vertically Integrated Seismic Analysis , 2013 .

[31]  Peter Giesl,et al.  Computing Expected Runtimes for Constant Probability Programs , 2019, CADE.

[32]  Krishnendu Chatterjee,et al.  Lexicographic ranking supermartingales: an efficient approach to termination of probabilistic programs , 2017, Proc. ACM Program. Lang..

[33]  David Monniaux An Abstract Analysis of the Probabilistic Termination of Programs , 2001, SAS.

[34]  Ugo Dal Lago,et al.  On probabilistic term rewriting , 2020, Sci. Comput. Program..

[35]  Krishnendu Chatterjee,et al.  Algorithmic Analysis of Qualitative and Quantitative Termination Problems for Affine Probabilistic Programs , 2018, ACM Trans. Program. Lang. Syst..

[36]  Alberto L. Sangiovanni-Vincentelli,et al.  Scenic: a language for scenario specification and scene generation , 2018, PLDI.

[37]  Ezio Bartocci,et al.  Analysis of Bayesian Networks via Prob-Solvable Loops , 2020, ICTAC.

[38]  Manuel Kauers,et al.  The Concrete Tetrahedron - Symbolic Sums, Recurrence Equations, Generating Functions, Asymptotic Estimates , 2011, Texts & Monographs in Symbolic Computation.

[39]  Van Chan Ngo,et al.  Bounded expectations: resource analysis for probabilistic programs , 2017, PLDI.

[40]  Henny B. Sipma,et al.  Termination of Polynomial Programs , 2005, VMCAI.

[41]  Holger Hermanns,et al.  Probabilistic Termination , 2015, POPL.

[42]  Krishnendu Chatterjee,et al.  Modular verification for almost-sure termination of probabilistic programs , 2019, Proc. ACM Program. Lang..

[43]  Javier Esparza,et al.  Proving Termination of Probabilistic Programs Using Patterns , 2012, CAV.