Towards Clean Reversible Lossless Compression

A Reversible Programming Experiment with Zip

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

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.

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

Access this chapter

Subscribe and save

Springer+ Basic
EUR 32.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

eBook
EUR 85.59
Price includes VAT (Germany)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
EUR 62.05
Price includes VAT (Germany)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free ship** worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    https://tetsuo.jp/ref/RC2024/.

References

  1. 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

    Chapter  Google Scholar 

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

    Article  MathSciNet  Google Scholar 

  3. 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

    Article  Google Scholar 

  4. Burrows, M., Wheeler, D.J.: A block-sorting lossless data compression algorithm. SRC Research Report 124, DEC Systems Research Center, Palo Alto, CA (1994)

    Google Scholar 

  5. 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

  6. 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

  7. 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

  8. 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

    Article  MathSciNet  Google Scholar 

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

    Google Scholar 

  10. 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

    Article  Google Scholar 

  11. 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

    Article  Google Scholar 

  12. Witten, I.H., Moffat, A., Bell, T.C.: Managing Gigabytes: Compressing and Indexing Documents and Images, 2nd edn. Morgan Kaufmann, Burlington (1999)

    Google Scholar 

  13. 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

  14. 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)

    Google Scholar 

  15. 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

    Article  MathSciNet  Google Scholar 

Download references

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

Authors

Corresponding author

Correspondence to Therese Lyngby .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2024 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

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)

Publish with us

Policies and ethics

Navigation