Computing the Order of a Locally Testable Automaton

A locally testable language is a language with the property that, for some nonnegative integer j, whether or not a word x is in the language depends on (1) the prefix and suffix of x of length j, and (2) the set of substrings of x of length j+1, without regard to the order in which these substrings occur or the number of times each substring occurs. This paper shows that computing the smallest j of a given locally testable deterministic automaton is NP-hard, and presents a polynomial-time e- approximation algorithm for computing such j. It turns out that, for a fixed j, there is a polynomial time algorithm to decide whether a given automaton satisfies the above condition. In addition, we have obtained an upper bound of 2n2+1 on the smallest such j for a locally testable automaton of n states.