Discrete choice: Difference between revisions

From formulasearchengine
Jump to navigation Jump to search
en>Black Yang
 
Line 1: Line 1:
I'm Yoshiko Oquendo. To keep birds is one of the issues he enjoys most. My home is now in Kansas. I am a production and distribution officer.<br><br>My page ... auto warranty ([http://maltarenting.com/ActivityFeed/MyProfile/tabid/60/userId/175295/Default.aspx more information])
In [[formal language]] theory, an '''unrestricted grammar''' is a [[formal grammar]] on which no restrictions are made on the left and right sides of the grammar's productions. This is the most general class of grammars in the [[Chomsky–Schützenberger hierarchy]], and can generate arbitrary [[recursively enumerable language]]s.
 
== Formal definition ==
 
An '''unrestricted grammar''' is a [[formal grammar]] <math>G = (N, \Sigma, P, S)</math>, where <math>N</math> is a set of nonterminal symbols, <math>\Sigma</math> is a set of [[terminal symbol]]s, <math>N</math> and <math>\Sigma</math> are disjoint (actually, this is not strictly necessary, because unrestricted grammars make no real distinction between nonterminal and terminal symbols, the designation exists purely so that one knows when to stop when trying to generate [[formal grammar#sentential-form|sentential form]]s of the grammar), <math>P</math> is a set of production rules of the form <math>\alpha \to \beta</math> where <math>\alpha</math> and <math>\beta</math> are strings of symbols in <math>N \cup \Sigma</math> and <math>\alpha</math> is not the empty string, and <math>S \in N</math> is a specially designated start symbol. As the name implies, there are no real restrictions on the types of production rules that unrestricted grammars can have.
 
== Unrestricted grammars and Turing machines ==
 
It may be shown that unrestricted grammars characterize the recursively enumerable languages. This is the same as saying that for every unrestricted grammar <math>G</math> there exists some [[Turing machine]] capable of recognizing <math>L(G)</math> and vice-versa.  Given an unrestricted grammar, such a Turing machine is simple enough to construct, as a two-tape [[nondeterministic Turing machine]].  The first tape contains the input word <math>w</math> to be tested, and the second tape is used by the machine to generate sentential forms from <math>G</math>.  The Turing machine then does the following:
 
# Start at the left of the second tape and repeatedly choose to move right or select the current position on the tape.
# [[Nondeterminism|Nondeterministically]] choose a production <math>\beta \to \gamma</math> from the productions in <math>G</math>.
# If <math>\beta</math> appears at some position on the second tape, replace <math>\beta</math> by <math>\gamma</math> at that point, possibly shifting the symbols on the tape left or right depending on the relative lengths of <math>\beta</math> and <math>\gamma</math> (e.g. if <math>\beta</math> is longer than <math>\gamma</math>, shift the tape symbols left).
# Compare the resulting sentential form on tape 2 to the word on tape 1. If they match, then the Turing machine accepts the word.  If they don't go back to step 1.
 
It is easy to see that this Turing machine will generate all and only the sentential forms of <math>G</math> on its second tape after the last step is executed an arbitrary number of times, thus the language <math>L(G)</math> must be recursively enumerable.
 
The reverse construction is also possible.  Given some Turing machine, it is possible to create an unrestricted grammar.
 
== Computational properties ==
 
The [[decision problem]] of whether a given string <math>s</math> can be generated by a given unrestricted grammar is equivalent to the problem of whether it can be accepted by the Turing machine equivalent to the grammar. The latter problem is called the [[Halting problem]] and is undecidable.
 
The equivalence of unrestricted grammars to Turing machines implies the existence of a universal unrestricted grammar, a grammar capable of accepting any other unrestricted grammar's language given a description of the language. For this reason, it is theoretically possible to build a [[programming language]] based on unrestricted grammars (e.g. [[Thue (programming language)|Thue]]).
 
==See also==
* [[Turing machine]]
* [[Lambda calculus]]
* [[String rewriting]]
 
== References ==
{{refbegin}}
* {{cite book |last1=Hopcroft |first1=John |authorlink=John Hopcroft |last2=Ullman |first2=Jeffrey D. |authorlink2=Jeffrey Ullman |year=1979 |title=[[Introduction to Automata Theory, Languages, and Computation]] |publisher=Addison-Wesley |edition=1st | isbn=0-201-44124-1}}
{{refend}}
 
{{Formal languages and grammars}}
 
[[Category:Formal languages]]

Revision as of 20:41, 5 January 2014

In formal language theory, an unrestricted grammar is a formal grammar on which no restrictions are made on the left and right sides of the grammar's productions. This is the most general class of grammars in the Chomsky–Schützenberger hierarchy, and can generate arbitrary recursively enumerable languages.

Formal definition

An unrestricted grammar is a formal grammar , where is a set of nonterminal symbols, is a set of terminal symbols, and are disjoint (actually, this is not strictly necessary, because unrestricted grammars make no real distinction between nonterminal and terminal symbols, the designation exists purely so that one knows when to stop when trying to generate sentential forms of the grammar), is a set of production rules of the form where and are strings of symbols in and is not the empty string, and is a specially designated start symbol. As the name implies, there are no real restrictions on the types of production rules that unrestricted grammars can have.

Unrestricted grammars and Turing machines

It may be shown that unrestricted grammars characterize the recursively enumerable languages. This is the same as saying that for every unrestricted grammar there exists some Turing machine capable of recognizing and vice-versa. Given an unrestricted grammar, such a Turing machine is simple enough to construct, as a two-tape nondeterministic Turing machine. The first tape contains the input word to be tested, and the second tape is used by the machine to generate sentential forms from . The Turing machine then does the following:

  1. Start at the left of the second tape and repeatedly choose to move right or select the current position on the tape.
  2. Nondeterministically choose a production from the productions in .
  3. If appears at some position on the second tape, replace by at that point, possibly shifting the symbols on the tape left or right depending on the relative lengths of and (e.g. if is longer than , shift the tape symbols left).
  4. Compare the resulting sentential form on tape 2 to the word on tape 1. If they match, then the Turing machine accepts the word. If they don't go back to step 1.

It is easy to see that this Turing machine will generate all and only the sentential forms of on its second tape after the last step is executed an arbitrary number of times, thus the language must be recursively enumerable.

The reverse construction is also possible. Given some Turing machine, it is possible to create an unrestricted grammar.

Computational properties

The decision problem of whether a given string can be generated by a given unrestricted grammar is equivalent to the problem of whether it can be accepted by the Turing machine equivalent to the grammar. The latter problem is called the Halting problem and is undecidable.

The equivalence of unrestricted grammars to Turing machines implies the existence of a universal unrestricted grammar, a grammar capable of accepting any other unrestricted grammar's language given a description of the language. For this reason, it is theoretically possible to build a programming language based on unrestricted grammars (e.g. Thue).

See also

References

Template:Refbegin

  • 20 year-old Real Estate Agent Rusty from Saint-Paul, has hobbies and interests which includes monopoly, property developers in singapore and poker. Will soon undertake a contiki trip that may include going to the Lower Valley of the Omo.

    My blog: http://www.primaboinca.com/view_profile.php?userid=5889534

Template:Refend

Other Sports Official Alfonzo from Chase, has hobbies and interests for instance fast, property developers in new industrial launch singapore and aquariums. In recent times has visited Monasteries of Haghpat and Sanahin.