Verified Reversible Programming for Verified Lossless Compression

James Townsend, Jan-Willem van de Meent
11/2/2022
cs.PLcs.AIcs.IT

Official code: j-towns/flipper (13 stars, Agda, MIT, last commit 2023-06-22).

Abstract

Lossless compression implementations typically contain two programs, an encoder and a decoder, which are required to be inverse to one another. We observe that a significant class of compression methods, based on asymmetric numeral systems (ANS), have shared structure between the encoder and decoder -- the decoder program is the 'reverse' of the encoder program -- allowing both to be simultaneously specified by a single, reversible function.

Show full abstract

To exploit this, we have implemented a small reversible language, embedded in Agda, which we call 'Flipper' (available at https://github.com/j-towns/flipper). Agda supports formal verification of program properties, and the compiler for our reversible language (which is implemented as an Agda macro), produces not just an encoder/decoder pair of functions but also a proof that they are inverse to one another. Thus users of the language get formal verification 'for free'. We give a small example use-case of Flipper in this paper, and plan to publish a full compression implementation soon.

View on arXivView PDF

Code Implementations(1)

j-towns/flipperOfficial100%
MIT

Reversible programming in Agda

130AgdaMay 11, 20223 years agoMIT

Similar Papers

Cite this paper

@article{townsend2022verified,
  title  = {Verified Reversible Programming for Verified Lossless Compression},
  author = {James Townsend and Jan-Willem van de Meent},
  year   = {2022},
  eprint = {2211.09676},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2211.09676}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2211.09676.svg)](https://codeofpaper.com/paper/2211.09676)

Discussion