Abstract
We consider measures that limit universal parallelism in computations of an alternating finite automaton (AFA). Maximum pared tree width counts the largest number of universal branches in any computation and acceptance width counts the number of universal branches in the best accepting computation, i.e., in the accepting computation with least universal parallelism. We give algorithms to decide whether the maximum pared tree width or the acceptance width of an AFA are bounded by an integer k. For a constant k the algorithm for maximum pared tree width operates in polynomial time. An AFA with m states and acceptance width k can be converted to an NFA with
states. We consider corresponding lower bounds for the transformation. The tree width of an AFA counts the number of all (existential and universal) branches of the computation. We give upper and lower bounds for converting an AFA of bounded tree width to a DFA.
Introduction
Deterministic and nondeterministic finite automata (DFA and NFA) are well understood models for which a significant number of results are known. As a generalization of nondeterminism, alternation was introduced in [1], and has since been studied extensively for Turing machines [5, 6, 23], and pushdown automata [1, 20].
The power of alternation in finite automata (AFAs) was first studied by Chandra, Kozen, and Stockmeyer [1], later by King [15] and Hromkovič [10], and state complexity trade-offs with NFAs and DFAs were given by Fellah et al. [3]. However, results on alternating finite automata remain relatively sparse compared to alternating pushdown automata and alternating (infinite) automata, and little effort has been made towards examining restricted computations within the context of alternation.
Restricted amounts of nondeterminism have been measured in various ways, including but not limited to ambiguity [19], tree width [11, 22], and string path width [13]. These so-called “measures of nondeterminism” examine some aspect of an automaton’s computations. For example, the number of partial, or accepting computations on a given string. For a particular regular language and model, the state complexity is a measure of how complicated it is for that model to capture that language. The state complexity is combined with these measures of restricted nondeterminism, yielding tradeoffs between the amount of nondeterminism and the number of states required.
An automaton is said to alternate when it switches from an existential state to a universal state (or vice versa) [1]. There exists an exponential state complexity blow-up between two-way AFAs with at most k alternations and two-way AFAs with at most
alternations, and in general this hierarchy is infinite [7]. The emptiness problem for AFAs was shown to be PSPACE-Complete for general alphabets [8, 12]. More recently, the state complexity of various operations on AFAs has also been studied [9].
In this paper, we focus on the original model of AFAs (introduced by Chandra, Kozen, and Stockmeyer) where the states are either existential or universal [1, 7, 10, 12, 15, 23], rather than the one where states are labeled with boolean functions [18]. However, both of these models recognize exactly the regular languages. We also do not consider states or transitions with negation, though there is only a linear blow-up between our model and the one which can perform negation [3].
This paper is organized as follows. Section 2 recalls several definitions, and fixes our model for alternating finite automata. Section 2.1 introduces the notions of acceptance width and maximal pared tree width, and provides several initial results and bounds for these new metrics. Section 3 gives a polynomial transformation for an NFA to simulate an AFA with bounded parallelism, shows that the decidability of several decision problems for AFAs with finite acceptance width, and gives algorithms to decide whether an AFA’s maximal pared tree width or acceptance width is bounded by a given constant. Section 4 presents unary witness languages with finite acceptance width (with respect to the number of states) which require only a small number of states to be recognized by an AFA, but require an exponential number of states to be recognized by an NFA or DFA. Finally, Sect. 4.1 introduces a non-unary witness language, and provides another exponential state complexity blow-up; this time between AFAs with bounded tree width (with respect to the number of states), and NFAs and DFAs.
Preliminaries
An AFA is a 6-tuple,
where
(the existential state set) and
(the universal state set) are finite sets of states such that
,
is the input alphabet,
is the transition function,
is the initial state, and
is the set of final states. We use
to mean the empty string, and
to mean A with a different specified starting state,
. Note that the standard NFA model can be seen as an AFA where
contains all of the states, and
is empty. We must further specify the language of an AFA, to account for the differences caused by universal states. We do this by defining them bottom-up with respect to their states.
Definition 1
Let
be an AFA, and
be a copy of the AFA with
as the initial state. We point out that
if
. Consider
where
. Then for
, define:
If
, then
if and only if
for all
.If
, then
if and only if
for some
.
The language of A is defined as
.
The computation tree of an AFA A on
from
, denoted
is the singleton node
. The computation tree of an AFA A on cv from q, denoted
, such that
is defined inductively as the tree:
whose internal nodes are labeled by a tuple (p, a), for
(i.e., each internal node is labeled by a state and character)which is rooted by a node (q, c)
- where the trees rooted at the children of (q, c) are
- the computation trees
if
, and - the failure node
if
(that is, if
is undefined).
If a computation tree of an AFA A on a string x starts on the initial state of A, then we omit the state label, denoting it as
. We use the notation
to mean the (depth-first) ordered tuple of leaves in the computation tree T. The computation tree of an NFA is defined similarly, except its nodes are always labeled by existential states [11].
We define the paring of a computation tree, which serves as the transformation around which our new measures are defined. For an AFA
and a string
, a pared computation tree of
is defined as a tree where for each node
:
if
then keep only one child node, andif
then keep all child nodes.
Since there is a choice made on each of the existential nodes, the same computation tree can result in many different pared computation trees. A pared tree represents a possible computation of the AFA A. At nodes labeled by existential states, the pared tree follows one (nondeterministically chosen) way to continue the computation. The nodes labeled by universal states have children labeled by all states reachable from that state in the next computation step. Note that every pared tree of an NFA will only have one leaf, since all of its states are existential. We denote the set of all pared computation trees on a tree T as
. A pared computation tree is accepting if all of its leaves are labeled by accepting states (implying that no leaf is the failure node), and a string x is accepted by an AFA if and only if A has an accepting pared computation tree in
.
Without loss of generality, we assume that all of an AFA’s universal states are reachable. However, since emptiness for AFAs is PSPACE-Complete, we cannot assume that all of an AFA’s states are useful in the sense that they can be used in an accepting computation. Since a universal state with at most one outgoing transition per character is no different than using an existential state, we also assume that every universal state has multiple outgoing transitions on at least one character.
For a regular language L,
, (respectively,
), is the state complexity, (respectively, nondeterministic and alternating state complexity) of L.
Tree Width of Alternating Machines
The tree width [11] of an AFA A on a string x, denoted
, is the number of leaves in the computation tree of A on x. That is,
.
Since the notion of tree width is originally based on the computation tree of an NFA, and our AFA definition extends the original notion of computation trees, it seems natural to look at “alternating tree widths”.
Definition 2
Let
be an AFA. Then the acceptance width of A on a string
, denoted
, is the minimum number of leaves of any accepting pared computation tree of
. The maximum pared tree width of A on a string
, denoted
, is the maximum number of leaves of any pared computation tree of
. Formally, these are:
Since the (original) tree width does not perform the paring operation, we get that for any AFA A and string x,
. We also get the following condition for equality between the measures, which occurs when the paring operation does not change the computation tree.
Remark 1
Let A be an AFA, and x a string. Then
if and only if each node in
with more than one child is labeled by some universal state in A.
We extend the acceptance width and maximum pared tree width functions as functions on integers in the normal manner:
![]() |
![]() |
![]() |
If, for a string x, there are no accepting computation trees, then
. Since the emptiness problem is PSPACE-complete for AFAs [8], and these results hold even for unary languages, then we get the following equivalence.
Remark 2
([8]). Let A be an AFA. Then it is PSPACE-complete to decide whether or not
.
If an m-state AFA has finite tree width, then its tree width is at most
[22]. Since, on any string, the acceptance width and maximal pared tree width of an AFA are upper-bounded by the tree width, we get the following conditional upper bound.
Corollary 1
([22]). Let A be an m-state AFA with finite tree width. Then
.
Alternatively, we could replace the computation trees by directed acyclic graphs by merging any nodes on the same state on the same level. However, in this case, the acceptance width and maximal pared tree width of an m-state AFA would be at most m.
Decision Problems for Pared Tree Width and Acceptance Width
Normally, an NFA may require an exponential state blow-up to simulate an AFA [3]. However, an NFA can simulate any finite acceptance width AFA with at most a polynomial blow-up in the number of states. An m-state AFA A with acceptance width k can be simulated by an NFA where the states are k-tuples of states of A and transitions of the NFA simulate at most k parallel computations of A.
Lemma 1
Let A be an m-state AFA, such that
, for some constant k. Then
states are sufficient for an NFA to simulate A.
It is known that the emptiness problem for NFAs can be solved in linear time, with respect to the number of states, using a breadth first search [4]. The transformation from Lemma 1 then yields a polynomial-time algorithm to decide emptiness for a finite acceptance width AFA.
Corollary 2
Let A be an m-state AFA with finite acceptance width k, for some constant k. Then in
time we can decide whether
.
Using the transformation from Lemma 1, but modifying which states of the NFA are accepting, we can also decide whether the maximal pared tree width of an AFA is bounded.
Theorem 1
Let A be an m-state AFA and k a constant. Then we can decide whether or not the maximal pared tree width of A is at most k in
time.
Using similar ideas from the characterization of NFAs with finite tree width [22], we are able to characterize AFAs with finite maximal pared tree width.
Corollary 3
Let
be an AFA. Then
if and only if there exists some state
and character
such that
and q is involved in a cycle.
Modifying existing algorithms for deciding finiteness of an NFA’s tree width [14], we are also able to decide finiteness of an AFA’s maximal pared tree width in polynomial time.
Corollary 4
([14]). Let
be an m-state AFA. Then we can decide whether or not the maximal pared tree width of A is bounded by some constant k in
time1.
The general membership problem is P-complete for AFAs [12], and this holds even for finite unary languages. In fact, this P-completeness is even stronger, as it holds for all cycle-free AFAs.
Since an m-state cycle-free AFA has at most
states being evaluated in parallel, then the membership problem for AFAs with bounded parallel computations is also P-complete.
Corollary 5
([12]). Let A be a finite maximal pared tree width AFA. Then for a string x, it is P-complete to decide whether
.
We can also decide whether the pared acceptance width of an AFA is finitely bounded by some number.
Theorem 2
Let A be an AFA, and
. Then it is decidable whether the acceptance width of A is bounded by k.
While it is decidable whether the acceptance width of an AFA is bounded by an integer k, the algorithm presented in Theorem 2 is not an efficient one and we cannot expect to have an efficient algorithm for this problem2. For a given AFA A and
we can construct an AFA
that begins the computation by a universal step with
choices, where the first computation simulates A and the remaining k computations always accept deterministically. Then
if and only if
and deciding the emptiness of an AFA is PSPACE-complete [8].
For any AFA A with finite tree width, the acceptance width of A must also be finite. Under this restriction, we can decide whether the acceptance width of A is finite using the construction from Theorem 2.
Corollary 6
Let A be an m-state AFA with finite tree width. By Corollary 1, the acceptance width is then at most
. Since the acceptance width of A is finite if and only if it is at most
, then it is decidable whether the acceptance width of A is finite. We do this by using Theorem 2 with an input value of
.
Since the acceptance width of an AFA is only upper bounded by its tree width, it is possible that an AFA has infinite tree width and finite acceptance width. In this case, we do not have an upper bound for the acceptance width.
Question 1
Let A be an m-state AFA with infinite tree width and finite acceptance width k. Is there any expression in m which bounds k?
As a result, it is not immediately obvious whether the finiteness of an AFA’s acceptance width is decidable in general.
Question 2
For an AFA A such that
, does there exist an algorithm to decide whether or not
?
State Complexity
Let
be a set of integers, and
be the least common multiple of all elements in
. We define
as the set of all unary strings whose lengths are the product of all integers in
.
![]() |
1 |
Equivalently, we have
.
Lemma 2
Let
be a set of integers. Then
.
The state complexity is, of course, maximal with respect to the size of the input set when its elements are pairwise coprime.
Lemma 3
Let
be a set of n integers. If the elements of
are pairwise coprime, then there exists an AFA A recognizing
with
states and tree width n such that 
Proof
Let
be a set of integers whose elements are pairwise coprime. We give the AFA recognizing
in Fig. 1, whose tree width and number of states matches the claim. Since
’s elements are pairwise coprime,
. And by Lemma 2,
. 
Fig. 1.

