arXiv:2608.24259cs.FLAug 2026

Manuscript Offprint

arXiv:2608.24259

Turn Complexity and Bounded Languages

Giovanni Pighizzini

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Giovanni Pighizzini

Dipartimento di Informatica

Università degli Studi di Milano, Italy

pighizzini@di.unimi.it

A turn or reversal in a computation of a pushdown automaton is a switch from a phase in which the height of the pushdown store increases to a phase in which it decreases. Given a pushdown automaton, we first consider, for each string in its language, the minimum number of turns made in accepting computations (weak measure). We prove that it is decidable whether a pushdown automaton accepts a bounded language in a constant number of turns and whether it accepts a bounded language in k turns, for any given k≥0k \geq 0. This is in contrast to the general case, in which these problems are known to be undecidable, with the exception of acceptance in 0 turns, which is decidable. Furthermore, we prove that when the number of turns sufficient to accept a bounded language is not limited by any constants, it linearly grows with respect to the input length. Also this is in contrast with the general case where, for each nonnegative k, there exists a language for which the number of turns necessary and sufficient is of the order of log⁡(k)\log^{(k)}, the k times composition of the logarithm with itself. We also prove that, when the costs of all accepting computations are taken into account (accept measure), a linear lower bound for the number of turns, if not limited by any constants, holds even removing the restriction to bounded languages.

1 Introduction

In previous works, we studied different complexity measures for pushdown automata. The pushdown height takes into consideration the maximal height reached by the pushdown store in a computation [13, 14], the push complexity counts the number of push operations [12], while the turn complexity considers the number of switches of the pushdown from an increasing to a decreasing phase [11]. 1^{1}

For pushdown height and push complexity, a constant bound immediately implies the possibility of encoding the pushdown store in a finite control and, hence, the regularity of the accepted language. In case these measures are not bounded by any constants, they grow at least as a double logarithmic function in the length of the input if, for each accepted string, only the cost of the less expensive accepting computation (weak measure) is taken into account. Furthermore, there is a machine which uses exactly such an amount. Hence, these lower bounds cannot be improved, except in the case of unary languages, i.e., languages defined over a one-letter input alphabet, in which the optimal lower bounds in the non-costant case are logarithmic for pushdown height and linear for push complexity [13, 12]. We point out that the idea of considering, for each accepted input, the less expensive accepting computation is related to the idea of nondeterminism in a broad sense: when more choices are possible, a nondeterministic machine is able not only to select the one that leads to acceptance, if any, but among all possibilities leading to acceptance the machine is able to select the less expensive one, with respect to resource under consideration.

In contrast, when considering the costs of all accepting computations, i.e., for each accepted input the cost of most expensive accepting computation (accept measure), the previous lower bounds for

1^{1}As in the paper by Ginsburg and Spainer [4], in which this notion was investigated for the first time, and in our previous work on this topic [11], here we use the term turn. Sometimes turns are called reversals (e.g., [2]).

M. Hospodár et al. (Eds.): 17th International Conference on Automata and Formal Languages (AFL 2026) EPTCS 451, 2026, pp. 261–274, doi:10.4204/EPTCS.451.18

© G. Pighizzini This work is licensed under the Creative Commons Attribution License.

Turn Complexity and Bounded Languages

pushdown height and push complexity become linear, regardless the size of the input alphabet. As a consequence, also in the deterministic case we obtain linear lower bounds [14].

In the case of turn complexity, the situation is very different. First of all, pushdown automata using a constant number of turns accept the class of ultralinear languages [4], a proper subclass of context-free languages, larger than the class of regular languages. Indeed, already one turn gives to pushdown automata more power than finite automata. Concerning the nonconstant case, considering the weak measure, we proved the existence of an infinite hierarchy: for each integer k≥0k \geq 0 there exists a language that can be accepted using a number of turns of the order of log⁡(k)n\log^{(k)} n, but cannot be accepted using a number of turns of the order of log⁡(k+1)n\log^{(k+1)} n under the weak measure (here, log⁡(k)\log^{(k)} denotes the k-times composition of the logarithmic function with itself). Furthermore, there exists a nonregular language which is accepted in log⁡∗n\log^* n turns (the iterated logarithm) [11].

In the witness pushdown automata used to prove these results, a fundamental role is played by the nondeterminism combined with the structure of the strings in the accepted languages. So, it is natural to ask what happens if we limit the role of the nondeterminism, by considering the costs of all accepting computations (accept measure) 2^{2} or the costs for deterministic machines only, or if we remove or limit the possibility to have special structures encoded in the accepted strings. Concerning the latter point, we could ask what happens in the case of pushdown automata with a unary input alphabet. Here, we attack and solve this problem in a more general case. We consider machines accepting word-bounded languages, i.e., subsets of w1∗w2∗⋯wm∗w_{1}^{*}w_{2}^{*}\cdots w_{m}^{*}, where w1,w2,…,wmw_{1}, w_{2}, \ldots, w_{m} are fixed words over a given alphabet. We prove that for pushdown automata accepting word-bounded languages, under the weak measure, if the number of turns is nonconstant then it linearly grows with respect to the input length. Concerning the former point, we also prove a linear lower bound for the number of turns under the accept measure, when nonconstant, even if the restriction to word-bounded languages is dropped.

Before considering these complexity questions, we investigate the problem of deciding whether a pushdown automaton accepts in a finite number of turns and when it accepts in k turns, for any fixed k. Under the accept measure these problems are decidable [4]. In contrast, under the weak measure they are undecidable, even if the machine is a one-counter automaton, with the exception of acceptance in 0 turns [11]. The arguments used to prove these undecidability results derive from classical arguments related to encodings of Turing machine computations and do not work in the case the accepted language is restricted to be unary or, more in general, to be bounded. So it is natural to ask what happens under these restrictions. In the paper, we investigate this question and we prove that the above-mentioned problems are decidable, namely it is decidable whether a pushdown automaton accepts a word-bounded language in a finite number of turns and when it accepts a word-bounded language in k turns, for any fixed k.

In the general case, similar undecidability results for pushdown and one-counter automata have been proved, under the weak measure, considering pushdown height and push complexity, while decidability has been obtained for the restriction to unary languages [13, 14, 12]. Results concerning the number of turns in pushdown automata and in the restricted case of pushdown automata accepting bounded language are presented in [8, 9], also including relationships between the number of turns and the size of the descriptions of machines.

The tools we use to prove our decidability and complexity results derive from the theory of semilinear sets and Presburger Arithmetic, and the well-known fact that Parikh images of context-free languages

2^{2}According to the previous observation of the interpretation of the nondeterminism in the weak measure, in the accept measure the role of the nondeterminism is restricted only to the selection of the accepting strategy, but it is not used to select the less expensive one.

are semilinear [5, 10]. In particular, for the results concerning the weak measure and the word-bounded case, we use the fact that there is a one-to-one correspondence between strings in a strictly letter-bounded language accepted by a pushdown automaton and the vectors in its Parikh image. 3^{3} We first solve the strictly letter-bounded case and then we reduce the word bounded case to it. For the results concerning the accept case, we are interested only in the length of strings, so we do not need such correspondence. Hence, by adapting the same techniques, we are able to formulate them by removing the restriction to word bounded-languages.