English

Constant-Time Dynamic Enumeration of Word Infixes in a Regular Language

Formal Languages and Automata Theory 2026-02-17 v1 Data Structures and Algorithms

Abstract

For a fixed regular language LL, the enumeration of LL-infixes is the following task: we are given an input word w=a1anw = a_1 \cdots a_n and we must enumerate the infixes of ww that belong to LL, i.e., the pairs iji \leq j such that aiajLa_i \cdots a_j \in L. We are interested in dynamic enumeration of LL-infixes, where we must additionally support letter substitution updates on ww (e.g., "replace the ii-th letter of ww by a letter aa"). Each update changes the set of infixes to enumerate, and resets the enumeration state. We study for which regular languages LL we can perform dynamic enumeration of LL-infixes in constant delay (i.e., the next infix is always produced in constant time) and constant additional memory throughout the enumeration, while supporting each update in constant time. We show that, for languages LL with a neutral letter, if the language LL belongs to the class ZG and is extensible (i.e., if uLu \in L and uu is a factor of vv then vLv \in L), then dynamic enumeration of LL-infixes can be achieved with a simple algorithm that ensures constant-time updates and constant delay, but not constant additional memory. Our main contribution is then to show an algorithm that additionally uses only constant additional memory, and applies to a more general class of semi-extensible ZG languages for which we give several equivalent characterizations. We further discuss whether our results can be generalized to larger language classes and show some (conditional) lower bounds.

Keywords

Cite

@article{arxiv.2602.14748,
  title  = {Constant-Time Dynamic Enumeration of Word Infixes in a Regular Language},
  author = {Antoine Amarilli and Sven Dziadek and Luc Segoufin},
  journal= {arXiv preprint arXiv:2602.14748},
  year   = {2026}
}

Comments

34 pages, 1 figure. Submitted