Myhill-Nerode's theorem

from Wikipedia, the free encyclopedia

The Myhill-Nerode are in field formal languages of theoretical computer science , a necessary and sufficient criterion for that a formal language regularly is. It was presented and proven in 1957/1958 by John Myhill and Anil Nerode .

In colloquial terms, the sentence is mainly used to find out whether a formal language is so "benign" or "simply knitted" that a computer with constant memory (ie with finite memory, the size of which does not depend on the input) can automatically determine whether a character string is a word of the language or not.

sentence

Note: The following technical terms are explained in the article Formal Language .

A formal language above the alphabet and the associated Nerode relation are given . Then:

There is a deterministic finite automaton that accepts if and only if the index of the associated Nerode relation is finite.

Formally:

where is a deterministic finite automaton and the language it accepts.

application

The existence of a deterministic finite automaton that accepts is a necessary and sufficient criterion for being a regular language. The sentence can be used both to show that a formal language is regular and to show that it is not. Since this is the most important application of Myhill-Nerode's theorem, it is often read like this:

The language is regular if and only if the index of the associated Nerode relation is finite.

It can further be concluded that the number of states of a minimal deterministic finite automaton that accepts corresponds to the index of the associated Nerode relation.

More precisely: Let be a system of representatives of , then is the (unique) minimal, deterministic automaton that accepts, where

  • The states correspond to the equivalence classes
  • The start state corresponds to the equivalence class in which the empty word is located
  • Final states correspond to the equivalence classes of the words that lie in (conversely, it decays exactly into the equivalence classes that lie in, i.e. )
  • for all

This relationship also applies to non-regular languages. There it is not finite, which means that (due to the minimality of ) there is no DEA for .

Another application is that with the help of the theorem it can be proven that (independent of the P-NP problem ) there is no polynomial time algorithm that constructs an equivalent DEA from an NEA. There are languages ​​that are recognized by an NEA with states, but which have Myhill-Nerode equivalence classes.

An example of this is the language. If two words are of different length , then they differ in one position . So exactly one of the words and is in and it applies .

So the output can be exponentially larger than the input and so no Turing machine can calculate the output in less than exponential time. There is therefore no better algorithm for this problem than the power set construction .

Examples

Finite languages ​​are regular

The language above the alphabet contains a finite number of words. (All words from have finite length.) That is, there exist natural numbers and , so that:

  • .

Since there are as many prefixes for every word as there are letters and the empty word also counts as a prefix, the language has at most prefixes and as many equivalence classes. The following applies:

.

That is, the number of equivalence classes is finite, and it follows from Myhill-Nerode's theorem that the language is regular. So you can say: every language that contains a finite number of words is regular.

The language { ε , a , aa , aaa , ...} is regular

A minimal deterministic finite automaton that accepts language .

The language above the alphabet is defined by:

.

There is exactly one equivalence class with regard to the Nerode relation, namely itself:

.

This means that all prefixes of the language can be supplemented with the same suffixes for words . So the index of the Nerode relation is finite:

.

Finally, it follows from Myhill-Nerode's theorem that the language is regular.

The language { ab , aabb , aaabbb , ...} is not regular

Section of a non-finite, deterministic automaton that accepts the formal language L. Each of the infinitely many words from L needs its own path to the final state, so the automaton would have to be infinitely large.

The language above the alphabet is defined by:

.

In particular, the following equivalence classes result with regard to the Nerode relation (each prefix of a word in this language allows only one suffix for completion):

These equivalence classes differ in pairs , that is, the following applies:

.

From this it follows that the number of these equivalence classes is already infinite and - since the number of all equivalence classes is even larger - the index of the Nerode relation is also infinite. Finally, it follows from Myhill-Nerode's theorem that the language is not regular.

comment

It is not necessary to fully explain the class structure of the equivalence relation assigned to a language in order to show the non-regularity of this language. Otherwise, further equivalence classes would have to be set up in order to meet the requirement of equivalence relations, to completely subdivide a certain basic set (here :, i.e. all words above the input alphabet ) into disjoint equivalence classes.

The suffixes

In principle, any word above the input alphabet can be used as a suffix , e.g. B. etc. Here only the single suffix was given for each equivalence class, for which, when it is added to the elements of the respective class, all words created in this way belong to the language . For any other suffix, any resulting words would not belong to the language . The Nerode relation is based on this .

See also

literature

  • Uwe Schöning : Theoretical Computer Science - in a nutshell . 5th edition. Spektrum, Heidelberg 2008, ISBN 978-3-8274-1824-1 , ( HochschulTaschenbuch ), pp. 34-38.
  • A. Nerode: Linear automaton transformations . In: Proceedings of the American Mathematical Society 9, 1958, ISSN  0002-9939 , pp. 541-544.
  • J. Myhill: Finite automata and the representation of events . In: WADD TR 57-624, 1957, ZDB -ID 2518731-4 , pp. 112-137.