A devil's advocate against termination of direct recursion

Thom W. Frühwirth
{"title":"A devil's advocate against termination of direct recursion","authors":"Thom W. Frühwirth","doi":"10.1145/2790449.2790518","DOIUrl":null,"url":null,"abstract":"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 in 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 straight-forward 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.","PeriodicalId":445788,"journal":{"name":"Proceedings of the 17th International Symposium on Principles and Practice of Declarative Programming","volume":"18 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2015-07-14","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"5","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Proceedings of the 17th International Symposium on Principles and Practice of Declarative Programming","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/2790449.2790518","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 5

Abstract

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 in 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 straight-forward 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.
反对直接递归终止的魔鬼拥护者
魔鬼代言人(devil's advocate)是指反对某项主张的人,不是作为坚定的反对者,而是为了确定该主张的有效性。我们感兴趣的是一个反对终止项目的人。他通过制作一个恶意程序来实现这一点,该程序可以导致原始程序的不终止。通过检查和运行恶意程序,可以深入了解不终止的潜在原因,并产生终止的反例。我们在并发编程语言约束处理规则(CHR)中介绍了我们的方法。与其他声明性语言一样,非终止是通过无界递归实现的。给定一个自递归规则,我们自动从中生成一个或多个魔鬼规则。魔鬼规则的构建是直截了当的,不需要猜测。魔鬼的规则可能很简单。例如,对于具有单一递归的规则,它们是非递归的。我们在以下意义上证明了魔鬼规则是最大恶性的:对于任何包含自递归规则的程序,以及对于该程序中通过该规则进行的任何无限计算,存在与递归规则和魔鬼规则单独对应的无限计算。在这种情况下,恶意规则充当不终止的有限见证。另一方面,如果魔鬼规则不显示无限计算,则递归规则无条件终止。我们还确定了对魔鬼规则的静态分析决定终止或不终止递归规则的情况。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术官方微信