Unambiguous Finite Automaton
   HOME

TheInfoList



OR:

In
automata theory Automata theory is the study of abstract machines and automata, as well as the computational problems that can be solved using them. It is a theory in theoretical computer science with close connections to cognitive science and mathematical l ...
, an unambiguous finite automaton (UFA) is a
nondeterministic finite automaton In automata theory, a finite-state machine is called a deterministic finite automaton (DFA), if * each of its transitions is ''uniquely'' determined by its source state and input symbol, and * reading an input symbol is required for each state tr ...
(NFA) such that each word has at most one accepting path. Each
deterministic finite automaton In the theory of computation, a branch of theoretical computer science, a deterministic finite automaton (DFA)—also known as deterministic finite acceptor (DFA), deterministic finite-state machine (DFSM), or deterministic finite-state auto ...
(DFA) is an UFA, but not vice versa. DFA, UFA, and NFA recognize exactly the same class of
formal language In logic, mathematics, computer science, and linguistics, a formal language is a set of strings whose symbols are taken from a set called "alphabet". The alphabet of a formal language consists of symbols that concatenate into strings (also c ...
s. On the one hand, an NFA can be exponentially smaller than an equivalent DFA. On the other hand, some problems are easily solved on DFAs and not on UFAs. For example, given an automaton ''A'', an automaton ''A'' which accepts the complement of ''A'' can be computed in linear time when ''A'' is a DFA, whereas it is known that this cannot be done in polynomial time for UFAs. Hence UFAs are a mix of the worlds of DFA and of NFA; in some cases, they lead to smaller automata than DFA and quicker algorithms than NFA.


Formal definition

An '' NFA'' is represented formally by a 5-tuple, A=(Q,\Sigma,\Delta,q_0,F). An ''UFA'' is an NFA such that, for each word w=a_1a_2...a_n, there exists at most one sequence of states r_0,r_1,...,r_n, in Q with the following conditions: # r_0=q_0; # r_ \in \Delta (r_i, a_) for i=0,...n-1; # r_n \in F. In words, those conditions state that, if w is accepted by A, there is exactly one accepting path, that is, one path from an initial state to a final state that is labelled by w.


Example

Let L be the set of words over the
alphabet An alphabet is a standard set of letter (alphabet), letters written to represent particular sounds in a spoken language. Specifically, letters largely correspond to phonemes as the smallest sound segments that can distinguish one word from a ...
whose ''n''th last letter is an a. The figures show a DFA and a UFA accepting this language for ''n=2''. The minimal DFA accepting L has ''2n'' states, one for each subset of . There is an UFA of n+1 states which accepts L: it guesses the ''n''th last letter, and then verifies that only n-1 letters remain. It is indeed unambiguous as there exists only one ''n''th last letter.


Inclusion, universality, equivalence

Three
PSPACE In computational complexity theory, PSPACE is the set of all decision problems that can be solved by a Turing machine using a polynomial amount of space. Formal definition If we denote by SPACE(''f''(''n'')), the set of all problems that can ...
-hard problems for general NFA belong to PTIME for DFA and are now considered.


Inclusion

It is decidable in polynomial-time whether an UFA's language is a subset of another UFA's language. Let ''A'' and ''B'' be two UFAs. Let ''L''(''A'') and ''L''(''B'') be the languages accepted by those automata. Then ''L''(''A'')⊆''L''(''B'') if and only if ''L''(''A''∩''B'')=''L''(''A''), where ''A''∩''B'' denotes the Cartesian product automaton, which can be proven to be also unambiguous. Now, ''L''(''A''∩''B'') is a subset of ''L''(''A'') by construction; hence both sets are equal if and only if for each length ''n''∈\mathbb, the number of words of length ''n'' in ''L''(''A''∩''B'') is equal to the number of words of length ''n'' in ''L''(''A''). It can be proved that is sufficient to check each ''n'' up to the product of the number of states of ''A'' and ''B''. The number of words of length ''n'' accepted by an automaton can be computed in polynomial time using dynamic programming, which ends the proof.


Universality, equivalence

The problem of universalityi.e.: given a UFA, does it accept every string of Σ*? and of equivalence,i.e.: given two UFAs, do they accept the same set of strings? also belong to PTIME, by reduction to the inclusion problem.


Checking whether an automaton is unambiguous

For a nondeterministic finite automaton A with n states and an m letter alphabet, it is decidable in time O(n^2m) whether A is unambiguous. It suffices to use a fixpoint algorithm to compute the set of pairs of states ''q'' and ''q' '' such that there exists a word ''w'' which leads both to ''q'' and to ''q' ''. The automaton is unambiguous if and only if there is no such a pair such that both states are accepting. There are ''Θ''(''n''2) state pairs, and for each pair there are ''m'' letters to consider to resume the fixpoint algorithm, hence the computation time.


Some properties

* Given a UFA ''A'' and an integer ''n'', one can count in polynomial time the number of words of size ''n'' that are accepted by ''A''. This can be done by a simple dynamic programming algorithm: for every state ''q'' of ''A'' and i\in \, compute the number of words of size ''n-i'' having a run starting at ''q'' and ending in a final state. By contrast, the same problem is #P-hard for NFAs. * The cartesian product (intersection) of two UFAs is a UFA. * The notion of unambiguity extends to
finite state transducer A finite-state transducer (FST) is a finite-state machine with two memory ''tapes'', following the terminology for Turing machines: an input tape and an output tape. This contrasts with an ordinary finite-state automaton, which has a single tape. ...
s and
weighted automata In theoretical computer science and formal language, formal language theory, a weighted automaton or weighted finite-state machine is a generalization of a finite-state machine in which the edges have Glossary of graph theory#weight, weights, fo ...
. If a finite state transducer ''T'' is unambiguous, then each input word is associated by ''T'' to at most one output word. If a weighted automaton ''A'' is unambiguous, then the set of weight does not need to be a
semiring In abstract algebra, a semiring is an algebraic structure. Semirings are a generalization of rings, dropping the requirement that each element must have an additive inverse. At the same time, semirings are a generalization of bounded distribu ...
, instead it suffices to consider a
monoid In abstract algebra, a monoid is a set equipped with an associative binary operation and an identity element. For example, the nonnegative integers with addition form a monoid, the identity element being . Monoids are semigroups with identity ...
. Indeed, there is at most one accepting path.


State complexity

Mathematical proofs that every UFA for a language needs a certain number of states were pioneered by Schmidt. Leung proved that a DFA equivalent to an n-state UFA requires 2^n states in the worst case, and that a UFA equivalent to a finitely ambiguousHaving finitely many accepting paths for every accepted word. n-state NFA requires 2^n-1 states in the worst case. Jirásek, Jirásková and Šebej researched state complexity of basic regular operations on languages represented by UFA. They proved in particular that for every n-state UFA where n \geq 7, the complement of the language it accepts is accepted by a UFA with at most 2^ states. This result was later improved by Indzhev and Kiefer to at most \sqrt \cdot 2^ states for all n \geq 0. Raskin showed that UFAs cannot be complemented in polynomial time, even into NFAs: he shows that, in the worst case, complementing a UFA with ''n'' states into an NFA requires a superpolynomial number of states. This lower bound was later improved by Göös, Kiefer, and Yuan. For a one-letter alphabet Okhotin proved that a DFA equivalent to an n-state UFA requires \exp\left(\Theta\left(\sqrt right)\right) states in the worst case.


Notes


References

* Christof Löding, ''Unambiguous Finite Automata'', ''Developments in Language Theory'', (2013) pp. 29–30
Slides
{{Formal languages and grammars Finite-state machines