Abstract
Zip and unzip are everyday tools in today’s digital world. Since they are inherently inverse to each other, they are ideal for studying reversible computing methods on real-world problems.
In this work-in-progress study, we take steps to develop a reversible zip tool. As a proof of concept, we designed clean (garbage-free) reversible versions of two algorithms, which are officially recognized by the zip-specification. Our design goal was not merely to achieve reversibility, but rather to maintain the asymptotic complexity of the irreversible counterparts.
Because of their efficiency and different approaches to compression, we chose the dictionary-based Lempel–Ziv–Welch Compression (LZW) and the transformation-based Burrows–Wheeler Transform (BWT). As part of the challenge, we found a way to zero-clear the LZW dictionary and reversibly sort rotations for BWT. We have successfully created clean reversible versions of both algorithms and fully implemented and tested them in the reversible language Janus.
Our reversible LZW has a worst-case runtime of \(\mathrm {\Theta }(n)\), just like the most efficient irreversible version. Our reversible BWT is, in the worst case, a factor \(n^2\) slower than the most efficient irreversible version. There are currently no better trace-free reversible methods for lossless compression.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
References
Axelsen, H.B., Yokoyama, T.: Programming techniques for reversible comparison sorts. In: Feng, X., Park, S. (eds.) APLAS 2015. LNCS, vol. 9458, pp. 407–426. Springer, Cham (2015). https://doi.org/10.1007/978-3-319-26529-2_22
Bennett, C.H.: Time/space trade-offs for reversible computation. SIAM J. Comput. 18(4), 766–776 (1989). https://doi.org/10.1137/0218053
Bird, R.S., Mu, S.C.: Inverting the Burrows-Wheeler transform. J. Funct. Program. 14(6), 603–612 (2004). https://doi.org/10.1017/S0956796804005118
Burrows, M., Wheeler, D.J.: A block-sorting lossless data compression algorithm. SRC Research Report 124, DEC Systems Research Center, Palo Alto, CA (1994)
De Vos, A., et al.: Designing garbage-free reversible implementations of the integer cosine transform. J. Emerg. Technol. Comput. Syst. 11(2), 11:1–11:15 (2014). https://doi.org/10.1145/2629532
Glück, R., Yokoyama, T.: Reversible programming: a case study of two string-matching algorithms. In: Hamilton, G., et al. (eds.) Proceedings of the HCVS/VPT. EPTCS, vol. 373, pp. 1–13 (2022). https://doi.org/10.4204/EPTCS.373.1
Glück, R., Yokoyama, T.: Reversible computing from a programming language perspective. Theor. Comput. Sci. 953, Article no. 113429 (2023). https://doi.org/10.1016/j.tcs.2022.06.010
Lange, K.J., McKenzie, P., Tapp, A.: Reversible space equals deterministic space. J. Comput. Syst. Sci. 60(2), 354–367 (2000). https://doi.org/10.1006/jcss.1999.1672
Perumalla, K.S.: Introduction to Reversible Computing. CRC Press, Boca Raton (2013)
Schordan, M., et al.: Generation of reversible C++ code for optimistic parallel discrete event simulation. New Gener. Comput. 36(3), 257–280 (2018). https://doi.org/10.1007/s00354-018-0038-2
Welch, T.A.: A technique for high-performance data compression. IEEE Comput. 17(6), 8–19 (1984). https://doi.org/10.1109/MC.1984.1659158
Witten, I.H., Moffat, A., Bell, T.C.: Managing Gigabytes: Compressing and Indexing Documents and Images, 2nd edn. Morgan Kaufmann, Burlington (1999)
Yokoyama, T., Axelsen, H.B., Glück, R.: Principles of a reversible programming language. In: Proceedings of the Conference on Computing Frontiers, pp. 43–54. ACM (2008). https://doi.org/10.1145/1366230.1366239
Yokoyama, T., Axelsen, H.B., Glück, R.: Optimizing reversible simulation of injective functions. J. Mult.-Valued Logic Soft Comput. 18(1), 5–24 (2012)
Ziv, J., Lempel, A.: A universal algorithm for sequential data compression. IEEE Trans. Inf. Theor. 23(3), 337–343 (1977). https://doi.org/10.1109/TIT.1977.1055714
Acknowledgement
The last author was supported by JSPS KAKENHI Grant No. 22K11983 and Nanzan University Pache Research Subsidy I-A-2 for 2023.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2024 The Author(s), under exclusive license to Springer Nature Switzerland AG
About this paper
Cite this paper
Lyngby, T., Nylandsted, R.R., Glück, R., Yokoyama, T. (2024). Towards Clean Reversible Lossless Compression. In: Mogensen, T.Æ., Mikulski, Ł. (eds) Reversible Computation. RC 2024. Lecture Notes in Computer Science, vol 14680. Springer, Cham. https://doi.org/10.1007/978-3-031-62076-8_7
Download citation
DOI: https://doi.org/10.1007/978-3-031-62076-8_7
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-031-62075-1
Online ISBN: 978-3-031-62076-8
eBook Packages: Computer ScienceComputer Science (R0)