“…Grammar-based compression is a loss-less data compression scheme that represents a string w by an SLP for w. We are aware of more powerful compression schemes such as run-length SLPs [23,35,5], composition systems [18], collage systems [25], NU-systems [34], the Lempel-Ziv 77 family [40,37,11,12], and bidirectional schemes [37]. Nevertheless, since SLPs exhibit simpler structures than those, a number of efficient algorithms that can work directly on SLPs have been proposed, including pattern matching [24,23], convolutions [38], random access [7], detection of repeats and palindromes [21], Lyndon factorizations [22], longest common extension queries [20], longest common substrings [33], finger searches [4], and balancing the grammar [16]. More examples of algorithms directly working on SLPs can be found in references therein and the survey [30].…”