Skip to main content

Certifying Algorithms and Relevant Properties of Reversible Primitive Permutations with Lean

  • Conference paper
  • First Online:
Reversible Computation (RC 2022)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 13354))

Included in the following conference series:

Abstract

Reversible Primitive Permutations (RPP) are recursively defined functions designed to model Reversible Computation. We illustrate a proof, fully developed with the proof-assistant Lean, certifying that: “RPP can encode every Primitive Recursive Function”. Our reworking of the original proof of that statement is conceptually simpler, fixes some bugs, suggests a new more primitive reversible iteration scheme for RPP, and, in order to keep formalization and semi-automatic proofs simple, led us to identify a single pattern that can generate some useful reversible algorithms in RPP: Cantor Pairing, Quotient/Reminder of integer division, truncated Square Root. Our Lean source code is available for experiments on Reversible Computation whose properties can be certified.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Similar content being viewed by others

References

  1. Asperti, A., Coen, C.S., Tassi, E., Zacchiroli, S.: User interaction with the matita proof assistant. J. Autom. Reasoning 39, 109–139 (2007)

    Article  Google Scholar 

  2. Cantor, G.: Ein beitrag zur mannigfaltigkeitslehre. J. für die reine und angewandte Mathematik 1878(84), 242–258 (1878)

    MathSciNet  MATH  Google Scholar 

  3. Carneiro, M.: Computability.primrec. https://leanprover-community.github.io/mathlib_docs/computability/primrec.html

  4. Carneiro, M.: Formalizing computability theory via partial recursive functions. In: 10th International Conference on Interactive Theorem Proving, ITP 2019, 9–12 September 2019, Portland, OR, USA, pp. 12:1–12:17 (2019)

    Google Scholar 

  5. de Moura, L., Kong, S., Avigad, J., van Doorn, F., von Raumer, J.: The lean theorem prover (system description). In: Felty, A.P., Middeldorp, A. (eds.) CADE 2015. LNCS (LNAI), vol. 9195, pp. 378–388. Springer, Cham (2015). https://doi.org/10.1007/978-3-319-21401-6_26

    Chapter  Google Scholar 

  6. De Vos, A.: Reversible Computing - Fundamentals, Quantum Computing, and Applications. Wiley, Hoboken (2010)

    Google Scholar 

  7. Jacopini, G., Mentrasti, P.: Generation of invertible functions. Theor. Comput. Sci. 66(3), 289–297 (1989)

    Article  MathSciNet  Google Scholar 

  8. Maletto, G.: A Formal Verification of Reversible Primitive Permutations. BSc Thesis, Dipartimento di Matematica - Torino, October 2021. https://github.com/GiacomoMaletto/RPP/tree/main/Tesi

  9. Maletto, G.: RPP in LEAN. https://github.com/GiacomoMaletto/RPP/tree/main/Lean

  10. Matos, A., Paolini, L., Roversi, L.: The fixed point problem of a simple reversible language. TCS 813, 143–154 (2020)

    Article  MathSciNet  Google Scholar 

  11. Matos, A.B.: Linear programs in a simple reversible language. Theor. Comput. Sci. 290(3), 2063–2074 (2003)

    Article  MathSciNet  Google Scholar 

  12. Matos, A.B., Paolini, L., Roversi, L.: On the expressivity of total reversible programming languages. In: Lanese, I., Rawski, M. (eds.) RC 2020. LNCS, vol. 12227, pp. 128–143. Springer, Cham (2020). https://doi.org/10.1007/978-3-030-52482-1_7

    Chapter  MATH  Google Scholar 

  13. K. Morita. Theory of Reversible Computing. Monographs in Theoretical Computer Science. An EATCS Series. Springer, Japan (2017). https://doi.org/10.1007/978-4-431-56606-9

  14. Moura, L., Ullrich, S.: The lean 4 theorem prover and programming language. In: Platzer, A., Sutcliffe, G. (eds.) CADE 2021. LNCS (LNAI), vol. 12699, pp. 625–635. Springer, Cham (2021). https://doi.org/10.1007/978-3-030-79876-5_37

    Chapter  Google Scholar 

  15. Paolini, L., Piccolo, M., Roversi, L.: A certified study of a reversible programming language. In: Uustalu, T. (ed.) TYPES 2015 postproceedings, volume 69 of LIPIcs. Schloss Dagstuhl - Leibniz-Zentrum fuer Informatik, Germany (2017)

    Google Scholar 

  16. Paolini, L., Piccolo, M., Roversi, L.: On a class of reversible primitive recursive functions and its turing-complete extensions. New Gen. Comput. 36(3), 233–256 (2018)

    Article  Google Scholar 

  17. Paolini, L., Piccolo, M., Roversi, L.: A class of recursive permutations which is primitive recursive complete. Theor. Comput. Sci. 813, 218–233 (2020)

    Article  MathSciNet  Google Scholar 

  18. Perumalla, K.S.: Introduction to Reversible Computing. Chapman & Hall/CRC Computational Science. Taylor & Francis, New York (2013)

    Google Scholar 

  19. Rogers, H.: Theory of Recursive Functions and Effective Computability. McGraw-Hill Series in Higher Mathematics. McGraw-Hill, New York (1967)

    Google Scholar 

  20. Szudzik, M.P.: The Rosenberg-Strong Pairing Function. CoRR, abs/1706.04129, 2017

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Luca Roversi .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2022 The Author(s), under exclusive license to Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Maletto, G., Roversi, L. (2022). Certifying Algorithms and Relevant Properties of Reversible Primitive Permutations with Lean. In: Mezzina, C.A., Podlaski, K. (eds) Reversible Computation. RC 2022. Lecture Notes in Computer Science, vol 13354. Springer, Cham. https://doi.org/10.1007/978-3-031-09005-9_8

Download citation

  • DOI: https://doi.org/10.1007/978-3-031-09005-9_8

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-031-09004-2

  • Online ISBN: 978-3-031-09005-9

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics