Unambiguous finite automaton

From testwiki
Revision as of 20:44, 29 July 2024 by imported>Citation bot (Added doi-access. Removed URL that duplicated identifier. | Use this bot. Report bugs. | Suggested by Headbomb | Linked from Wikipedia:WikiProject_Academic_Journals/Journals_cited_by_Wikipedia/Sandbox2 | #UCB_webform_linked 138/188)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

In automata theory, an unambiguous finite automaton (UFA) is a nondeterministic finite automaton (NFA) such that each word has at most one accepting path. Each deterministic finite automaton (DFA) is an UFA, but not vice versa. DFA, UFA, and NFA recognize exactly the same class of formal languages. 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 ATemplate:Prime 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,Σ,Δ,q0,F). An UFA is an NFA such that, for each word w=a1a2...an, there exists at most one sequence of states r0,r1,...,rn, in Q with the following conditions:

  1. r0=q0;
  2. ri+1Δ(ri,ai+1) for i=0,...n1;
  3. rnF.

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 {a,b} whose nth last letter is an a. The figures show a DFA and a UFA accepting this language for n=2.

Deterministic automaton (DFA) for the language L for n=2
Unambiguous finite automaton (UFA) for the language L for n=2

The minimal DFA accepting L has 2n states, one for each subset of {1...n}. There is an UFA of n+1 states which accepts L: it guesses the nth last letter, and then verifies that only n1 letters remain. It is indeed unambiguous as there exists only one nth last letter.

Inclusion, universality, equivalence

Three PSPACE-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. Template:Collapse top 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(AB)=L(A), where AB denotes the Cartesian product automaton, which can be proven to be also unambiguous. Now, L(AB) is a subset of L(A) by construction; hence both sets are equal if and only if for each length n, the number of words of length n in L(AB) 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.[1] Template:Collapse bottom

Universality, equivalence

The problem of universality[note 1] and of equivalence,[note 2] 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(n2m) whether A is unambiguous.[2] Template:Collapse top 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 Θ(n2) state pairs, and for each pair there are m letters to consider to resume the fixpoint algorithm, hence the computation time. Template:Collapse bottom

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{0,,n}, 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.[3]
  • The notion of unambiguity extends to finite state transducers and weighted automata. 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, instead it suffices to consider a monoid. Indeed, there is at most one accepting path.

State complexity

Template:Main article

Mathematical proofs that every UFA for a language needs a certain number of states were pioneered by Schmidt.[4] Leung proved that a DFA equivalent to an n-state UFA requires 2n states in the worst case, and that a UFA equivalent to a finitely ambiguous[note 3] n-state NFA requires 2n1 states in the worst case.[5]

Jirásek, Jirásková and Šebej[6] researched state complexity of basic regular operations on languages represented by UFA. They proved in particular that for every n-state UFA where n7, the complement of the language it accepts is accepted by a UFA with at most 20.79n+logn states. This result was later improved by Indzhev and Kiefer[7] to at most n+120.5n states for all n0.

Raskin[8] 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.[9]

For a one-letter alphabet Okhotin proved that a DFA equivalent to an n-state UFA requires exp(Θ(n(lnn)23)) states in the worst case.[10]

Notes

Template:Reflist

References

  • Christof Löding, Unambiguous Finite Automata, Developments in Language Theory, (2013) pp. 29–30 (Slides)

Template:Reflist

Template:Formal languages and grammars

  1. Christof Löding, Unambiguous Finite Automata, Slide 8
  2. Template:Cite book
  3. Christof Löding, Unambiguous Finite Automata, Slide 8
  4. Template:Cite thesis
  5. Template:Cite journal
  6. Template:Cite book
  7. Template:Cite arXiv
  8. Template:Cite journal
  9. Template:Cite journal
  10. Template:Cite journal


Cite error: <ref> tags exist for a group named "note", but no corresponding <references group="note"/> tag was found