## MFCS Talk

As I said in the previous post the talk is ready and online. I’ll use this space to tell a little bit about the result we achieved with Gonzalo Navarro for the paper “Self-Indexed Text Compression using Straight-Line Programs”.

The main problem we address is indexing straight-line programs, which are a special kind of free-context grammars that represent a language composed of one single text. This can be used as a compressed representation of a text, for example, LZ78 and Re-Pair map to an SLP without much effort. The bad new is that finding the minimum grammar that generates the text is NP-Complete, so approximations have to be used.

The formal definition is: A *Straight-Line Program (SLP)* is a grammar that defines a single finite sequence , drawn from an alphabet of terminals. It has rules, which must be of the following types:

- , where . It represents string .
- , where the
*phrase generated*by nonterminal , and .Given a pattern P and a text represented as an SLP, we focus on the following problems:

- Count the number of occurrences of P in the text generated by the SLP
- Locate the positions where the pattern occurs.

In the past this problem was approached from an online-searching point of view, our goal was to provide an index that supports searching in sublinear time on the size of the SLP. For the indexing approach we work on representing the SLP as a labeled binary relation. We consider a binary relation where and , and a labeling function , where is the set of labels and represents no label/relation between the pairs. We want to answer the following queries:

- Label of a given pair.
- Elements related to an element of B.
- Elements related to an element of A.
- Elements related trough a given label.
- Given to contiguous ranges in A and B respectively, find the pair that belong to the relation where is in the range for A and is in it's range too.

The first theorem we include shows that each of this queries can be answered paying close to time per element retrieved (element in the answer). Using that result we show how to modify an SLP so that the rules are sorted by lexicographical order and then represent this variant of the SLP in bits of space, and support queries as:

- Access to rules.
- Reverse access to rules (given two symbols, which rules generates them in a given order).
- Rules using a given left/right symbol.
- Rules using a contiguous range of symbols.

All the queries require time per datum delivered, as a direct consequence of our labeled binary relation representation. Finally, including some extra structures we get our final result (I'm not going to go into the details on how to use the SLP representation, or where the different trade-offs come from):

**Theorem:***Let be a text over an effective alphabet represented by an SLP of rules and height . Then there exists a representation of using bits, such that any substring can be extracted in time , and the positions of occurrences of a pattern in can be found in time . By removing the term in the space, search time raises to . By further removing the term in the space, search time raises to . The existence problem is solved within the time corresponding to .*There are some open problems we were stuck at the end of the paper included in the article and we are now working on a journal version with some interesting extensions.