Abstract
We present a novel static analysis technique to derive higher moments for program variables for a large class of probabilistic loops with potentially uncountable state spaces. Our approach is fully automatic, meaning it does not rely on externally provided invariants or templates. We employ algebraic techniques based on linear recurrences and introduce program transformations to simplify probabilistic programs while preserving their statistical properties. We develop power reduction techniques to further simplify the polynomial arithmetic of probabilistic programs and define the theory of moment-computable probabilistic loops for which higher moments can precisely be computed. Our work has applications towards recovering probability distributions of random variables and computing tail probabilities. The empirical evaluation of our results demonstrates the applicability of our work on many challenging examples.
- Christel Baier and Joost-Pieter Katoen. 2008. Principles of model checking. MIT Press. ISBN 978-0-262-02649-9
Google Scholar
Digital Library
- Jialu Bao, Nitesh Trivedi, Drashti Pathak, Justin Hsu, and Subhajit Roy. 2022. Data-Driven Invariant Learning for Probabilistic Programs. In Proc. of CAV. https://doi.org/10.1007/978-3-031-13185-1_3
Google Scholar
Digital Library
- Gilles Barthe, Thomas Espitau, Luis María Ferrer Fioriti, and Justin Hsu. 2016. Synthesizing Probabilistic Invariants via Doob’s Decomposition. In Proc. of CAV. https://doi.org/10.1007/978-3-319-41528-4_3
Google Scholar
Cross Ref
- Gilles Barthe, Benjamin Grégoire, and Santiago Zanella Béguelin. 2012. Probabilistic Relational Hoare Logics for Computer-Aided Security Proofs. In Proc. of MPC. https://doi.org/10.1007/978-3-642-31113-0
Google Scholar
Cross Ref
- Gilles Barthe, Joost-Pieter Katoen, and Alexandra Silva. 2020. Foundations of Probabilistic Programming. Cambridge University Press. https://doi.org/10.1017/9781108770750
Google Scholar
Cross Ref
- Gilles Barthe, Boris Köpf, Federico Olmedo, and Santiago Zanella Béguelin. 2012. Probabilistic Relational Reasoning for Differential Privacy. In Proc. of POPL. https://doi.org/10.1145/2103656.2103670
Google Scholar
Digital Library
- Ezio Bartocci, Laura Kovács, and Miroslav Stankovic. 2019. Automatic Generation of Moment-Based Invariants for Prob-Solvable Loops. In Proc. of ATVA. https://doi.org/10.1007/978-3-030-31784-3_15
Google Scholar
Digital Library
- Ezio Bartocci, Laura Kovács, and Miroslav Stankovic. 2020. Analysis of Bayesian Networks via Prob-Solvable Loops. In Proc. of ICTAC. https://doi.org/10.1007/978-3-030-64276-1
Google Scholar
Digital Library
- Ezio Bartocci, Laura Kovács, and Miroslav Stankovic. 2020. Mora - Automatic Generation of Moment-Based Invariants. In Proc. of TACAS. https://doi.org/10.1007/978-3-030-45190-5_28
Google Scholar
Digital Library
- Kevin Batz, Mingshuai Chen, Benjamin Lucien Kaminski, Joost-Pieter Katoen, Christoph Matheja, and Philipp Schröer. 2021. Latticed k-Induction with an Application to Probabilistic Programs. In Proc. of CAV. https://doi.org/10.1007/978-3-030-81688-9_25
Google Scholar
Digital Library
- Stéphane Boucheron, Gábor Lugosi, and Pascal Massart. 2013. Concentration Inequalities - A Nonasymptotic Theory of Independence. Oxford University Press. https://doi.org/10.1093/acprof:oso/9780199535255.001.0001
Google Scholar
Cross Ref
- Olivier Bouissou, Eric Goubault, Sylvie Putot, Aleksandar Chakarov, and Sriram Sankaranarayanan. 2016. Uncertainty Propagation Using Probabilistic Affine Forms and Concentration of Measure Inequalities. In Proc. of TACAS. https://doi.org/10.1007/978-3-662-49674-9_13
Google Scholar
Digital Library
- Jason Breck, John Cyphert, Zachary Kincaid, and Thomas W. Reps. 2020. Templates and Recurrences: Better Together. In Proc. of PLDI. https://doi.org/10.1145/3385412.3386035
Google Scholar
Digital Library
- Aleksandar Chakarov and Sriram Sankaranarayanan. 2014. Expectation Invariants for Probabilistic Program Loops as Fixed Points. In Proc. of SAS. https://doi.org/10.1007/978-3-319-10936-7_6
Google Scholar
Cross Ref
- Krishnendu Chatterjee, Hongfei Fu, Amir Kafshdar Goharshady, and Ehsan Kafshdar Goharshady. 2020. Polynomial Invariant Generation for Non-deterministic Recursive Programs. In Proc. of PLDI. https://doi.org/10.1145/3385412
Google Scholar
Digital Library
- Yu-Fang Chen, Chih-Duo Hong, Bow-Yaw Wang, and Lijun Zhang. 2015. Counterexample-Guided Polynomial Loop Invariant Generation by Lagrange Interpolation. In Proc. of CAV. https://doi.org/10.1007/978-3-319-21690-4
Google Scholar
Cross Ref
- Yi Chou, Hansol Yoon, and Sriram Sankaranarayanan. 2020. Predictive Runtime Monitoring of Vehicle Models Using Bayesian Estimation and Reachability Analysis. In Proc. of IROS. https://doi.org/10.1109/IROS45743.2020.9340755
Google Scholar
Digital Library
- Guillaume Claret, Sriram K. Rajamani, Aditya V. Nori, Andrew D. Gordon, and Johannes Borgström. 2013. Bayesian Inference Using Data Flow Analysis. In Proc. of ESEC/FSE. https://doi.org/10.1145/2491411.2491423
Google Scholar
Digital Library
- Steven de Oliveira, Saddek Bensalem, and Virgile Prevosto. 2016. Polynomial Invariants by Linear Algebra. In Proc. of ATVA. https://doi.org/10.1007/978-3-319-46520-3_30
Google Scholar
Cross Ref
- Christian Dehnert, Sebastian Junges, Joost-Pieter Katoen, and Matthias Volk. 2017. A Storm is Coming: A Modern Probabilistic Model Checker. In Proc. of CAV. https://doi.org/10.1007/978-3-319-63390-9
Google Scholar
Cross Ref
- Rick Durrett. 2019. Probability: Theory and Examples. Cambridge University Press. https://doi.org/10.1017/9781108591034
Google Scholar
Cross Ref
- Azadeh Farzan and Zachary Kincaid. 2015. Compositional Recurrence Analysis. In Proc. of FMCAD. https://doi.org/10.1109/FMCAD.2015.7542253
Google Scholar
Cross Ref
- Yijun Feng, Lijun Zhang, David N. Jansen, Naijun Zhan, and Bican Xia. 2017. Finding Polynomial Loop Invariants for Probabilistic Programs. In Proc. of ATVA. https://doi.org/10.1007/978-3-319-68167-2_26
Google Scholar
Cross Ref
- Timon Gehr, Sasa Misailovic, and Martin T. Vechev. 2016. PSI: Exact Symbolic Inference for Probabilistic Programs. In Proc. of CAV. https://doi.org/10.1007/978-3-319-41528-4_4
Google Scholar
Cross Ref
- Zoubin Ghahramani. 2015. Probabilistic Machine Learning and Artificial Intelligence. Nature, https://doi.org/10.1038/nature14541
Google Scholar
Cross Ref
- Friedrich Gretz, Joost-Pieter Katoen, and Annabelle McIver. 2013. Prinsys - On a Quest for Probabilistic Loop Invariants. In Proc. of QEST. https://doi.org/10.1007/978-3-642-40196-1_17
Google Scholar
Digital Library
- Dominik Gruntz. 1996. On Computing Limits in a Symbolic Manipulation System. Ph. D. Dissertation. ETH Zürich. https://doi.org/10.3929/ETHZ-A-001631582
Google Scholar
Cross Ref
- Wilfred K. Hastings. 1970. Monte Carlo Sampling Methods Using Markov Chains and Their Applications. Biometrika, https://doi.org/10.2307/2334940
Google Scholar
Cross Ref
- Ted Herman. 1990. Probabilistic Self-Stabilization. Inform. Process. Lett., https://doi.org/10.1016/0020-0190(90)90107-9
Google Scholar
Digital Library
- Steven Holtzen, Guy Van den Broeck, and Todd D. Millstein. 2020. Scaling Exact Inference for Discrete Probabilistic Programs. In Proc. of OOPSLA. https://doi.org/10.1145/3428208
Google Scholar
Digital Library
- Steven Holtzen, Sebastian Junges, Marcell Vazquez-Chanlatte, Todd D. Millstein, Sanjit A. Seshia, and Guy Van den Broeck. 2021. Model Checking Finite-Horizon Markov Chains with Probabilistic Inference. In Proc. of CAV. https://doi.org/10.1007/978-3-030-81688-9_27
Google Scholar
Digital Library
- Andreas Humenberger, Maximilian Jaroschek, and Laura Kovács. 2017. Automated Generation of Non-Linear Loop Invariants Utilizing Hypergeometric Sequences. In Proc. of ISSAC. https://doi.org/10.1145/3087604.3087623
Google Scholar
Digital Library
- Andreas Humenberger, Maximilian Jaroschek, and Laura Kovács. 2018. Invariant Generation for Multi-Path Loops with Polynomial Assignments. In Proc. of VMCAI. https://doi.org/10.1007/978-3-319-73721-8_11
Google Scholar
Cross Ref
- Benjamin Lucien Kaminski, Joost-Pieter Katoen, and Christoph Matheja. 2019. On the Hardness of Analyzing Probabilistic Programs. Acta Informatica, https://doi.org/10.1007/s00236-018-0321-1
Google Scholar
Digital Library
- Benjamin Lucien Kaminski, Joost-Pieter Katoen, Christoph Matheja, and Federico Olmedo. 2016. Weakest Precondition Reasoning for Expected Run-Times of Probabilistic Programs. In Proc. of ESOP. https://doi.org/10.1007/978-3-662-49498-1
Google Scholar
Cross Ref
- Richard M. Karp. 1994. Probabilistic Recurrence Relations. J. ACM, https://doi.org/10.1145/195613.195632
Google Scholar
Digital Library
- Joost-Pieter Katoen, Annabelle McIver, Larissa Meinicke, and Carroll C. Morgan. 2010. Linear-Invariant Generation for Probabilistic Programs: Automated Support for Proof-Based Methods. In Proc. of SAS. https://doi.org/10.1007/978-3-642-15769-1_24
Google Scholar
Cross Ref
- Joost-Pieter Katoen, Ivan S. Zapreev, Ernst Moritz Hahn, Holger Hermanns, and David N. Jansen. 2011. The Ins and Outs of the Probabilistic Model Checker MRMC. Perform. Eval., https://doi.org/10.1016/j.peva.2010.04.001
Google Scholar
Digital Library
- Manuel Kauers and Peter Paule. 2011. The Concrete Tetrahedron - Symbolic Sums, Recurrence Equations, Generating Functions, Asymptotic Estimates. Springer. https://doi.org/10.1007/978-3-7091-0445-3
Google Scholar
Cross Ref
- Zachary Kincaid, Jason Breck, John Cyphert, and T. Reps. 2019. Closed Forms for Numerical Loops. In Proc. of POPL. https://doi.org/10.1145/3290368
Google Scholar
Digital Library
- Zachary Kincaid, John Cyphert, Jason Breck, and T. Reps. 2018. Non-Linear Reasoning for Invariant Synthesis. In Proc. of POPL. https://doi.org/10.1145/3158142
Google Scholar
Digital Library
- John E. Kolassa. 2006. Series Approximation Methods in Statistics. Springer. https://doi.org/10.1007/0-387-32227-2
Google Scholar
Cross Ref
- Laura Kovács. 2008. Reasoning Algebraically About P-Solvable Loops. In Proc. of TACAS. https://doi.org/10.1007/978-3-540-78800-3_18
Google Scholar
Cross Ref
- Dexter Kozen. 1985. A Probabilistic PDL. J. Comput. System Sci., https://doi.org/10.1016/0022-0000(85)90012-1
Google Scholar
Cross Ref
- Satoshi Kura, Natsuki Urabe, and Ichiro Hasuo. 2019. Tail Probabilities for Randomized Program Runtimes via Martingales for Higher Moments. In Proc. of TACAS. https://doi.org/10.1007/978-3-030-17465-1_8
Google Scholar
Cross Ref
- Marta Z. Kwiatkowska, Gethin Norman, and David Parker. 2011. PRISM 4.0: Verification of Probabilistic Real-Time Systems. In Proc. of CAV. https://doi.org/10.1007/978-3-642-22110-1
Google Scholar
Cross Ref
- Marta Z. Kwiatkowska, Gethin Norman, and David Parker. 2012. Probabilistic Verification of Herman’s Self-Stabilisation Algorithm. Formal Aspects of Computing, https://doi.org/10.1007/s00165-012-0227-6
Google Scholar
Digital Library
- Milton F. Maritz. 2020. A Note on Exact Solutions of the Logistic Map. Chaos: An Interdisciplinary Journal of Nonlinear Science, https://doi.org/10.1063/1.5125097
Google Scholar
Cross Ref
- Robert M. May. 1976. Simple Mathematical Models With Very Complicated Dynamics. Nature, https://doi.org/10.1038/261459a0
Google Scholar
Cross Ref
- Annabelle McIver and Carroll Morgan. 2005. Abstraction, Refinement and Proof for Probabilistic Systems. Springer. https://doi.org/10.1007/b138392
Google Scholar
Cross Ref
- Marcel Moosbrugger, Miroslav Stankovič, Ezio Bartocci, and Laura Kovács. 2022. This is the Moment for Probabilistic Loops - Artifact (Polar). https://doi.org/10.5281/zenodo.7055030
Google Scholar
Digital Library
- Rajeev Motwani and Prabhakar Raghavan. 1995. Randomized Algorithms. Cambridge University Press. https://doi.org/10.1017/cbo9780511814075
Google Scholar
Cross Ref
- Praveena Narayanan, Jacques Carette, Wren Romano, Chung chieh Shan, and Robert Zinkov. 2016. Probabilistic Inference by Program Transformation in Hakaru (System Description). In Proc. of FLOPS. https://doi.org/10.1007/978-3-319-29604-3_5
Google Scholar
Cross Ref
- Enric Rodríguez-carbonell and Deepak Kapur. 2004. Automatic Generation of Polynomial Loop Invariants: Algebraic Foundations. In Proc. of ISSAC. https://doi.org/10.1145/1005285.1005324
Google Scholar
Digital Library
- Feras A. Saad, Martin C. Rinard, and Vikash K. Mansinghka. 2021. SPPL: Probabilistic Programming With Fast Exact Symbolic Inference. In Proc. of PLDI. https://doi.org/10.1145/3453483.3454078
Google Scholar
Digital Library
- Konstantin Selyunin, Denise Ratasich, Ezio Bartocci, Md. Ariful Islam, Scott A. Smolka, and Radu Grosu. 2015. Neural Programming: Towards Adaptive Control in Cyber-Physical Systems. In Proc. of CDC. https://doi.org/10.1109/CDC.2015.7403319
Google Scholar
Cross Ref
- Miroslav Stankovic, Ezio Bartocci, and Laura Kovács. 2022. Moment-Based Analysis of Bayesian Network Properties. Theor. Comput. Sci., https://doi.org/10.1016/j.tcs.2021.12.021
Google Scholar
Digital Library
- Di Wang, Jan Hoffmann, and Thomas Reps. 2021. Central Moment Analysis for Cost Accumulators in Probabilistic Programs. In Proc. of PLDI. https://doi.org/10.1145/3453483.3454062
Google Scholar
Digital Library
- Stanley L. Warner. 1965. Randomized Response: A Survey Technique for Eliminating Evasive Answer Bias. J. Am. Stat. Assoc., https://doi.org/10.1080/01621459.1965.10480775
Google Scholar
Cross Ref
- Håkan L. S. Younes and Reid G. Simmons. 2006. Statistical probabilistic model checking with a focus on time-bounded properties. Inf. Comput., https://doi.org/10.1016/j.ic.2006.05.002
Google Scholar
Digital Library
Index Terms
This is the moment for probabilistic loops
Recommendations
Moment-Based Invariants for Probabilistic Loops with Non-polynomial Assignments
Quantitative Evaluation of SystemsAbstractWe present a method to automatically approximate moment-based invariants of probabilistic programs with non-polynomial updates of continuous state variables to accommodate more complex dynamics. Our approach leverages polynomial chaos expansion to ...
Stochastic invariants for probabilistic termination
POPL '17Termination is one of the basic liveness properties, and we study the termination problem for probabilistic programs with real-valued variables. Previous works focused on the qualitative problem that asks whether an input program terminates with ...
Stochastic invariants for probabilistic termination
POPL '17: Proceedings of the 44th ACM SIGPLAN Symposium on Principles of Programming LanguagesTermination is one of the basic liveness properties, and we study the termination problem for probabilistic programs with real-valued variables. Previous works focused on the qualitative problem that asks whether an input program terminates with ...






Comments