{"title":"用Lean证明可逆基元置换的表达能力和算法","authors":"Giacomo Maletto , Luca Roversi","doi":"10.1016/j.jlamp.2023.100923","DOIUrl":null,"url":null,"abstract":"<div><p>Reversible primitive permutations (<span>RPP</span>) is a class of recursive functions that models reversible computation. We present a proof, which has been verified using the proof-assistant <span>Lean</span>, that demonstrates <span>RPP</span> can encode every primitive recursive function (<span>PRF</span>-completeness) and that each <span>RPP</span> can be encoded as a primitive recursive function (<span>PRF</span>-soundness). Our proof of <span>PRF</span>-completeness is simpler and fixes some errors in the original proof, while also introducing a new reversible iteration scheme for <span>RPP</span>. By keeping the formalization and semi-automatic proofs simple, we are able to identify a single programming pattern that can generate a set of reversible algorithms within <span>RPP</span>: Cantor pairing, integer division quotient/remainder, and truncated square root. Finally, <span>Lean</span> source code is available for experiments on reversible computation whose properties can be certified.</p></div>","PeriodicalId":48797,"journal":{"name":"Journal of Logical and Algebraic Methods in Programming","volume":"136 ","pages":"Article 100923"},"PeriodicalIF":0.7000,"publicationDate":"2023-10-23","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"https://www.sciencedirect.com/science/article/pii/S2352220823000779/pdfft?md5=ad2af14a775f13438b00a61e5119077a&pid=1-s2.0-S2352220823000779-main.pdf","citationCount":"0","resultStr":"{\"title\":\"Certifying expressive power and algorithms of reversible primitive permutations with Lean\",\"authors\":\"Giacomo Maletto , Luca Roversi\",\"doi\":\"10.1016/j.jlamp.2023.100923\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"<div><p>Reversible primitive permutations (<span>RPP</span>) is a class of recursive functions that models reversible computation. We present a proof, which has been verified using the proof-assistant <span>Lean</span>, that demonstrates <span>RPP</span> can encode every primitive recursive function (<span>PRF</span>-completeness) and that each <span>RPP</span> can be encoded as a primitive recursive function (<span>PRF</span>-soundness). Our proof of <span>PRF</span>-completeness is simpler and fixes some errors in the original proof, while also introducing a new reversible iteration scheme for <span>RPP</span>. By keeping the formalization and semi-automatic proofs simple, we are able to identify a single programming pattern that can generate a set of reversible algorithms within <span>RPP</span>: Cantor pairing, integer division quotient/remainder, and truncated square root. Finally, <span>Lean</span> source code is available for experiments on reversible computation whose properties can be certified.</p></div>\",\"PeriodicalId\":48797,\"journal\":{\"name\":\"Journal of Logical and Algebraic Methods in Programming\",\"volume\":\"136 \",\"pages\":\"Article 100923\"},\"PeriodicalIF\":0.7000,\"publicationDate\":\"2023-10-23\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"https://www.sciencedirect.com/science/article/pii/S2352220823000779/pdfft?md5=ad2af14a775f13438b00a61e5119077a&pid=1-s2.0-S2352220823000779-main.pdf\",\"citationCount\":\"0\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"Journal of Logical and Algebraic Methods in Programming\",\"FirstCategoryId\":\"94\",\"ListUrlMain\":\"https://www.sciencedirect.com/science/article/pii/S2352220823000779\",\"RegionNum\":4,\"RegionCategory\":\"数学\",\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"Q3\",\"JCRName\":\"COMPUTER SCIENCE, THEORY & METHODS\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"Journal of Logical and Algebraic Methods in Programming","FirstCategoryId":"94","ListUrlMain":"https://www.sciencedirect.com/science/article/pii/S2352220823000779","RegionNum":4,"RegionCategory":"数学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q3","JCRName":"COMPUTER SCIENCE, THEORY & METHODS","Score":null,"Total":0}
Certifying expressive power and algorithms of reversible primitive permutations with Lean
Reversible primitive permutations (RPP) is a class of recursive functions that models reversible computation. We present a proof, which has been verified using the proof-assistant Lean, that demonstrates RPP can encode every primitive recursive function (PRF-completeness) and that each RPP can be encoded as a primitive recursive function (PRF-soundness). Our proof of PRF-completeness is simpler and fixes some errors in the original proof, while also introducing a new reversible iteration scheme for RPP. By keeping the formalization and semi-automatic proofs simple, we are able to identify a single programming pattern that can generate a set of reversible algorithms within RPP: Cantor pairing, integer division quotient/remainder, and truncated square root. Finally, Lean source code is available for experiments on reversible computation whose properties can be certified.
期刊介绍:
The Journal of Logical and Algebraic Methods in Programming is an international journal whose aim is to publish high quality, original research papers, survey and review articles, tutorial expositions, and historical studies in the areas of logical and algebraic methods and techniques for guaranteeing correctness and performability of programs and in general of computing systems. All aspects will be covered, especially theory and foundations, implementation issues, and applications involving novel ideas.