AFA for
where
. Universal states are marked with an additional label ‘u’, and existential states are given as normal.
Recognizing that the state complexity blow-up in Lemma 3 is exactly Landau’s function [2, 21], we get the following exponential state complexity trade-off between AFAs with finite tree width (and therefore also finite acceptance width) and NFAs. A similar idea and result was also given by Kupferman et al. [17], though it was formulated to capture the unary language
, for
.
Theorem 3
([2, 17, 21]). Let
be a set of pairwise coprime integers, and A be an
-state AFA recognizing
with tree width
. Then any NFA equivalent to A will require at least
states.
While Landau’s function gives a lower bound for the state complexity blow-up of simulating a restricted tree width AFA with an NFA, it is only given in terms of the number of states.
Lemma 4
Let
be a set of pairwise coprime integers, for some
. Let A be an m-state AFA such that A has acceptance width n and recognizes
. Then any NFA equivalent to A will require at least
states.
In the general case, for every m, there exists an m-state AFA which cannot be simulated by any NFA with fewer than
states [3], and any equivalent DFA needs
states [1]. However, to get this double-exponential state complexity blow-up, the m-state AFA needs a tree width much larger than m.
Let
be a set of n prime numbers. We define
, the set of all unary strings whose lengths are a product of at least two distinct primes from
.
![]() |
2 |
Lemma 5
There exists an AFA A recognizing
with
states3 and a maximal pared tree width of 2.
We extend
, defining
as the set of all unary strings whose lengths are a product of at least k distinct primes from
, for some constant k.
| 3 |
Using similar ideas as the proof from Lemma 5 but operating on an arbitrary number of elements instead of only two, we get the following result.
Lemma 6
For every
, there exists an AFA A recognizing
with
states and a maximal pared tree width of k.
Universal Infix Language
For two strings
, we say that v and
are disjoint if they do not share any symbols. We extend this notion to tuples of strings, such that a tuple of strings
is disjoint if and only if all pairs of strings
are disjoint.
A bitstring
is a string for representing some boolean value across a set of n elements. We define the cardinality of a bistring as the number of 1s appearing in that bitstring.
The universal infix language of an ordered string tuple
consists of strings that contain each
as an infix. We define a labeling function
which takes as input a string
and an n-tuple
, and produces the bitstring
, where
if and only if the
element of
is an infix of s, for
. More formally, the universal infix language over a tuple of strings
and an alphabet
is defined as:
![]() |
4 |
An AFA with small amounts of alternation can recognize this language with relatively few states, and limited universal branching.
Lemma 7
Let
be an ordered, disjoint tuple of strings. Then there exists an AFA recognizing
with
states and tree width n.
Proof
Let
be an ordered, disjoint tuple of strings, and let
be the
character of the
string. We give the general structure for an AFA in Fig. 2, which recognizes
with 1 universal and
existential states. This AFA has tree width n, and only alternates between universal and existential states once. The only final state is the one at the end of all the branches. And, excepting the initial state, we define the transition function deterministically. If the machine is reading
, has read up to
, and then encounters some mismatched symbol, then the computation path currently in state i.j will return to state i, indicating that the infix must be restarted.
Fig. 2.
AFA for a universal infix language over 
However, a DFA for
needs exponentially more states than an AFA.
Lemma 8
Let
be a disjoint tuple of strings. Then
![]() |
Furthermore, the addition of nondeterminism does not improve this bound.
Lemma 9
Let
be a disjoint tuple of strings. Then
![]() |
Theorem 4
There exists an m-state AFA A (where m can be arbitrarily large) with tree width n such that any equivalent NFA needs
states. The AFA A can be chosen to alternate only once between universal and existential states. We note that the alphabet size of A depends on n.
We give the following constructive example to help clarify the state blow-up from Theorem 4.
Example 1
Let
, and
be the DFA given in Fig. 3, which recognizes
.
Fig. 3.

