Alternating Towers and Piecewise Testable Separators

Stepan Holub, Tomás Masopust, Michaël ThomazoarXiv 2014

Introduction: The Challenge of Language Separability

Regular expressions and finite automata are foundational tools in computer science, essential for tasks ranging from XML schema definition to path querying in graph databases. However, as these systems scale, the resulting regular expressions often become prohibitively complex, hindering both human readability and computational efficiency.

A promising approach to managing this complexity is the concept of language separation. Given two disjoint regular languages, $L_1$ and $L_2$, the goal is to identify a simpler intermediate language $S$ such that $L_1 \subseteq S$ and $S \cap L_2 = \emptyset$. This paper specifically investigates separation using piecewise testable languages, a subclass of regular languages characterized by the presence or absence of specific subsequences.

Illustration of an alternating tower between two languages, showing the sequence of strings bouncing between $L$ and $R$.

The computational difficulty of finding such a separator is intrinsically linked to the maximum height of alternating towers. An alternating tower is a finite sequence of strings that alternates between two languages, where each subsequent string contains the previous one as a subsequence. This research aims to provide precise mathematical bounds on these tower heights relative to the size of the input automata.

Methodology

The authors employ a combination of formal language theory and complexity analysis to derive their results. To establish upper bounds on tower height, they introduce cyclic factorization, a greedy strategy that decomposes paths within Nondeterministic Finite Automata (NFAs) into "letter factors" and "cycle factors."

An example of an adversarial NFA construction used to demonstrate the exponential growth of alternating towers relative to alphabet size.

To prove lower bounds, the researchers utilize adversarial automata construction. By designing specific NFAs and Deterministic Finite Automata (DFAs) that force the creation of exceptionally tall towers, they demonstrate that the worst-case complexity is unavoidable. Furthermore, they apply complexity reductions from established problems, such as the NFA Universality problem and the Monotone Circuit Value Problem, to categorize various separability and testability tasks into specific complexity classes (e.g., PSPACE, P-complete, NL-complete).

Key Insights: The Alphabet Bottleneck

A primary finding of this research is that the alphabet size ($\Sigma$) is the critical bottleneck for tower height. While the number of states ($n$) in an automaton influences complexity, the height of alternating towers grows exponentially with the size of the alphabet. Specifically, if the alphabet is fixed, the problem remains polynomial; however, as the alphabet size increases, the complexity escalates exponentially.

The study also distinguishes between subsequences and prefixes. The authors observed that the strings in their adversarial constructions were often prefixes of one another. This led to a focused analysis of "prefix towers," revealing a significant behavioral divergence: for DFAs, prefix towers are strictly bounded to a quadratic height ($O(mn)$), whereas for NFAs, they can still reach exponential heights ($2^{O(m+n)}$).

Key Results and Complexity Bounds

The paper provides several tight bounds that clarify the landscape of piecewise testable separation:

  • Tower Height Upper Bound: For two NFAs with $n$ states and an alphabet of size $m$, the maximum height of a finite tower is $O(n^m)$.
  • Lower Bound Tightness: The authors successfully constructed an NFA with $m+1$ states over an alphabet of size $m+1$ that produces a tower of height $2^{m+1}$, proving the exponential dependence on alphabet size is tight.
  • Prefix Tower Specifics: For two DFAs with $m$ and $n$ states, the maximum prefix tower height is exactly $mn/2$. For NFAs, this bound increases to $2^{m+n-1}$.
  • Algorithmic Classification: The problem of deciding whether two regular languages are separable by a piecewise testable language is shown to be P-complete. Additionally, determining the existence of an infinite prefix tower between two disjoint NFAs is NL-complete.

Conclusion and Future Directions

This work successfully pins down the theoretical complexity of computing piecewise testable separators by linking it to the structural properties of alternating towers. While the theoretical worst-case bounds are high, the authors note that in practice, the size of generated automata often decreases during the computation process, suggesting that real-world performance may be better than the worst-case analysis implies. Future research may focus on bridging the remaining small mathematical gaps in tower height bounds and developing more efficient algorithms tailored for practical software engineering applications.

Summary updated

BibTeX
@misc{holub2014alternating,
  author = {Stepan Holub and Tomás Masopust and Michaël Thomazo},
  title = {{Alternating Towers and Piecewise Testable Separators}},
  year = {2014},
  eprint = {1409.3943},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1409.3943},
}
Figure