Deterministic finite automaton

from Wikipedia, the free encyclopedia

A deterministic finite automaton ( DEA ; English deterministic finite state machine or deterministic finite automaton , DFA ) is a finite automaton that by entering a character of its input alphabet (the possible inputs) from a state in which it is located to a uniquely determined The next state changes. From each (final) state there must be a transition to a subsequent state for each character of the input alphabet . In this it differs from nondeterministic finite automata , whose state change does not always have to occur deterministically .

definition

Automat

Formally, a DEA can be defined as a quintuple (5-tuple) . The following applies here:

  • is a finite set of states . Other symbols often used for are or .
  • is the finite input alphabet , i.e. the set of allowed input symbols.
  • is the transition function (or transition function ). It assigns a successor state to each pair consisting of a state and an input symbol .
  • is the start state (also initial state or initial state ).
  • is the set of accepting states, the so-called final states (or final states ). Another common symbol for is .

behavior

If the machine is in one state and reads the input symbol , it changes to a new state that is specified by the transition function, i.e. into the state .

If the machine has not yet read an input symbol, it is in the start state . If the machine receives a sequence of input symbols as input, called a word in theoretical computer science , it reads one symbol after the other from left to right and changes the state according to the transition function. If the machine is in an accepting state after reading the last input symbol , it accepts the input. One then says that the input word is in the set of words that are accepted by the automaton (in short: the language accepted by the automaton, see below).

Discarded entries

If the machine ends in a non-accepting state after reading an input word, the input is considered rejected. If the question of whether the input is rejected or accepted is not cleared up with the last input symbol, a minimal machine is prematurely in a state that it no longer leaves.

Language of a DEA

The set of all words accepted by the DEA is called the language of . The set of all languages ​​accepted by any DEA is the regular language class .

Nondeterministic finite automata (NEA), DEA, and type 3 grammars (in the Chomsky hierarchy ) describe the same language class. NEA can be converted into equivalent DEA using power set construction .

Examples

Drinks machine

A deterministic finite machine that simulates the simple processes of a drinks machine can consist of the states that describe the following states of the drinks machine: "drinks machine waiting for a coin to be inserted", "drinks machine waiting for a drink to be selected" and "drink being served".

Valid input symbols could use the amount to describe the insertion of a coin, the selection of a drink, the cancellation of the drink selection and the removal of a drink.

An automaton with the transitions

  • ,
  • ,
  • and

then describes that payment is first made with a coin, then a drink is selected, which has to be removed before the user can start again. If you have inserted the coin but not yet selected a drink, you can also cancel.

If a complete function is required for the transitions, a state must be specified, among other things, into which the machine changes when it is canceled if a drink has already been selected but not yet removed.

Regular expression

The regular expression can be represented as the following DEA:

  • State quantity
  • Input alphabet
  • partial transition function with
  • Final states

Minimization

For each DEA ​​there is a unique minimal automaton (apart from the naming of the states) that accepts the same language.

Since the states of the minimal automaton correspond to the equivalence classes of the language accepted by the finite automaton under the Nerode relation , one also speaks of the equivalence class automaton :

Let be a deterministic finite automaton. Then is with

the equivalence class automaton too .

The minimization of a deterministic automaton can be solved algorithmically by continually refining the equivalence classes. You start with the state sets and . For each letter from the alphabet, each set of states is now divided in such a way that the transfer function maps the states of each new set of the letter into a unique set. This is repeated until there is no more change.

There is also the possibility of constructing minimal deterministic finite automata incrementally. Incremental here means that the words to be accepted are added individually to the machine. Every time such a word is inserted, the deterministic finite automaton is minimal. This method is particularly promising if the words often share common prefixes and suffixes, e.g. This is the case, for example, with words from natural languages.

See also

literature

Web links

  • Automaton Simulator - a web-based, graphical editor and simulator (English)

Individual evidence

  1. ^ Hans Werner Lang, Hochschule Flensburg: Construction of a deterministic finite automaton. Retrieved September 9, 2018 .