Skip to main content
QUICK REVIEW

[Paper Review] Enumerating Regular Languages with Bounded Delay

Antoine Amarilli, Mikaël Monet|arXiv (Cornell University)|Sep 29, 2022
semigroups and automata theoryComputer Science2 citations
TL;DR

This paper introduces a bounded-delay enumeration algorithm for regular languages using edit scripts that modify the previous word via push/pop operations at both ends, ensuring constant delay independent of word length. It characterizes which regular languages are orderable—specifically, those that are slender—and provides a PTIME algorithm to partition any regular language into the minimal number of orderable components, with optimal delay bounds for enumeration via ultimately periodic edit scripts.

ABSTRACT

We study the task, for a given language L, of enumerating the (generally infinite) sequence of its words, without repetitions, while bounding the delay between two consecutive words. To allow for delay bounds that do not depend on the current word length, we assume a model where we produce each word by editing the preceding word with a small edit script, rather than writing out the word from scratch. In particular, this witnesses that the language is orderable, i.e., we can write its words as an infinite sequence such that the Levenshtein edit distance between any two consecutive words is bounded by a value that depends only on the language. For instance, (a+b)^* is orderable (with a variant of the Gray code), but a^* + b^* is not. We characterize which regular languages are enumerable in this sense, and show that this can be decided in PTIME in an input deterministic finite automaton (DFA) for the language. In fact, we show that, given a DFA A, we can compute in PTIME automata A₁, …, A_t such that L(A) is partitioned as L(A₁) ⊔ … ⊔ L(A_t) and every L(A_i) is orderable in this sense. Further, we show that the value of t obtained is optimal, i.e., we cannot partition L(A) into less than t orderable languages. In the case where L(A) is orderable (i.e., t = 1), we show that the ordering can be produced by a bounded-delay algorithm: specifically, the algorithm runs in a suitable pointer machine model, and produces a sequence of bounded-length edit scripts to visit the words of L(A) without repetitions, with bounded delay - exponential in |A| - between each script. In fact, we show that we can achieve this while only allowing the edit operations push and pop at the beginning and end of the word, which implies that the word can in fact be maintained in a double-ended queue. By contrast, when fixing the distance bound d between consecutive words and the number of classes of the partition, it is NP-hard in the input DFA A to decide if L(A) is orderable in this sense, already for finite languages. Last, we study the model where push-pop edits are only allowed at the end of the word, corresponding to a case where the word is maintained on a stack. We show that these operations are strictly weaker and that the slender languages are precisely those that can be partitioned into finitely many languages that are orderable in this sense. For the slender languages, we can again characterize the minimal number of languages in the partition, and achieve bounded-delay enumeration.

Motivation & Objective

  • To address the challenge of efficiently enumerating infinite regular languages with bounded delay, independent of word length.
  • To define and characterize 'orderable' regular languages, where consecutive words differ by a bounded Levenshtein edit distance.
  • To determine whether every regular language can be partitioned into finitely many orderable sublanguages, and to compute the minimal such partition.
  • To design a bounded-delay enumeration algorithm using only push/pop operations at the ends of words, maintainable in a double-ended queue.
  • To establish complexity bounds for deciding orderability under various constraints, including NP-hardness for fixed edit distance and partition size.

Proposed method

  • Model enumeration as generating a sequence of bounded-length edit scripts that transform one word into the next, using only push/pop at the ends.
  • Use a pointer machine model to simulate the enumeration process, ensuring delay depends only on the automaton size, not word length.
  • Apply depth-first search (DFS) on the deterministic finite automaton (DFA) to explore all paths, with state marking to avoid cycles during non-loopable word enumeration.
  • Identify the unique simple cycle and path from the initial state to the cycle in linear time via DFS with recursion stack tracking.
  • Construct an ultimately periodic sequence of edit scripts: first enumerate non-loopable words, then transition to the loop, and finally traverse the loop periodically.
  • Bound the edit distance between consecutive words by 2k (k = number of states), achieved by ensuring each state appears at most twice in any edit operation.

Experimental results

Research questions

  • RQ1Which regular languages admit an infinite sequence of words where consecutive words differ by a bounded Levenshtein edit distance?
  • RQ2Can every regular language be partitioned into a finite union of orderable sublanguages, and what is the minimal number of such components?
  • RQ3Is it possible to achieve bounded-delay enumeration of a regular language using only edit operations at the ends of the word, and if so, under what conditions?
  • RQ4What is the computational complexity of deciding whether a regular language is orderable under a fixed edit distance and partition size?
  • RQ5How can the minimal partition into orderable languages be computed efficiently, and what structural properties (e.g., slenderness) characterize such languages?

Key findings

  • A regular language is orderable (i.e., admits a sequence with bounded edit distance between consecutive words) if and only if it is slender, meaning it has finitely many infinite paths in its automaton.
  • The minimal number t of orderable components into which a regular language can be partitioned is equal to the number of pairwise incomparable infinite paths in its DFA, computable in PTIME.
  • For a 1-slender language (i.e., t = 1), the paper constructs an ultimately periodic sequence of edit scripts that enumerates all words with delay linear in the size of the DFA and edit distance at most 2k.
  • The bounded-delay enumeration algorithm maintains the current word in a double-ended queue using only push and pop operations at both ends.
  • Deciding whether a regular language is partition-orderable with a fixed edit distance d and fixed number of classes t is NP-hard, even for finite languages.
  • When restricted to edit operations only at the end of the word (stack model), the class of orderable languages is strictly weaker and corresponds exactly to the slender languages, with the same minimal partition size and bounded-delay enumeration achievable.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.