Hereditarily finite representations of natural numbers and self-delimiting codes

  • Authors:
  • Paul Tarau

  • Affiliations:
  • University of North Texas, Denton, TX, USA

  • Venue:
  • Proceedings of the third ACM SIGPLAN workshop on Mathematically structured functional programming
  • Year:
  • 2010

Quantified Score

Hi-index 0.00

Visualization

Abstract

Using a bijection between natural numbers and hereditarily finite functions we derive a new reversible variable length self-delimiting code through a bitstring representation in a balanced parenthesis language. The code features the ability to encode arbitrarily nested data types, can represent huge (low "complexity") numbers, and is decodable from its beginning or its end. Besides its possible practical applications to media stream encodings, a comparison with the well-known Elias omega code and a conjecture about its asymptotic behavior under the Kraft inequality suggest it as an interesting object of study for experimental mathematicians. The paper is organized as a self-contained literate Haskell program inviting the reader to explore its content independently. Its code is available at http://logic.cse.unt.edu/tarau/research/2010/selfdelim.hs