Proof Techniques for Synthesis of Sorting Algorithms

I. Dramnesc, T. Jebelean
{"title":"Proof Techniques for Synthesis of Sorting Algorithms","authors":"I. Dramnesc, T. Jebelean","doi":"10.1109/SYNASC.2011.23","DOIUrl":null,"url":null,"abstract":"In the context of constructive synthesis of sorting algorithms, starting from the specification of the problem (input and output conditions), the proof of existence of a sorted tuple is performed inductively and we design, implement, and experiment with different proof techniques: First we use a back-chaining mechanism similar to a Prolog engine for first order logic, in which meta-variables are used for finding the existential witnesses. In order to overcome the search space explosion, we introduce various specific prove-solve methods for the theory of tuples. For instance, the equivalence relation on tuples \"have same elements'' can be treated using a normal form based on multisets -- this leads to a very efficient inference rule for rewriting. When reasoning about sorting, we also have an ordering relation between elements. We extend this to an ordering between an element and a tuple, and even between tuples. Ordering relations create specific problems in Prolog style reasoning, because of transitivity and reflexivity. We demonstrate that ordering can be treated very efficiently by decomposing atomic statements into simpler ones (containing only symbols instead of terms), both for goals (backward reasoning) as well as for assumptions (forward reasoning). This leads to an interesting combination of backward and forward inferences which goes beyond and complements Prolog style reasoning. Finally, we develop a solving mechanism for finding sorted tuples, which performs the proof more efficiently, by combining relatively simple inference rules and small searches with goal directed solving rules. The techniques are implemented in the Theorem a system and are able to produce automatically proofs and algorithms for various problems: Insertion Sort, Insertion, Merge Sort, and Merge. Besides the special proof techniques, this work also gives useful hints about finding appropriate induction principles for tuples, as well as for the construction of appropriate collections of properties of tuples which are necessary for reasoning about sorting.","PeriodicalId":184344,"journal":{"name":"2011 13th International Symposium on Symbolic and Numeric Algorithms for Scientific Computing","volume":"16 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2011-09-26","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"14","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"2011 13th International Symposium on Symbolic and Numeric Algorithms for Scientific Computing","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/SYNASC.2011.23","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 14

Abstract

In the context of constructive synthesis of sorting algorithms, starting from the specification of the problem (input and output conditions), the proof of existence of a sorted tuple is performed inductively and we design, implement, and experiment with different proof techniques: First we use a back-chaining mechanism similar to a Prolog engine for first order logic, in which meta-variables are used for finding the existential witnesses. In order to overcome the search space explosion, we introduce various specific prove-solve methods for the theory of tuples. For instance, the equivalence relation on tuples "have same elements'' can be treated using a normal form based on multisets -- this leads to a very efficient inference rule for rewriting. When reasoning about sorting, we also have an ordering relation between elements. We extend this to an ordering between an element and a tuple, and even between tuples. Ordering relations create specific problems in Prolog style reasoning, because of transitivity and reflexivity. We demonstrate that ordering can be treated very efficiently by decomposing atomic statements into simpler ones (containing only symbols instead of terms), both for goals (backward reasoning) as well as for assumptions (forward reasoning). This leads to an interesting combination of backward and forward inferences which goes beyond and complements Prolog style reasoning. Finally, we develop a solving mechanism for finding sorted tuples, which performs the proof more efficiently, by combining relatively simple inference rules and small searches with goal directed solving rules. The techniques are implemented in the Theorem a system and are able to produce automatically proofs and algorithms for various problems: Insertion Sort, Insertion, Merge Sort, and Merge. Besides the special proof techniques, this work also gives useful hints about finding appropriate induction principles for tuples, as well as for the construction of appropriate collections of properties of tuples which are necessary for reasoning about sorting.
排序算法综合的证明技术
在排序算法的建设性综合背景下,从问题的规范(输入和输出条件)开始,对排序元组的存在性进行归纳性证明,我们设计、实现和实验了不同的证明技术:首先,我们使用类似于一阶逻辑Prolog引擎的后链机制,其中使用元变量来寻找存在性见证。为了克服搜索空间爆炸的问题,我们介绍了元组理论的各种具体的证明求解方法。例如,元组上“具有相同元素”的等价关系可以使用基于多集的标准形式来处理——这导致了非常有效的重写推理规则。在对排序进行推理时,元素之间也有排序关系。我们将其扩展到元素和元组之间的排序,甚至元组之间的排序。由于及物性和反身性,排序关系在Prolog风格的推理中产生了特定的问题。我们证明,通过将原子语句分解为更简单的语句(只包含符号而不是术语),对于目标(向后推理)和假设(向前推理),可以非常有效地处理排序。这导致了向后和向前推理的有趣组合,超越并补充了Prolog风格的推理。最后,我们开发了一种查找排序元组的求解机制,通过将相对简单的推理规则和小搜索与目标导向求解规则相结合,可以更有效地执行证明。这些技术在定理a系统中实现,能够自动生成各种问题的证明和算法:插入排序、插入排序、合并排序和合并。除了特殊的证明技术之外,这项工作还提供了关于为元组找到适当的归纳原则的有用提示,以及对于排序推理所必需的元组属性的适当集合的构造。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约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学术官方微信