Data Compression/grammar-based compression

grammar-based compression
Grammar-based compression was proposed in 2000.

Several data compression methods can be viewed as grammar-based compression:
 * The Sequitur data compression algorithm uses a context-free grammar to represent a string such as a data file. It is relatively fast (linear-time encoding and linear-time decoding).
 * Longest Match
 * Most frequent digram
 * The Sequential data compression algorithm is an improvement on Sequitur.
 * Although it pre-dates grammar-based compression, LZ78 and LZW (but not LZ77) can be interpreted as a kind of grammar.
 * It has been shown that "a structured grammar" gives better compression than "an irreducible grammar".

When the output of the grammar transform is compressed with a zero-order entropy coder (such as a zero-order arithmetic coder), grammar compression outperforms the Unix Compress and Gzip algorithms.

The Re-Pair algorithm is a grammar based compression algorithm. Its decoder operates as follows:

FIXME: fill in details.