Skip to main content
Log in

Making Programs Reversible with Minimal Extra Data

  • Published:
New Generation Computing Aims and scope Submit manuscript

Abstract

Reversible computing is an unconventional computing paradigm that comes with specific challenges. One of the important questions is the existence of reversible programs with minimal extra output (garbage data). To answer this question for programs that implement partial functions over countable domains, we introduce an order on infinite garbage sets and a notion of minimality. To this end, we present two methods for functions specified by decidable and semi-decidable predicates. Both methods are universal, which means they work for all programs specified by the predicates. They cover Bennett’s classic input-erasing reversible computation of injective functions. Hence, any program written in a Turing-complete programming language can be implemented with g-minimal garbage in an r-Turing-complete reversible programming language. This generality comes at the cost of a considerable runtime due to the generate-and-test approach.

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

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1

Similar content being viewed by others

Notes

  1. The number of garbage lines is minimized to \(\lceil \log _2 k\rceil \), where k is the largest number of identical output bit patterns in the truth table of the given reversible circuit.

  2. We abbreviate argument parentheses, e.g., we write \({ fst }(\texttt {x.y})\) instead of \({ fst }(\texttt {(x.y)})\) [14].

  3. We have \(|\texttt {nil}|=1\), and hence \(|\{\texttt {nil}\}| \ne |\{\}|\). The size differs from [14], where \(|\texttt {nil}|=0\).

  4. In general, \(\texttt {chk2}\) can be any program such that \(\texttt {(x.y)} \in \mathrm {dom}([\![\texttt {chk2}]\!]^\texttt {L}) \Leftrightarrow (\texttt {x},\texttt {y})\in S\).

References

  1. Abramov, S.M., Glück, R.: The universal resolving algorithm and its correctness: inverse computation in a functional language. Sci. Comput. Program. 43(2–3), 193–229 (2002)

    Article  MathSciNet  Google Scholar 

  2. Axelsen, H.B., Yokoyama, T.: Programming techniques for reversible comparison sorts. In: Feng, X., Park, S. (eds.) Programming Languages and Systems. Proceedings, vol. 9458. Lecture Notes in Computer Science, pp. 407–426. Springer, Berlin (2015)

  3. Bennett, C.H.: Logical reversibility of computation. IBM J. Res. Dev. 17(6), 525–532 (1973)

    Article  MathSciNet  Google Scholar 

  4. Bennett, C.H.: Time/space trade-offs for reversible computation. SIAM J. Comput. 18(4), 766–776 (1989)

    Article  MathSciNet  Google Scholar 

  5. De Vos, A.: Endoreversible models for the thermodynamics of computing. Entropy 22(6), 660 (2020)

    Article  MathSciNet  Google Scholar 

  6. Dijkstra, E.W.: Program inversion. In: Bauer, F.L., Broy, M. (eds.) Program Construction: International Summer School, vol. 69. Lecture Notes in Computer Science, pp. 54–57. Springer, Berlin (1979)

  7. Feynman, R.P.: Feynman Lectures on Computation. Addison-Wesley, Boston (1996)

    Google Scholar 

  8. Frank, M.P.: Reversibility for efficient computing. PhD thesis, Massachusetts Institute of Technology (1999)

  9. Futamura, Y., Konishi, Z., Glück, R.: Program transformation system based on generalized partial computation. New Gener. Comput. 20(1), 75–99 (2002)

    Article  Google Scholar 

  10. Glück, R., Kawada, Y., Hashimoto, T.: Transforming interpreters into inverse interpreters by partial evaluation. In: Partial Evaluation and Semantics-Based Program Manipulation. Proceedings, pp. 10–19. ACM Press, New York (2003)

    Google Scholar 

  11. Glück, R., Yokoyama, T.: A linear-time self-interpreter of a reversible imperative language. Comput. Softw. 33(3), 108–128 (2016)

    Google Scholar 

  12. Glück, R., Yokoyama, T.: Reversible computing from a programming language perspective. Theor. Comput. Sci. (2022, in preparation)

  13. Hagiya, M., et al.: On DNA-based gellular automata. In: Ibarra, O.H., Kari, L., Kopecki, S. (eds.) Unconventional Computation and Natural Computation. Proceedings, vol. 8553. Lecture Notes in Computer Science, pp. 177–189. Springer, Berlin (2014)

  14. Jones, N.D.: Computability and Complexity: From a Programming Perspective. MIT Press, Cambridge (1997). Revised version, available from http://www.diku.dk/~neil/Comp2book.html

  15. Kawabe, M., Glück, R.: The program inverter LRinv and its structure. In: Hermenegildo, M., Cabeza, D. (eds.) Practical Aspects of Declarative Languages. Proceedings, vol. 3350. Lecture Notes in Computer Science, pp. 219–234. Springer, Berlin (2005)

  16. Krakovsky, M.: Taking the heat. Commun. ACM 64(6), 18–20 (2021)

    Article  Google Scholar 

  17. Landauer, R.: Irreversibility and heat generation in the computing process. IBM J. Res. Dev. 5(3), 183–191 (1961)

    Article  MathSciNet  Google Scholar 

  18. Lange, K.-J., McKenzie, P., Tapp, A.: Reversible space equals deterministic space. J. Comput. Syst. Sci. 60(2), 354–367 (2000)

    Article  MathSciNet  Google Scholar 

  19. Levin, L.A.: Universal sequential search problems. Probl. Inf. Transm. 9(3), 265–266 (1975). Translated from Probl. Peredachi Inf. 9(3), 115–116 (1973)

  20. Maslov, D., Dueck, G.W.: Reversible cascades with minimal garbage. IEEE Trans. Comput. Aided Des. Integr. Circuits Syst. 23(11), 1497–1509 (2006)

  21. McCarthy, J.: The inversion of functions defined by Turing machines. In: Shannon, C.E., McCarthy, J. (eds.) Automata Studies, pp. 177–181. Princeton University Press, Princeton (1956)

    Google Scholar 

  22. Morita, K.: Theory of Reversible Computing. Monographs in Theoretical Computer Science. Springer, Berlin (2017)

    Book  Google Scholar 

  23. Perumalla, K.S.: Introduction to Reversible Computing. CRC Press, Boca Raton (2013)

    Book  Google Scholar 

  24. Toffoli, T.: Reversible computing. In: de Bakker, J., van Leeuwen, J. (eds.) Automata, Languages and Programming. Proceedings, vol. 85. Lecture Notes in Computer Science, pp. 632–644. Springer, Berlin (1980)

  25. Yokoyama, T., Axelsen, H.B., Glück, R.: Fundamentals of reversible flowchart languages. Theor. Comput. Sci. 611, 87–115 (2016)

    Article  MathSciNet  Google Scholar 

  26. Yokoyama, T., Glück, R.: A reversible programming language and its invertible self-interpreter. In: Partial Evaluation and Semantics-Based Program Manipulation. Proceedings, pp. 144–153. ACM Press, New York (2007)

    Google Scholar 

Download references

Acknowledgements

We thank Professor Masami Hagiya for his continuous encouragement and warm, friendly support for many years. We also thank the anonymous reviewers for their useful feedback. The second author was supported by JSPS KAKENHI Grant no. 18K11250 and Nanzan University Pache Research Subsidy I-A-2 for the 2022 academic year.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Robert Glück.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Glück, R., Yokoyama, T. Making Programs Reversible with Minimal Extra Data. New Gener. Comput. 40, 467–480 (2022). https://doi.org/10.1007/s00354-022-00169-z

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s00354-022-00169-z

Keywords

Mathematics Subject Classification

Navigation