
For a language \(L\), the square of \(L\), denoted by \(L^{(2)}\), is defined to be the set of squares of the words of \(L\), i.e., \(L^{(2)}=\{ww\mid w\in L\}\). The main result of this paper is the characterization of the regular languages according to whether their squares are 1) regular (REG), 2) context-free (CF) or 3) none of the two. Note that the square of a regular language is always context-sensitive [see \textit{S. Horváth, P. Leupold} and \textit{G. Lischke}, Lect. Notes Comput. Sci. 2450, 220--230 (2003; Zbl 1015.68111)]. The characterization is the following: \(L^{(2)}\) is in REG if and only if the root of \(L\) is finite, i.e., all words of \(L\) are powers of finitely many different primitive words. \(L^{(2)}\) is in CF if and only if \(L\) is a subset of a FIP set, which means a finite union of sets of the form \(p^*wp^*\) or \(w'p^*w\), where \(p\) is not a suffix of \(w\) and \(w'w\notin p^+\). Finally, it is proved that this characterization is effective, i.e., it can be algorithmically decided for a given regular language \(L\) whether \(L^{(2)}\) is in REG, in CF or in none of the two classes. Also, conditions for a CF-languages \(L\) such that \(L^{(n)}\) is in CF, are found.
context-free languages, primitive words, Combinatorics on words, decidability, Formal languages and automata, Automata and formal grammars in connection with logical questions, regular languages, set of squares
context-free languages, primitive words, Combinatorics on words, decidability, Formal languages and automata, Automata and formal grammars in connection with logical questions, regular languages, set of squares
| selected citations These citations are derived from selected sources. This is an alternative to the "Influence" indicator, which also reflects the overall/total impact of an article in the research community at large, based on the underlying citation network (diachronically). | 1 | |
| popularity This indicator reflects the "current" impact/attention (the "hype") of an article in the research community at large, based on the underlying citation network. | Average | |
| influence This indicator reflects the overall/total impact of an article in the research community at large, based on the underlying citation network (diachronically). | Average | |
| impulse This indicator reflects the initial momentum of an article directly after its publication, based on the underlying citation network. | Average |
