Jump to content

Grammar-based code: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Yobot (talk | contribs)
m clean up, References after punctuation per WP:REFPUNC and WP:CITEFOOT using AWB (8792)
Line 1: Line 1:
'''Grammar-based codes''' or '''Grammar-based compression''' are [[Data compression|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
'''Grammar-based codes''' or '''Grammar-based compression''' are [[Data compression|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
<ref>{{Citation | last = Kieffer | first = J. C. | last2 = Yang | first2 = E.-H. | title = Grammar-based codes: A new class of universal lossless source codes | journal = IEEE Trans. Inform. Theory | volume = 46 | pages = 737–754 | year = 2000 | doi = 10.1109/18.841160 | issue = 3 }}</ref> and [[SEQUITUR algorithm|SEQUITUR]], among others. To compress a data sequence <math>x = x_1 \cdots x_n</math>, a grammar-based code transforms <math>x</math> into a context-free CFG <math>G</math>.
<ref>{{Citation | last = Kieffer | first = J. C. | last2 = Yang | first2 = E.-H. | title = Grammar-based codes: A new class of universal lossless source codes | journal = IEEE Trans. Inform. Theory | volume = 46 | pages = 737–754 | year = 2000 | doi = 10.1109/18.841160 | issue = 3 }}</ref> and [[SEQUITUR algorithm|SEQUITUR]], among others. To compress a data sequence <math>x = x_1 \cdots x_n</math>, a grammar-based code transforms <math>x</math> into a context-free CFG <math>G</math>.
The problem to find a smallest grammar for an input sequence is known to be NP-hard<ref>{{Citation | last = Charikar | first = M. | last2 = Lehman | first2 = E. | last3 = Liu | first3 = D. | last4 = Panigrapy | first4 = R. | last5 = Prabharakan | first5 = M. | last6 = Sahai | first6 = A. | last7 = Shelat | first7 = A. | title = The Smallest Grammar Problem | journal = IEEE Trans. Inform. Theory | volume = 51 | pages = 2554–2576 | year = 2005 | issue = 7 }}</ref>, so many grammar-transform algorithms are proposed from theoretical and practical viewpoints.
The problem to find a smallest grammar for an input sequence is known to be NP-hard,<ref>{{Citation | last = Charikar | first = M. | last2 = Lehman | first2 = E. | last3 = Liu | first3 = D. | last4 = Panigrapy | first4 = R. | last5 = Prabharakan | first5 = M. | last6 = Sahai | first6 = A. | last7 = Shelat | first7 = A. | title = The Smallest Grammar Problem | journal = IEEE Trans. Inform. Theory | volume = 51 | pages = 2554–2576 | year = 2005 | issue = 7 }}</ref> so many grammar-transform algorithms are proposed from theoretical and practical viewpoints.
Generally, the produced grammar <math>G</math> is further compressed by statistical encoders like [[arithmetic coding]].
Generally, the produced grammar <math>G</math> is further compressed by statistical encoders like [[arithmetic coding]].


== Examples and characteristics ==
== Examples and characteristics ==

Revision as of 09:08, 11 December 2012

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 [1] and SEQUITUR, among others. To compress a data sequence , a grammar-based code transforms into a context-free CFG . The problem to find a smallest grammar for an input sequence is known to be NP-hard,[2] so many grammar-transform algorithms are proposed from theoretical and practical viewpoints. Generally, the produced grammar 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, variations of the incremental parsing Lempel-Ziv code,[3] the multilevel pattern matching (MPM) algorithm,[4] 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 following are available from external links.

  • Sequitur[5] is a classical grammar compression algorithm that sequentially translates an input text into a CFG, and then the produced CFG is encoded by an arithmetic coder.
  • Re-Pair[6] is a greedy algorithm by the strategy of most-frequent-first substitution. The compressive performance is powerful, although the main memory space is very large.

References

  1. ^ Kieffer, J. C.; Yang, E.-H. (2000), "Grammar-based codes: A new class of universal lossless source codes", IEEE Trans. Inform. Theory, 46 (3): 737–754, doi:10.1109/18.841160
  2. ^ Charikar, M.; Lehman, E.; Liu, D.; Panigrapy, R.; Prabharakan, M.; Sahai, A.; Shelat, A. (2005), "The Smallest Grammar Problem", IEEE Trans. Inform. Theory, 51 (7): 2554–2576
  3. ^ Kieffer, J. C.; Yang, E.-H.; Nelson, G.; Cosman, P. (2000), "Universal lossless compression via multilevel pattern matching", IEEE Trans. Inform. Theory, 46 (4): 1227–1245, doi:10.1109/18.850665
  4. ^ Ziv, J.; Lempel, A. (1978), "Compression of individual sequences via variable rate coding", IEEE Trans. Inform. Theory, 24 (5): 530–536, doi:10.1109/TIT.1978.1055934
  5. ^ Nevill-Manning, C. G.; Witten, I. H. (1997), "Identifying Hierarchical Structure in Sequences: A linear-time algorithm", Journal of Artificial Intelligence Research, 7 (4): 67–82, hdl:10289/1186
  6. ^ Larsson, N. J.; Moffat, A. (2000), "Offline Dictionary-Based Compression", IEEE, 88 (11): 1722–1732