Algorithmic analysis of qualitative and quantitative termination problems for affine probabilistic programs

In this paper, we consider termination of probabilistic programs with real-valued variables. The questions concerned are: 1. qualitative ones that ask (i) whether the program terminates with probability 1 (almost-sure termination) and (ii) whether the expected termination time is finite (finite termination); 2. quantitative ones that ask (i) to approximate the expected termination time (expectation problem) and (ii) to compute a bound B such that the probability to terminate after B steps decreases exponentially (concentration problem). To solve these questions, we utilize the notion of ranking supermartingales which is a powerful approach for proving termination of probabilistic programs. In detail, we focus on algorithmic synthesis of linear ranking-supermartingales over affine probabilistic programs (APP's) with both angelic and demonic non-determinism. An important subclass of APP's is LRAPP which is defined as the class of all APP's over which a linear ranking-supermartingale exists. Our main contributions are as follows. Firstly, we show that the membership problem of LRAPP (i) can be decided in polynomial time for APP's with at most demonic non-determinism, and (ii) is NP-hard and in PSPACE for APP's with angelic non-determinism; moreover, the NP-hardness result holds already for APP's without probability and demonic non-determinism. Secondly, we show that the concentration problem over LRAPP can be solved in the same complexity as for the membership problem of LRAPP. Finally, we show that the expectation problem over LRAPP can be solved in 2EXPTIME and is PSPACE-hard even for APP's without probability and non-determinism (i.e., deterministic programs). Our experimental results demonstrate the effectiveness of our approach to answer the qualitative and quantitative questions over APP's with at most demonic non-determinism.

[1]  Annabelle McIver,et al.  Abstraction and refinement in probabilistic systems , 2005, PERV.

[2]  Th. Motzkin Beiträge zur Theorie der linearen Ungleichungen , 1936 .

[3]  Florian Zuleger,et al.  Ramsey vs. Lexicographic Termination Proving , 2013, TACAS.

[4]  Michael J. Maher,et al.  Solving Numerical Constraints , 2001, Handbook of Automated Reasoning.

[5]  Ariel Rubinstein,et al.  A Course in Game Theory , 1995 .

[6]  Alexander Schrijver,et al.  Combinatorial optimization. Polyhedra and efficiency. , 2003 .

[7]  David Williams,et al.  Probability with Martingales , 1991, Cambridge mathematical textbooks.

[8]  Javier Esparza,et al.  Quantitative analysis of probabilistic pushdown automata: expectations and variances , 2005, 20th Annual IEEE Symposium on Logic in Computer Science (LICS' 05).

[9]  Patrick Cousot,et al.  Abstract interpretation: a unified lattice model for static analysis of programs by construction or approximation of fixpoints , 1977, POPL.

[10]  Leslie Pack Kaelbling,et al.  Planning and Acting in Partially Observable Stochastic Domains , 1998, Artif. Intell..

[11]  Andrew W. Moore,et al.  Reinforcement Learning: A Survey , 1996, J. Artif. Intell. Res..

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

[13]  R. Durrett Probability: Theory and Examples , 1993 .

[14]  Sumit Gulwani,et al.  Static analysis for probabilistic programs: inferring whole program properties from finitely many paths , 2013, PLDI.

[15]  Christel Baier,et al.  Principles of model checking , 2008 .

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

[17]  R. Bellman,et al.  Dynamic Programming and Markov Processes , 1960 .

[18]  G. Bennett Probability Inequalities for the Sum of Independent Random Variables , 1962 .

[19]  Fan Chung Graham,et al.  Concentration Inequalities and Martingale Inequalities: A Survey , 2006, Internet Math..

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

[21]  Anna Philippou,et al.  Tools and Algorithms for the Construction and Analysis of Systems , 2018, Lecture Notes in Computer Science.

[22]  Andreas Podelski,et al.  A Complete Method for the Synthesis of Linear Ranking Functions , 2004, VMCAI.

[23]  Henny B. Sipma,et al.  Linear Ranking with Reachability , 2005, CAV.

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

[25]  Marta Z. Kwiatkowska,et al.  PRISM 4.0: Verification of Probabilistic Real-Time Systems , 2011, CAV.

[26]  Kazuoki Azuma WEIGHTED SUMS OF CERTAIN DEPENDENT RANDOM VARIABLES , 1967 .

[27]  Micha Sharir,et al.  Verification of Probabilistic Programs , 1984, SIAM J. Comput..

[28]  Robert W. Floyd,et al.  Assigning Meanings to Programs , 1993 .

[29]  Neil D. Jones,et al.  The size-change principle for program termination , 2001, POPL '01.

[30]  Henny B. Sipma,et al.  Synthesis of Linear Ranking Functions , 2001, TACAS.

[31]  C. McDiarmid Concentration , 1862, The Dental register.

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

[33]  F. G. Foster On the Stochastic Matrices Associated with Certain Queuing Processes , 1953 .

[34]  Annabelle McIver,et al.  Abstraction, Refinement And Proof For Probabilistic Systems (Monographs in Computer Science) , 2004 .

[35]  Tiziana Margaria,et al.  Tools and algorithms for the construction and analysis of systems: a special issue for TACAS 2017 , 2001, International Journal on Software Tools for Technology Transfer.

[36]  David K. Smith Theory of Linear and Integer Programming , 1987 .

[37]  John F. Canny,et al.  Some algebraic and geometric computations in PSPACE , 1988, STOC '88.

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

[39]  Javier Esparza,et al.  Analyzing probabilistic pushdown automata , 2013, Formal Methods Syst. Des..

[40]  J. Rosenthal A First Look at Rigorous Probability Theory , 2000 .

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

[42]  Christel Baier,et al.  Principles of Model Checking (Representation and Mind Series) , 2008 .

[43]  Henny B. Sipma,et al.  The Polyranking Principle , 2005, ICALP.

[44]  Allen Van Gelder,et al.  Termination detection in logic programs using argument sizes (extended abstract) , 1991, PODS.

[45]  J. A. Robinson,et al.  Handbook of Automated Reasoning (in 2 volumes) , 2001 .

[46]  Hadas Kress-Gazit,et al.  Temporal-Logic-Based Reactive Mission and Motion Planning , 2009, IEEE Transactions on Robotics.

[47]  Micha Sharir,et al.  Concurrent Probabilistic Programs, Or: How to Schedule if You Must , 1985, SIAM J. Comput..

[48]  W. Hoeffding Probability Inequalities for sums of Bounded Random Variables , 1963 .

[49]  P. Spreij Probability and Measure , 1996 .

[50]  J. Kemeny,et al.  Denumerable Markov chains , 1969 .

[51]  Rajeev Motwani,et al.  Randomized Algorithms , 1995, SIGA.

[52]  Christel Baier,et al.  Probabilistic ω-automata , 2012, JACM.

[53]  Annabelle McIver,et al.  Linear-Invariant Generation for Probabilistic Programs: - Automated Support for Proof-Based Methods , 2010, SAS.

[54]  Stephen A. Vavasis,et al.  Approximation algorithms for indefinite quadratic programming , 1992, Math. Program..

[55]  Armando Solar-Lezama,et al.  Programming by sketching for bit-streaming programs , 2005, PLDI '05.

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

[57]  H. P. Williams THEORY OF LINEAR AND INTEGER PROGRAMMING (Wiley-Interscience Series in Discrete Mathematics and Optimization) , 1989 .

[58]  Devdatt P. Dubhashi,et al.  Concentration of Measure for the Analysis of Randomized Algorithms: Contents , 2009 .

[59]  Azaria Paz,et al.  Probabilistic automata , 2003 .

[60]  Azaria Paz,et al.  Introduction to probabilistic automata (Computer science and applied mathematics) , 1971 .