English

MSO-Enumeration Over SLP-Compressed Unranked Forests

Formal Languages and Automata Theory 2026-03-17 v5 Databases

Abstract

We study the problem of enumerating the answers to a query formulated in monadic second order logic (MSO) over an unranked forest F that is compressed by a straight-line program (SLP) D. Our main result states that this can be done after O(|D|) preprocessing and with output-linear delay (in data complexity). This is a substantial improvement over the previously known algorithms for MSO-evaluation over trees, since the compressed size |D| might be much smaller than (or even logarithmic in) the actual data size |F|, and there are linear time SLP-compressors that yield very good compressions on practical inputs. In particular, this also constitutes a meta-theorem in the field of algorithmics on SLP-compressed inputs: all enumeration problems on trees or strings that can be formulated in MSO-logic can be solved with linear preprocessing and output-linear delay, even if the inputs are compressed by SLPs. We also show that our approach can support vertex relabelling updates in time that is logarithmic in the uncompressed data. Our result extends previous work on the enumeration of MSO-queries over uncompressed trees and on the enumeration of document spanners over compressed text documents.

Keywords

Cite

@article{arxiv.2403.03067,
  title  = {MSO-Enumeration Over SLP-Compressed Unranked Forests},
  author = {Markus Lohrey and Markus L. Schmid},
  journal= {arXiv preprint arXiv:2403.03067},
  year   = {2026}
}

Comments

64 pages. This is the TheoretiCS journal version

R2 v1 2026-06-28T15:09:57.059Z