{"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.