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]  Lauretta O. Osho,et al.  Axiomatic Basis for Computer Programming , 2013 .

[2]  Ugo Dal Lago,et al.  On Probabilistic Term Rewriting , 2018, FLOPS.

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

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

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

[6]  Ugo Dal Lago,et al.  Probabilistic Termination by Monadic Affine Sized Typing , 2017, ESOP.

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

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

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

[10]  Krishnendu Chatterjee,et al.  Algorithmic analysis of qualitative and quantitative termination problems for affine probabilistic programs , 2015, POPL.

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

[12]  Dexter Kozen,et al.  A probabilistic PDL , 1983, J. Comput. Syst. Sci..

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[28]  Fei He,et al.  Proving almost-sure termination by omega-regular decomposition , 2020, PLDI.

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

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

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

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

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

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

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

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

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

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

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

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

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

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