终止性分析概述

termination analysis is program analysis which attempts to determine whether the evaluation of a given program halts for each input. This means to determine whether the input program computes a total function.

非终止性分析 一般和终止性分析共同使用。

由于停机问题是不可判定的,终止性也是不可判定的(且非半可判定)。在不加限制的情况下,任何可靠的终止性证明工具都不是完备的。但是,正如11年的综述文章中所说:

Unfortunately, many have drawn too strong of a conclusion about the prospects of automatic program termination proving and falsely believe we are always unable to prove termination, rather than more benign consequence that we are unable to always prove termination. Phrases like “but that’s like the termination problem” are often used to end discussions that might otherwise have led to viable partial solutions for real but undecidable problems.

Whereas in the past a software developer hoping to build practical tools for solving something related to termination might have been frightened off by a colleague’s retort “but that’s like the termination problem,” perhaps in the future the developer will instead adapt techniques from within modern termination provers in order to develop a partial solution to the problem of interest.

Proving program termination 2011

证明终止性的方法是找termination argument/proof。有很多方法尝试构造证明,本质上都是去寻找 ranking function,但形式可能不同。每一种方法只能从程序的一个方面进行考虑其终止性,无法找到程序终止的全部原因。

目前的研究分为两个大的方向:

  1. 限定程序的形式,或是ranking function的形式,考虑简单程序的终止性的可判定性以及求解的算法等。一般会表示为 lasso 或简单循环的形式。
  2. 使用上述简单程序的结论,通过组合或者模块化证明的方法,实现对general形式的程序的终止性证明。一般会提出一种算法的框架,把问题归约到简单程序的情况。

此外,并发程序的终止性 证明也得到了一些研究