Non-deterministic finite automaton
Contents
[hide]Definition: Relative to DFAs
NFAs have an almost-identical to to that of a DFA the only difference is in the "transition function", which in DFAs is of the form δDFA:Q×Σ→Q - ordered pairs of a state and a letter of the alphabet the machine is over which are mapped to other states - is instead of the form δNFA:Q×Σ→P(Q), which is to say it maps pairs of a state and an symbol of the input alphabet to a set of states instead.
Definition
A non-deterministic-finite-automaton is a tuple of 4-items, A, for:
- A:=(Q,Σ,δ,q0) where
- Q is a finite set of states - just as in a DFA
- Σ is the alphabet of the NFA, a finite set of symbols which appear in "strings" - just as in a DFA
- δ:Q×Σ→P(Q) is called the "transition function"
- This is differs from DFAs as described above, notice it maps (state,symbol) to a set of states, this is the "non-deterministic" part.
- Also, unlike a DFA, δ may map to the empty set, ∅, any states which may trap an NFA is called a "dead configuration"[1]
- q0∈Q - the "initial state" or "starting state" of the automaton
- In an "acceptor" type - as with a DFA - there's an addition item, F, with F⊆Q, the "final" or "accepting" states.
There are two "defined" types of automaton, of which NFA is a kind, just as for DFAs:
NFAs are rarely encountered "in practice" (I've never seen code to actually run an NFA, just code to turn it into a DFA), so it doesn't really right discussing these types.
A discussion can be found on the DFA's page "definition" section - I defer to that here.
We discuss only "acceptor type" below as information on accepting states is used when transforming an NFA acceptor into a DFA "acceptor".
Non-deterministic finite acceptor automaton
As with DFAs, it's either a 5-tuple:
- A:=(Q,Σ,δ,q0,F) (or perhaps an ordered pair, A:=(A′,F) for A′ an NFA as defined above) with the terms exactly as above except for an additional item:
- F⊆Q which is a set of "accepting" states or "final states".
Notes
References
- Jump up ↑ Like with this page: Formal Languages and Automata, Fourth edition, Peter Linz