Termination 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 probability~1 (almost-sure termination). A powerful approach for this qualitative problem is the notion of ranking supermartingales with respect to a given set of invariants. The quantitative problem (probabilistic termination) asks for bounds on the termination probability. A fundamental and conceptual drawback of the existing approaches to address probabilistic termination is that even though the supermartingales consider the probabilistic behavior of the programs, the invariants are obtained completely ignoring the probabilistic aspect.
In this work we address the probabilistic termination problem for linear-arithmetic probabilistic programs with nondeterminism. We define the notion of {\em stochastic invariants}, which are constraints along with a probability bound that the constraints hold. We introduce a concept of {\em repulsing supermartingales}. First, we show that repulsing supermartingales can be used to obtain bounds on the probability of the stochastic invariants. Second, we show the effectiveness of repulsing supermartingales in the following three ways: (1)~With a combination of ranking and repulsing supermartingales we can compute lower bounds on the probability of termination; (2)~repulsing supermartingales provide witnesses for refutation of almost-sure termination; and (3)~with a combination of ranking and repulsing supermartingales we can establish persistence properties of probabilistic programs.
We also present results on related computational problems and an experimental evaluation of our approach on academic examples.
Automated Termination Analysis of Polynomial Probabilistic Programs
概率程序的终止行为取决于随机分配的结果。几乎确定终止(AST)是关于程序是否在所有可能的输入上以概率1终止的问题。正几乎必然终止(Positive Almost Sure Termination,PAST)是指在有限的期望步数内终止。本文提出了一种完全自动化的方法来终止分析的概率时程序,其后卫和表达式是多项式表达式。由于证明(正)AST一般是不可判定的,现有的证明规则通常提供了充分的条件。这些条件大多涉及上鞅的约束。我们认为,从文献中的四个证明规则,并扩展这些与现有的证明规则的概括(P)AST。我们自动化的证明规则,有效地计算渐近界多项式的程序变量。这些界限被用来决定一个证明规则的充分条件-包括上鞅的约束条件。因此,我们的软件工具琥珀可以检查AST,PAST,以及他们的否定的一个大类的多项式概率程序,同时进行终止推理完全与多项式证人。实验结果表明,我们的广义证明规则的优点,并证明琥珀可以处理概率程序,是其他国家的最先进的工具。
Modular Verification for Almost-Sure Termination of Probabilistic Programs
在这项工作中,我们考虑几乎肯定终止问题的概率程序,询问是否一个给定的概率程序终止概率为1。可伸缩的程序分析方法通常依赖于模块化作为其理论基础。在非概率程序中,Floyd-霍尔逻辑的经典变式规则(V-规则)为模块化分析提供了基础。将该规则扩展到概率程序的几乎确定终止是相当棘手的,并且在[Fioriti and Hermanns 2015]中提出了一个概率变体。虽然所提出的概率变量谨慎地解决了可积性的关键问题,我们表明,所提出的模块化规则仍然是不健全的几乎肯定终止的概率程序。除了建立以前的规则的不健全,我们的贡献如下:首先,我们提出了一个健全的模块规则几乎确定终止的概率程序。我们的方法是基于一个新的概念下降上鞅。其次,对于算法方法,我们考虑下降上鞅是线性的,并表明它们可以在多项式时间合成。最后,我们提出了各种基准测试和几个自然的例子,模拟各种类型的嵌套而循环的概率程序的实验结果,并证明我们的方法是能够有效地证明其几乎肯定的终止属性。