12-State DFA for 
To make counting of states easier, below we assume that an AFA computation step always has at most two choices (i.e. computation step is either undefined, is deterministic, or has exactly two existential or universal choices). This assumption can be made with only a constant factor blow-up of the automaton’s state complexity [16].
Lemma 10
Let A be an m-state AFA with tree width n. Then A has an equivalent DFA B with at most
states.
Combining the upper and lower bounds from Lemmas 8, 9 and 10, we get the following state complexity range for simulating a finite tree width AFA with a DFA.
Corollary 7
Let A be an m-state AFA with tree width n. Then
![]() |
Acknowledgments
Research supported by NSERC grant OGP0147224.
We thank the referees for their helpful and thoughtful comments. But, due to the short deadline for submitting the proceedings version, we will try to implement some revisions for a later journal version.
Footnotes
The DCFS proceedings has a slightly worse bound of
, and the specifics of the improved version will appear in a future paper.
This observation, with a justification different from the below one, was suggested by an anonymous referee.
We need one extra state each if 2 or 3
.
Contributor Information
Alberto Leporati, Email: alberto.leporati@unimib.it.
Carlos Martín-Vide, Email: carlos.martin@urv.cat.
Dana Shapira, Email: shapird@g.ariel.ac.il.
Claudio Zandron, Email: zandron@disco.unimib.it.
Chris Keeler, Email: keeler@cs.queensu.ca.
Kai Salomaa, Email: ksalomaa@cs.queensu.ca.
References
- 1.Chandra AK, Kozen DC, Stockmeyer LJ. Alternation. J. ACM. 1981;28(1):114–133. doi: 10.1145/322234.322243. [DOI] [Google Scholar]
- 2.Chrobak M. Finite automata and unary languages. Theoret. Comput. Sci. 1986;47:149–158. doi: 10.1016/0304-3975(86)90142-8. [DOI] [Google Scholar]
- 3.Fellah A, Jürgensen H, Yu S. Constructions for alternating finite automata. Int. J. Comput. Math. 1990;35(1–4):117–132. doi: 10.1080/00207169008803893. [DOI] [Google Scholar]
- 4.Fernau H, Krebs A. Problems on finite automata and the exponential time hypothesis. Algorithms. 2017;10(1):24. doi: 10.3390/a10010024. [DOI] [Google Scholar]
- 5.Fijalkow, N.: The state complexity of alternating automata. In: Proceedings of the 33rd Annual ACM/IEEE Symposium on Logic in Computer Science, LICS 2018, Oxford, UK, 09–12 July 2018, pp. 414–421 (2018)
- 6.Finkbeiner B, Sipma H. Checking finite traces using alternating automata. Formal Methods Syst. Des. 2004;24(2):101–127. doi: 10.1023/B:FORM.0000017718.28096.48. [DOI] [Google Scholar]
- 7.Geffert V. An alternating hierarchy for finite automata. Theor. Comput. Sci. 2012;445:1–24. doi: 10.1016/j.tcs.2012.04.044. [DOI] [Google Scholar]
- 8.Holzer, M.: On emptiness and counting for alternating finite automata. In: Developments in Language Theory II, At the Crossroads of Mathematics, Computer Science and Biology, Magdeburg, Germany, 17–21 July 1995, pp. 88–97 (1995)
- 9.Hospodár M, Jirásková G, Krajňáková I. Operations on boolean and alternating finite automata. In: Fomin FV, Podolskii VV, editors. Computer Science – Theory and Applications; Cham: Springer; 2018. pp. 181–193. [Google Scholar]
- 10.Hromkovič J. On the power of alternation in automata theory. J. Comput. Syst. Sci. 1985;31(1):28–39. doi: 10.1016/0022-0000(85)90063-7. [DOI] [Google Scholar]
- 11.Hromkovič J, Seibert S, Karhumäki J, Klauck H, Schnitger G. Communication complexity method for measuring nondeterminism in finite automata. Inform. Comput. 2002;172(2):202–217. doi: 10.1006/inco.2001.3069. [DOI] [Google Scholar]
- 12.Jiang T, Ravikumar B. A note on the space complexity of some decision problems for finite automata. Inf. Process. Lett. 1991;40(1):25–31. doi: 10.1016/S0020-0190(05)80006-7. [DOI] [Google Scholar]
- 13.Keeler C, Salomaa K. Branching measures and nearly acyclic NFAs. In: Pighizzini G, Câmpeanu C, editors. Descriptional Complexity of Formal Systems; Cham: Springer; 2017. pp. 202–213. [Google Scholar]
- 14.Keeler C, Salomaa K. Nondeterminism growth and state complexity. In: Hospodár M, Jirásková G, Konstantinidis S, editors. Descriptional Complexity of Formal Systems; Cham: Springer; 2019. pp. 210–222. [Google Scholar]
- 15.King KN. Alternating multihead finite automata (extended abstract). In: Even S, Kariv O, editors. Automata, Languages and Programming; Heidelberg: Springer; 1981. pp. 506–520. [Google Scholar]
- 16.King, K.N.: Measures of parallelism in alternating computation trees (extended abstract). In: Proceedings of the 13th Annual ACM Symposium on Theory of Computing, 11–13 May 1981, Milwaukee, Wisconsin, USA, pp. 189–201 (1981)
- 17.Kupferman, O., Ta-Shma, A., Vardi, M.Y.: Counting with automata. Short Paper Presented at the 15th Annual IEEE Symposium on Logic in Computer Science (LICS 2000) (2000)
- 18.Leiss EL. Succinct representation of regular languages by boolean automata. Theor. Comput. Sci. 1981;13:323–330. doi: 10.1016/S0304-3975(81)80005-9. [DOI] [Google Scholar]
- 19.Leung H. Descriptional complexity of nfa of different ambiguity. Int. J. Found. Comput. Sci. 2005;16(5):975–984. doi: 10.1142/S0129054105003418. [DOI] [Google Scholar]
- 20.Moriya E. A grammatical characterization of alternating pushdown automata. Theor. Comput. Sci. 1989;67(1):75–85. doi: 10.1016/0304-3975(89)90023-6. [DOI] [Google Scholar]
- 21.Okhotin A. Unambiguous finite automata over a unary alphabet. Inf. Comput. 2012;212:15–36. doi: 10.1016/j.ic.2012.01.003. [DOI] [Google Scholar]
- 22.Palioudakis A, Salomaa K, Akl SG. State complexity of finite tree width nfas. J. Autom. Lang. Comb. 2012;17(2–4):245–264. [Google Scholar]
- 23.Ruzzo WL. Tree-size bounded alternation. J. Comput. Syst. Sci. 1980;21(2):218–235. doi: 10.1016/0022-0000(80)90036-7. [DOI] [Google Scholar]










