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
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsReferences
Aho, A.V., Sethi, R., Ullman, J.D.: Compilers: Principles, Techniques, and Tools. Addison-Wesley, Reading (1986)
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
Appel, A.W.: Modern Compiler Implementation in Java. Cambridge University Press, Cambridge (1998)
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
Frank, M.P.: The future of computing depends on making it reversible. IEEE Spectrum, September 2017
Gamma, E., Helm, R., Johnson, R., Vlissides, J.: Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley, Boston (1995)
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
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)
Klein, G., Rowe, S., Décamps, R.: JFlex User’s Manual, version 1.8.2 edn. (2020). https://www.jflex.de/manual.html
Landauer, R.: Irreversibility and heat generation in the computing process. IBM J. Res. Dev. 5(3), 183–191 (1961)
Lutz, C.: Janus - A Time-Reversible Language (1986), http://tetsuo.jp/ref/janus.pdf, Letter to R. Landauer
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
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
Muchnick, S.S.: Advanced Compiler Design and Implementation. Morgan Kaufmann (1997)
Nielsen, C.S., Budde, M., Thomsen, M.K.: Program Inversion and Reversible Computation - Janus Extended Playground http://topps.diku.dk/pirc/?id=janusP
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
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
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
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
Acknowledgements
We would like to thank the reviewers who had provided valuable feedback and suggestions for improvement.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2021 Springer Nature Switzerland AG
About this paper
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)