Generalized Straight-Line Programs
Preprint
Abstract
It was recently proved that any Straight-Line Program (SLP) generating a given string can be transformed in linear time into an equivalent balanced SLP of the same asymptotic size. We generalize this proof to a general class of grammars we call Generalized SLPs (GSLPs), which allow rules of the form $A \rightarrow x$ where $x$ is any Turing-complete representation (of size $|x|$) of a sequence of symbols (potentially much longer than $|x|$). We then specialize GSLPs to so-called Iterated SLPs (ISLPs), which allow rules of the form $A \rightarrow Π_{i=k_1}^{k_2} B_1^{i^{c_1}}\cdots B_t^{i^{c_t}}$ of size $2t+2$. We prove that ISLPs break, for some text families, the measure $δ$ based on substring complexity, a lower bound for most measures and compressors exploiting repetitiveness. Further, ISLPs can extract any substring of length $λ$, from the represented text $T[1.. n]$, in time $O(λ+ \log^2 n\log\log n)$. This is the first compressed representation for repetitive texts breaking $δ$ while, at the same time, supporting direct access to arbitrary text symbols in polylogarithmic time. We also show how to compute some substring queries, like range minima and next/previous smaller value, in time $O(\log^2 n \log\log n)$. Finally, we further specialize the grammars to Run-Length SLPs (RLSLPs), which restrict the rules allowed by ISLPs to the form $A \rightarrow B^t$. Apart from inheriting all the previous results with the term $\log^2 n \log\log n$ reduced to the near-optimal $\log n$, we show that RLSLPs can exploit balance to efficiently compute a wide class of substring queries we call ``composable'' -- i.e., $f(X \cdot Y)$ can be obtained from $f(X)$ and $f(Y)$...
Keywords
All Related Versions
This publication has 19 references indexed in Scilit:
- Sensitivity of string compressors and repetitiveness measuresInformation and Computation, 2022
- Grammar-compressed indexes with logarithmic search timeJournal of Computer and System Sciences, 2021
- A separation between RLSLPs and LZ77Journal of Discrete Algorithms, 2018
- Fingerprints in compressed stringsJournal of Computer and System Sciences, 2017
- On compressing and indexing repetitive sequencesTheoretical Computer Science, 2013
- Faster entropy-bounded compressed suffix treesTheoretical Computer Science, 2009
- Burrows–Wheeler transform and Sturmian wordsInformation Processing Letters, 2003
- On cube-free ω-words generated by binary morphismsDiscrete Applied Mathematics, 1983
- Mathematical models for cellular interactions in development II. Simple and branching filaments with two-sided inputsJournal of Theoretical Biology, 1968
- Mathematical models for cellular interactions in development I. Filaments with one-sided inputsJournal of Theoretical Biology, 1968