反对终止直接递归的魔鬼代言人
A Devil's Advocate against Termination of Direct Recursion
摘要:
魔鬼的拥护者是一个反对一个主张的人,不是作为一个坚定的对手,而是为了确定这个主张的有效性。我们感兴趣的是一个反对终止程序的魔鬼代言人。他通过产生一个可以导致原始程序不终止的恶意程序来做到这一点。通过检查和运行恶意程序,可以深入了解不终止的潜在原因,并产生终止的反例。我们介绍我们的方法使用并发程序设计语言约束处理规则(约束)。与其他声明性语言一样,非终止性通过无限递归发生。给定一个自递归规则,我们自动地从它生成一个或多个魔鬼规则。魔鬼规则的构造很简单,不需要猜测。魔鬼的规则很简单。例如,对于具有单递归的规则,它们是非递归的。我们表明,魔鬼的规则是最大的邪恶在以下意义上:对于任何程序,包含自递归规则和任何无限计算,通过该规则在该程序中,有一个相应的无限计算与递归规则和魔鬼的规则。在这种情况下,恶意规则充当非终止性的有限见证。另一方面,如果魔鬼规则不表现出无限的计算,递归规则是无条件终止的。我们还确定的情况下,静态分析的魔鬼的规则决定终止或不终止的递归规则。
英文摘要:
A devil's advocate is one who argues against a claim, not as a committed opponent but in order to determine the validity of the claim. We are interested in a devil's advocate that argues against termination of a program. He does so by producing a maleficent program that can cause the non-termination of the original program. By inspecting and running the malicious program, one may gain insight into the potential reasons for non-termination and produce counterexamples for termination. We introduce our method using the concurrent programming language Constraint Handling Rules (CHR). Like in other declarative languages, non-termination occurs through unbounded recursion. Given a self-recursive rule, we automatically generate one or more devil's rules from it. The construction of the devil's rules is straightforward and involves no guessing. The devil's rules can be simple. For example, they are non-recursive for rules with single recursion. We show that the devil's rules are maximally vicious in the following sense: For any program that contains the self-recursive rule and for any infinite computation through that rule in that program, there is a corresponding infinite computation with the recursive rule and the devil's rules alone. In that case, the malicious rules serve as a finite witness for non-termination. On the other hand, if the devil's rules do not exhibit an infinite computation, the recursive rule is unconditionally terminating. We also identify cases where the static analysis of the devil's rule decides termination or non-termination of the recursive rule.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。