Termination is a fundamental question in the analysis of probabilistic imperative programs. We consider the qualitative and quantitative probabilistic termination problems for an imperative programming model with discrete probabilistic choice and demonic bounded nondeterminism. The qualitative question asks if the program terminates almost surely, no matter how nondeterminism is resolved; the quantitative question asks for a bound on the probability of termination. Despite a long and rich literature on the topic, no sound and relatively complete proof systems were known for this problem. We provide the first sound and relatively complete proof rules for proving qualitative and quantitative termination in the assertion language of arithmetic. Our proof rules use supermartingales as estimates of likelihood of the prgroam's evolution - the key insight is to use appropriately defined finite-state sub-instances. Our completeness result shows how to construct a suitable supermartingales from an almost-surely terminating program. We also show that proofs of termination in many existing proof systems can be transformed to proofs in our system, pointing to its applicability in practice. As an application of our proof rule, we show a proof of almost sure termination for the two-dimensional random walker.
翻译:终止性是概率性命令式程序分析中的基本问题。我们考虑带有离散概率选择和恶魔有界非确定性的命令式编程模型的定性与定量概率终止问题。定性问题询问无论非确定性如何解析,程序是否几乎必然终止;定量问题则要求给出终止概率的界限。尽管该领域已有丰富的研究文献,但此前尚未存在针对该问题的可靠且相对完备的证明系统。我们首次在算术断言语言中为定性与定量终止性提供了可靠且相对完备的证明规则。我们的证明规则使用超鞅作为程序演化可能性的估计——关键洞察在于恰当定义有限状态子实例。我们的完备性结果表明如何从几乎必然终止的程序构造合适的超鞅。同时证明现有许多证明系统中的终止性证明可转化为我们系统中的证明,这表明其实际适用性。作为证明规则的应用示例,我们对二维随机游走给出了几乎必然终止性的证明。