English

Testing Simon's congruence

Formal Languages and Automata Theory 2018-04-30 v1

Abstract

Piecewise testable languages are a subclass of the regular languages. There are many equivalent ways of defining them; Simon's congruence k\sim_k is one of the most classical approaches. Two words are k\sim_k-equivalent if they have the same set of (scattered) subwords of length at most k. A language L is piecewise testable if there exists some k such that L is a union of k\sim_k-classes. For each equivalence class of k\sim_k, one can define a canonical representative in shortlex normal form, that is, the minimal word with respect to the lexicographic order among the shortest words in k\sim_k. We present an algorithm for computing the canonical representative of the k\sim_k-class of a given word wAw \in A^* of length n. The running time of our algorithm is in O(|A|n) even if knk \le n is part of the input. This is surprising since the number of possible subwords grows exponentially in k. The case k>nk > n is not interesting since then, the equivalence class of w is a singleton. If the alphabet is fixed, the running time of our algorithm is linear in the size of the input word. Moreover, for fixed alphabet, we show that the computation of shortlex normal forms for k\sim_k is possible in deterministic logarithmic space. One of the consequences of our algorithm is that one can check with the same complexity whether two words are k\sim_k-equivalent (with k being part of the input).

Keywords

Cite

@article{arxiv.1804.10459,
  title  = {Testing Simon's congruence},
  author = {Lukas Fleischer and Manfred Kufleitner},
  journal= {arXiv preprint arXiv:1804.10459},
  year   = {2018}
}
R2 v1 2026-06-23T01:37:57.721Z