# Weakest Precondition Reasoning for Expected Run-Times of Probabilistic Programs

@inproceedings{Kaminski2016WeakestPR, title={Weakest Precondition Reasoning for Expected Run-Times of Probabilistic Programs}, author={Benjamin Lucien Kaminski and Joost-Pieter Katoen and Christoph Matheja and Federico Olmedo}, booktitle={ESOP}, year={2016} }

This paper presents a wp---style calculus for obtaining bounds on the expected run---time of probabilistic programs. Its application includes determining the possibly infinite expected termination time of a probabilistic program and proving positive almost---sure termination--does a program terminate with probability one in finite expected time? We provide several proof rules for bounding the run---time of loops, and prove the soundness of the approach with respect to a simple operational model…

## 114 Citations

Weakest Precondition Reasoning for Expected Runtimes of Randomized Algorithms

- Computer Science, MathematicsJ. ACM
- 2018

This article presents a wp--style calculus for obtaining bounds on the expected runtime of randomized algorithms, and shows that the approach is a conservative extension of Nielson’s approach for reasoning about the runtime of deterministic programs.

Proving Expected Sensitivity of Probabilistic Programs with Randomized Execution Time

- Computer ScienceArXiv
- 2019

This work presents a sound approach for sensitivity analysis of probabilistic while loops, where the number of iteration is not fixed, but is randomized and only the expected number of iterations is finite.

Proving expected sensitivity of probabilistic programs with randomized variable-dependent termination time

- Computer ScienceProc. ACM Program. Lang.
- 2020

This work considers probabilistic while loops where the number of iterations is not fixed, but randomized and depends on the initial input values, and presents a sound approach for proving expected sensitivity of such programs.

Termination Analysis of Probabilistic Programs with Martingales

- Computer Science
- 2020

This work surveys the main techniques related to martingale-based approach for termination analysis of probabilistic programs, and asks whether the expected termination time is bounded.

Reasoning about Recursive Probabilistic Programs*

- Computer Science2016 31st Annual ACM/IEEE Symposium on Logic in Computer Science (LICS)
- 2016

A wp–style calculus for obtaining expectations on the outcomes of (mutually) recursive probabilistic programs and bounds on the expected runtime of recursive programs that can be used to determine the time until termination of such programs are given.

Time-bounded termination analysis for probabilistic programs with delays

- Computer ScienceInf. Comput.
- 2020

Bounded expectations: resource analysis for probabilistic programs

- Computer ScienceProceedings of the 39th ACM SIGPLAN Conference on Programming Language Design and Implementation
- 2018

A new static analysis for deriving upper bounds on the expected resource consumption of probabilistic programs that combines the clarity and compositionality of a weakest-precondition calculus with the efficient automation of AARA.

Bounded expectations: resource analysis for probabilistic programs

- Computer SciencePLDI
- 2018

A new static analysis for deriving upper bounds on the expected resource consumption of probabilistic programs that combines the clarity and compositionality of a weakest-precondition calculus with the efficient automation of AARA.

A new rule for almost-certain termination of probabilistic and demonic programs

- MathematicsArXiv
- 2016

A new rule for termination with probability one, also known as "almost-certain termination", is proposed and proved, which suffices for termination of the unbounded symmetric random walk in both one- and two dimensions.

Proving Almost-Sure Termination of Probabilistic Programs via Incremental Pruning

- Computer ScienceArXiv
- 2020

This work shows how to relax the strong nonnegativity condition and still provide soundness guarantee for almost-sure termination, and presents an incremental approach where the process of computing lexicographic RSMs proceeds by iterative pruning of parts of the program that were already shown to be terminating, in cooperation with a safety prover.

## References

SHOWING 1-10 OF 30 REFERENCES

Probabilistic Program Analysis with Martingales

- Computer Science, MathematicsCAV
- 2013

We present techniques for the analysis of infinite state probabilistic programs to synthesize probabilistic invariants and prove almost-sure termination. Our analysis is based on the notion of…

A Formal Approach to Probabilistic Termination

- Computer ScienceTPHOLs
- 2002

A probabilistic version of the while loop is presented, in the context of the mechanised framework for verifying probabilism programs, and this condition is naturally interpreted as from every starting state, the whileloop will terminate with probability 1.

Probabilistic Termination: Soundness, Completeness, and Compositionality

- Computer SciencePOPL 2015
- 2015

A framework to prove almost sure termination for probabilistic programs with real valued variables, based on ranking supermartingales, which is proven sound and complete for a meaningful class of programs involving randomization and bounded nondeterminism.

Runtime Analysis of Probabilistic Programs with Unbounded Recursion

- Computer Science, MathematicsICALP
- 2011

It is proved that for every pPDA the probability of performing a long run decreases exponentially in the length of the run, if and only if the expected runtime in the pPda is finite and the bounds are asymptotically tight.

A Hoare-Like Proof System for Analysing the Computation Time of Programs

- Computer ScienceSci. Comput. Program.
- 1987

An Abstract Analysis of the Probabilistic Termination of Programs

- Computer ScienceSAS
- 2001

This paper proposes a method to automatically prove the probabilistic termination of programs using exponential bounds on the tail of the distribution, and applies this method to an example and gives some directions as to how to implement it.

Abstraction, Refinement and Proof for Probabilistic Systems

- Computer ScienceMonographs in Computer Science
- 2005

Probabilistic guarded commands and their refinement logic.- to pGCL: Its logic and its model.- Probabilistic loops: Invariants and variants.- Case studies in termination: Choice coordination, the…

Formal Development and Verification of Approximation Algorithms Using Auxiliary Variables

- Computer ScienceLOPSTR
- 2003

This work shows how efficient approximation algorithms and worst-case bounds for the quality of their results can be developed and verified as structured programs and shows that the elimination procedure preserves validity of proofs.

Automating program analysis

- Computer ScienceJACM
- 1988

The first part of the paper shows that previous theoretical work on the semantics of probabilistic programs and on the correctness of performance annotated programs can be used to automate the average-case analysis of simple programs containing assignments, conditionals, and loops and presents an original method that generalizes the previous approach and is applicable to functional programs that make use of recursion and complex data structures.

Principles of model checking

- Computer Science
- 2008

Principles of Model Checking offers a comprehensive introduction to model checking that is not only a text suitable for classroom use but also a valuable reference for researchers and practitioners in the field.