A Straight-Line Program (SLP) $G$ for a string $T$ is a context-free grammar (CFG) that derives $T$ only, which can be considered as a compressed representation of $T$. In this paper, we show how to encode $G$ in $n \lceil \lg N \rceil + (n + n') \lceil \lg (n+\sigma) \rceil + 4n - 2n' + o(n)$ bits to support random access queries of extracting $T[p..q]$ in worst-case $O(\log N + p - q)$ time, where $N$ is the length of $T$, $\sigma$ is the alphabet size, $n$ is the number of variables in $G$ and $n' \le n$ is the number of symmetric centroid paths in the DAG representation for $G$.
翻译:字符串$T$的直线式程序(SLP)$G$是一个仅推导出$T$的上下文无关文法(CFG),可视为$T$的一种压缩表示。本文提出一种对$G$进行编码的方法,其空间占用为$n \lceil \lg N \rceil + (n + n') \lceil \lg (n+\sigma) \rceil + 4n - 2n' + o(n)$比特,并支持在最坏情况$O(\log N + p - q)$时间内完成提取子串$T[p..q]$的随机访问查询,其中$N$为$T$的长度,$\sigma$为字母表大小,$n$为$G$中变量的数量,$n' \le n$为$G$的有向无环图表示中对称质心路径的数量。