Generalized Straight-Line Programs
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 where is any Turing-complete representation (of size ) of a sequence of symbols (potentially much longer than ). We then specialize GSLPs to so-called Iterated SLPs (ISLPs), which allow rules of the form of size . 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 , in time . 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 . Finally, we further specialize the grammars to Run-Length SLPs (RLSLPs), which restrict the rules allowed by ISLPs to the form . Apart from inheriting all the previous results with the term reduced to the near-optimal , we show that RLSLPs can exploit balance to efficiently compute a wide class of substring queries we call ``composable'' -- i.e., can be obtained from and ...
Cite
@article{arxiv.2404.07057,
title = {Generalized Straight-Line Programs},
author = {Gonzalo Navarro and Francisco Olivares and Cristian Urbina},
journal= {arXiv preprint arXiv:2404.07057},
year = {2024}
}
Comments
This work is an extended version of articles published in SPIRE 2022 and LATIN 2024, which are now integrated into a coherent framework where specialized results are derived from more general ones, new operations are supported, and proofs are complete. arXiv admin note: substantial text overlap with arXiv:2402.09232