In automata theory, an alternating finite automaton (AFA) is a nondeterministic finite automaton whose transitions are divided into existential and universal transitions. For example, let A be an alternating automaton.
Note that due to the universal quantification a run is represented by a run tree. A accepts a word w, if there exists a run tree on w such that every path ends in an accepting state.
A basic theorem states that any AFA is equivalent to a deterministic finite automaton (DFA), hence AFAs accept exactly the regular languages.
An alternative model which is frequently used is the one where Boolean combinations are in disjunctive normal form so that, e.g., would represent . The state tt (true) is represented by in this case and ff (false) by . This representation is usually more efficient.
Alternating finite automata can be extended to accept trees in the same way as tree automata, yielding alternating tree automata.