We study termination of higher-order probabilistic functional programs with recursion, stochastic conditioning and sampling from continuous distributions. Reasoning about the termination probability of programs with continuous distributions is hard, because the enumeration of terminating executions cannot provide any non-trivial bounds. We present a new operational semantics based on traces of intervals, which is sound and complete with respect to the standard sampling-based semantics, in which (countable) enumeration can provide arbitrarily tight lower bounds. Consequently we obtain the first proof that deciding almost-sure termination (AST) for programs with continuous distributions is $\Pi^0_2$-complete. We also provide a compositional representation of our semantics in terms of an intersection type system. In the second part, we present a method of proving AST for non-affine programs, i.e., recursive programs that can, during the evaluation of the recursive body, make multiple recursive calls (of a first-order function) from distinct call sites. Unlike in a deterministic language, the number of recursion call sites has direct consequences on the termination probability. Our framework supports a proof system that can verify AST for programs that are well beyond the scope of existing methods. We have constructed prototype implementations of our method of computing lower bounds of termination probability, and AST verification.
翻译:我们用连续分布的循环、随机调节和抽样方法研究终止高排序概率功能性程序。 持续分布的方案的终止概率很难, 因为终止处决的查点不能提供任何非三边界限。 我们提出一种新的基于间隔的操作语义, 相对于标准的基于抽样的语义学来说, 这是合理和完整的, 在(可计量的)查点可以提供任意紧凑的下限。 因此, 我们获得了第一个证据, 证明持续分布的方案的几乎确定终止( AST) 是 $\ Pi% 0_ 2$- 完成的。 我们还以交叉类型系统的形式提供了我们语义的构成表示。 在第二部分, 我们提出了一个方法, 证明AST 用于非报复性程序, 也就是说, 循环性程序可以( 可计量的) 提供来自不同呼叫站点的多次重复性电话( 一级功能 ) 。 不同于一种确定性语言, 递解调呼叫站点的数量, 以交叉类型系统的形式表示我们语系的语义代表了我们语系的构成 终止概率范围的直接后果。