Grammar-based code explained

Grammar-based codes or Grammar-based compression are compression algorithms based on the idea of constructing a context-free grammar (CFG) for the string to be compressed. Examples include universal lossless data compression algorithms. To compress a data sequence

x=x1xn

, a grammar-based code transforms

x

into a context-free grammar

G

.The problem of finding a smallest grammar for an input sequence (smallest grammar problem) is known to be NP-hard, so many grammar-transform algorithms are proposed from theoretical and practical viewpoints.Generally, the produced grammar

G

is further compressed by statistical encoders like arithmetic coding.

Examples and characteristics

The class of grammar-based codes is very broad. It includes block codes, the multilevel pattern matching (MPM) algorithm, variations of the incremental parsing Lempel-Ziv code, and many other new universal lossless compression algorithms.Grammar-based codes are universal in the sense that they can achieve asymptotically the entropy rate of any stationary, ergodic source with a finite alphabet.

Practical algorithms

The compression programs of the following are available from external links.

See also

External links

Notes and References

  1. Book: Conrad . Kennon J. . Wilson . Paul R. . 2016 Data Compression Conference (DCC) . Grammatical Ziv-Lempel Compression: Achieving PPM-Class Text Compression Ratios with LZ-Class Decompression Speed . 586 . 2016 . 10.1109/DCC.2016.119. 978-1-5090-1853-6 . 3116024 .