Decision trees for subword-closed languages over arbitrary finite alphabets
Abstract · 20 pages, 2 figures, 5 tables
Moshkov classified binary subword-closed languages $L$ by the minimum depth of decision trees that recognize the words of length $n$ in $L$, or decide membership in $L$, using queries that return the $i$th letter of the input word. We extend this classification to alphabets with $k \ge 2$ letters. With the homogeneity and heterogeneity dimensions defined via pairs of different letters, the classification is the same as for $k = 2$: the deterministic recognition depth is bounded, logarithmic, or linear in $n$, the other three depths are bounded or linear, and there are five complexity classes. Since Moshkov's two-block structure lemma fails for $k \ge 3$, we prove a structure lemma with up to $k$ blocks. Our bounds are polynomial in $k$ and the two dimensions; in the bounded case they replace the exponential constant of the binary case by a linear one. We also show that the complexity class (one of the five) of a language given by a finite set of forbidden subwords can be computed in polynomial time. For several ternary languages we prove exact formulas for all four depths and check them by computation for small $n$.