Skip to main content

Compiling Janus to RSSA

  • Conference paper
  • First Online:

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 12805))

Abstract

Reversible programming languages have been a focus of research for more than the last decade mostly due to the work of Glück, Yokoyama, Mogensen, and many others. In this paper, we report about our recent activities to compile code written in the reversible language Janus to reversible static-single-assignment form RSSA and to three-address-code, both of which can thereafter be compiled to C. In particular, this is – to our knowledge – the first compiler from Janus to RSSA. In addition, we have implemented a novel technique for a reversible compiler by executing the code generator itself in reverse. Our compiler provides the basis for optimizations and further analysis of reversible programs.

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

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

References

  1. Aho, A.V., Sethi, R., Ullman, J.D.: Compilers: Principles, Techniques, and Tools. Addison-Wesley, Reading (1986)

    Google Scholar 

  2. Alpern, B., Wegman, M.N., Zadeck, F.K.: Detecting equality of variables in programs. In: Ferrante, J., Mager, P. (eds.) Principles of Programming Languages (POPL 1988), pp. 1–11. ACM Press (1988). https://doi.org/10.1145/73560.73561

  3. Appel, A.W.: Modern Compiler Implementation in Java. Cambridge University Press, Cambridge (1998)

    MATH  Google Scholar 

  4. Axelsen, H.B.: Clean translation of an imperative reversible programming language. In: Knoop, J. (ed.) CC 2011. LNCS, vol. 6601, pp. 144–163. Springer, Heidelberg (2011). https://doi.org/10.1007/978-3-642-19861-8_9

    Chapter  Google Scholar 

  5. Frank, M.P.: The future of computing depends on making it reversible. IEEE Spectrum, September 2017

    Google Scholar 

  6. Gamma, E., Helm, R., Johnson, R., Vlissides, J.: Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley, Boston (1995)

    MATH  Google Scholar 

  7. Hudson, S., Flannery, F., Scott Ananian, C., Petter, M.: CUP User’s Manual. Technische Universität München, v0.11b edn. (2014) http://www2.in.tum.de/projects/cup/docs.php

  8. Kildall, G.A.: A unified approach to global program optimization. In: Fischer, P.C., Ullman, J.D. (eds.) Principles of Programming Languages (POPL 1973), pp. 194–206. ACM Press (1973)

    Google Scholar 

  9. Klein, G., Rowe, S., Décamps, R.: JFlex User’s Manual, version 1.8.2 edn. (2020). https://www.jflex.de/manual.html

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

    Article  MathSciNet  Google Scholar 

  11. Lutz, C.: Janus - A Time-Reversible Language (1986), http://tetsuo.jp/ref/janus.pdf, Letter to R. Landauer

  12. Mogensen, T.Æ.: Partial evaluation of the reversible language Janus. In: Khoo, S., Siek, J.G. (eds.) SIGPLAN Workshop on Partial Evaluation and Program Manipulation (PEPM 2011), pp. 23–32. ACM Press (2011). https://doi.org/10.1145/1929501.1929506

  13. Mogensen, T.Æ.: RSSA: a reversible SSA form. In: Mazzara, M., Voronkov, A. (eds.) PSI 2015. LNCS, vol. 9609, pp. 203–217. Springer, Cham (2016). https://doi.org/10.1007/978-3-319-41579-6_16

    Chapter  Google Scholar 

  14. Muchnick, S.S.: Advanced Compiler Design and Implementation. Morgan Kaufmann (1997)

    Google Scholar 

  15. Nielsen, C.S., Budde, M., Thomsen, M.K.: Program Inversion and Reversible Computation - Janus Extended Playground http://topps.diku.dk/pirc/?id=janusP

  16. Rosen, B.K., Wegman, M.N., Zadeck, F.K.: Global value numbers and redundant computations. In: Ferrante, J., Mager, P. (eds.) Principles of Programming Languages (POPL 1988), pp. 12–27. ACM Press (1988). https://doi.org/10.1145/73560.73562

  17. Yokoyama, T., Axelsen, H.B., Glück, R.: Principles of a reversible programming language. In: Ramírez, A., Bilardi, G., Gschwind, M. (eds.) Computing Frontiers, pp. 43–54. ACM Press (2008). https://doi.org/10.1145/1366230.1366239

  18. Yokoyama, T., Glück, R.: A reversible programming language and its invertible self-interpreter. In: Ramalingam, G., Visser, E. (eds.) SIGPLAN Workshop on Partial Evaluation and Semantics-based Program Manipulation (PEPM 2007), pp. 144–153. ACM Press (2007). https://doi.org/10.1145/1244381.1244404

  19. Yokoyama, T., Axelsen, H.B., Glück, R.: Fundamentals of reversible flowchart languages. Theoret. Comput. Sci. 611, 87–115 (2016). https://doi.org/10.1016/j.tcs.2015.07.046

    Article  MathSciNet  MATH  Google Scholar 

Download references

Acknowledgements

We would like to thank the reviewers who had provided valuable feedback and suggestions for improvement.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Uwe Meyer .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2021 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Kutrib, M., Meyer, U., Deworetzki, N., Schuster, M. (2021). Compiling Janus to RSSA. In: Yamashita, S., Yokoyama, T. (eds) Reversible Computation. RC 2021. Lecture Notes in Computer Science(), vol 12805. Springer, Cham. https://doi.org/10.1007/978-3-030-79837-6_4

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-79837-6_4

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-79836-9

  • Online ISBN: 978-3-030-79837-6

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics