<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.conservapedia.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=RolandPlankton</id>
	<title>Conservapedia - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://www.conservapedia.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=RolandPlankton"/>
	<link rel="alternate" type="text/html" href="https://www.conservapedia.com/Special:Contributions/RolandPlankton"/>
	<updated>2026-10-23T22:37:49Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.35.14</generator>
	<entry>
		<id>https://www.conservapedia.com/index.php?title=Context-free_grammar&amp;diff=981602</id>
		<title>Context-free grammar</title>
		<link rel="alternate" type="text/html" href="https://www.conservapedia.com/index.php?title=Context-free_grammar&amp;diff=981602"/>
		<updated>2012-05-15T22:05:52Z</updated>

		<summary type="html">&lt;p&gt;RolandPlankton: provide formal definition and example&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;:''An equivalent grammar [[Backus-Naur Form]] is often used for describing the syntax/grammar of programming languages.''&lt;br /&gt;
&lt;br /&gt;
A '''context-free grammar''' is a formal grammatical system for describing a particular class of language. The basic idea of such a grammar is to provide a set of rules which can be used to generate all possible grammatical 'sentences'; these rules must also avoid generating any ungrammatical sentences. A context-free grammar is not powerful enough to describe a natural language such as [[English]], but it is powerful enough to describe nearly all [[programming language]]s.&lt;br /&gt;
&lt;br /&gt;
A context-free grammar is the level 2 grammar in the [[Chomsky hierarchy]] and was first described in 1956 by the linguist [[Noam Chomsky|Chomsky]].&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite journal &lt;br /&gt;
| title = Three models for the description of language &lt;br /&gt;
| year = 1956 &lt;br /&gt;
| last = Chomsky &lt;br /&gt;
| first = Noam &lt;br /&gt;
| journal = IRE Transactions on Information Theory &lt;br /&gt;
| volume = 2 &lt;br /&gt;
| pages = 113–124 &lt;br /&gt;
| url = http://www.chomsky.info/articles/195609--.pdf &lt;br /&gt;
| accessdate = 2012-04-08&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example of a very simple context-free grammar==&lt;br /&gt;
This very simple example can handle only a tiny subset of English and should not be taken seriously as a guide to English grammar or vocabulary. It is based on an example by David Crystal&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite book &lt;br /&gt;
| last = Crystal &lt;br /&gt;
| first = David  &lt;br /&gt;
| title = The Cambridge Encyclopedia of Language &lt;br /&gt;
| publisher = Cambridge University Press &lt;br /&gt;
| year = 1987 &lt;br /&gt;
| isbn = 0-521-42443-7&lt;br /&gt;
| pages = page 97&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; and is a slight extension of an example on slide 9 of this lecture.&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.cs.princeton.edu/~rywang/99f126/slides/16th.pdf&lt;br /&gt;
| title = Lecture notes: Formal Languages&lt;br /&gt;
| accessdate = 2012-04-07}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase''         # A ''Sentence'' consists of a ''NounPhrase'' followed by a ''VerbPhrase''&lt;br /&gt;
 ''NounPhrase'' -&amp;gt;  ''Determiner'' ''Noun''               # A ''NounPhrase'' consists of a ''Determiner'' followed by a ''Noun''&lt;br /&gt;
 ''VerbPhrase'' -&amp;gt;  ''Verb'' ''NounPhrase''               # A ''VerbPhrase'' consists of a ''Verb'' followed by a ''NounPhrase''&lt;br /&gt;
 ''Determiner'' -&amp;gt;  '''a''', '''the'''                        # A ''Determiner''  is one of: '''a''' or '''the'''&lt;br /&gt;
 ''Noun''       -&amp;gt;  '''boy''', '''girl''', '''dog'''                # A ''Noun'' is one of: '''boy''' or '''girl''' or '''dog'''  &lt;br /&gt;
 ''Verb''       -&amp;gt;  '''chased''', '''heard''', '''saw'''            # A ''Verb'' is one of: '''chased''' or '''heard''' or '''saw'''&lt;br /&gt;
&lt;br /&gt;
Notation used above: &lt;br /&gt;
:The symbol &amp;quot;-&amp;gt;&amp;quot; means &amp;quot;can be replaced by&amp;quot;.  &lt;br /&gt;
:When there are several items on the right hand side separated by commas, just one of these items can be selected. &lt;br /&gt;
:The comments preceded by &amp;quot;#&amp;quot; are not part of the generative grammar, but hopefully will help folks understand the example a little better.&lt;br /&gt;
&lt;br /&gt;
By making appropriate substitutions we can generate such sentences as:&lt;br /&gt;
:The dog chased a girl.&lt;br /&gt;
:The girl heard the dog.&lt;br /&gt;
:The boy saw a girl.&lt;br /&gt;
&lt;br /&gt;
The stages in the generation of these examples are as follows:&lt;br /&gt;
:''Sentence''&lt;br /&gt;
:-&amp;gt; ''NounPhrase'' ''VerbPhrase''&lt;br /&gt;
:-&amp;gt; ''Determiner'' ''Noun'' ''Verb'' ''NounPhrase''&lt;br /&gt;
:-&amp;gt; ''Determiner'' ''Noun'' ''Verb'' ''Determiner'' ''Noun''&lt;br /&gt;
&lt;br /&gt;
By appropriate selection of words to substitute for ''Determiner'', ''Noun'', and ''Verb'' we can produce the 3 example sentences above.&lt;br /&gt;
&lt;br /&gt;
The simple grammar defines a few words which can be substituted for ''Determiner'', ''Noun'', and ''Verb''. There are two possibilities for ''Determiner'', three for ''Noun'', and three for ''Verb'', with both ''Determiner'' and ''Noun'' appearing twice in the expansion. Hence the total number of grammatical sentences which can be generated by this simple grammar is 108 (= 2 * 3 * 3 * 2 * 3). In this particular case the possible words have been carefully chosen so that all of these 108 sentences also actually mean something.&lt;br /&gt;
&lt;br /&gt;
Note that the use of ''italics'' and '''boldface''' in this example is merely a convenient way of indicating the difference between items which can be expanded further (e.g. concepts such as ''NounPhrase'') and items which can not be expanded further (e.g. words such as '''girl'''). In the linguistic literature, items which can be expanded further are referred to as 'non-terminal' items, while items which can't be expanded further are known as 'terminal' items.&lt;br /&gt;
&lt;br /&gt;
The 'comma' notation for alternatives is a form of shorthand. In some formulations this would be shown as several separate rules, so that:&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''a''', '''the''' &lt;br /&gt;
could be shown as two rules:&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''a'''&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''the'''&lt;br /&gt;
&lt;br /&gt;
==Caution==&lt;br /&gt;
While a generative grammar may produce sentences which are grammatically correct, there is no certainty that such sentences will actually mean anything. The classic example of such a meaningless sentence is from Chomsky's book&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite book &lt;br /&gt;
| last = Chomsky &lt;br /&gt;
| first = Noam &lt;br /&gt;
| title = Syntactic Structures &lt;br /&gt;
| year = 1957 &lt;br /&gt;
| publisher = Mouton &lt;br /&gt;
| location = The Hague/Paris &lt;br /&gt;
| pages = page 15 &lt;br /&gt;
| isbn = 3-11-017279-8&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; with the grammatically correct sentence:&lt;br /&gt;
&lt;br /&gt;
:&amp;quot;Colorless green ideas sleep furiously.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
:This example illustrates the difference between grammar/syntax and meaning/semantics.&lt;br /&gt;
&lt;br /&gt;
Another problem when analysing a sentence is that many English words have multiple meanings, so that there may be more than one way to interpret a sentence. A simple example is the sentence: &lt;br /&gt;
:&amp;quot;Time flies.&amp;quot; &lt;br /&gt;
:Is this an instruction to check how fast flies are flying, or an indication that time appears to be passing quickly? &lt;br /&gt;
:A varied and entertaining selection of such ambiguities has been compiled by Jeff Gray.&amp;lt;ref&amp;gt;{{Cite web &lt;br /&gt;
| title = Collection of Ambiguous or Inconsistent/Incomplete Statements  &lt;br /&gt;
| url = http://www.gray-area.org/Research/Ambig/ &lt;br /&gt;
| author = Jeff Gray&lt;br /&gt;
| accessdate = 2012-04-10&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Formal grammar==&lt;br /&gt;
'''Note''': this section and subsequent sections are, by necessity, slightly more technical/formal than the earlier parts of this article, though specialist notation and abbreviations have been largely avoided. Make sure that you understand the 'Simple example' above before proceeding further, since references will be made to that example to help explain the technicalities, and variations on that example will be used to illustrate new ideas. &lt;br /&gt;
&lt;br /&gt;
A formal generative grammar has four components (as described in slide 19 of this lecture&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://adammikeal.org/courses/compute/Chomsky%20Presentation.pdf&lt;br /&gt;
| title = The Chomsky Hierarchy&lt;br /&gt;
| accessdate = 2012-04-06&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
):&lt;br /&gt;
# a finite number of non-terminal concepts (e.g. ''VerbPhrase'' in the example, or anything else in ''italics''),&lt;br /&gt;
# a finite number of terminal items (e.g. '''girl''' in the example, or anything else in '''bold-face''').&lt;br /&gt;
# a finite set of rules for transforming non-terminal items (e.g. the example has 6 rules).&lt;br /&gt;
# a single starting point (e.g. ''Sentence'' in the example).&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
:Terminal items are those which can not be transformed into anything else.&lt;br /&gt;
:A list of all the terminal items is effectively the vocabulary from which sentences are built.&lt;br /&gt;
:Non-terminal items are those which can be transformed into something else.&lt;br /&gt;
:Linguists have developed various classes of grammars by using constraints to govern what sort of rules can be used for any particular grammar. The constraints for context-free grammars are detailed in a later section.&lt;br /&gt;
&lt;br /&gt;
===Changing the rules===&lt;br /&gt;
An relatively small change to even a single rule can make a large change in the language which can be generated. For example, change the first rule in the simple example to read:&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''NounPhrase'' ''VerbPhrase'' '''and''' ''NounPhrase'' ''VerbPhrase''&lt;br /&gt;
This means that a ''Sentence'' is either a ''NounPhrase'' followed by a ''VerbPhrase'' or a ''NounPhrase'' followed by a ''VerbPhrase'' followed by '''and''' followed by a ''NounPhrase'' followed by a ''VerbPhrase''. In addition to the shorter sentences already discussed, this could also generate a sentence such as: &amp;quot;A dog saw a girl and the dog chased the girl&amp;quot;. The total number of grammatically-correct sentences which can be generated by this modified grammar is now 11,772 (108 + 108*108), though some of these may not be very meaingful.&lt;br /&gt;
&lt;br /&gt;
===Towards infinity===&lt;br /&gt;
A significantly different rule change can have an astounding effect. Consider changing the first rule to read:&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''NounPhrase'' ''VerbPhrase'' '''and''' ''Sentence''&lt;br /&gt;
This can generate a potentially infinite number of sentences (any number of these five-word sentences linked by '''and'''). This is an example of what is known as a [[Recursion|recursive]] definition, whereby a ''Sentence'' is partially defined in terms of itself. In such a recursive rule there must be at least one transformation option which does not involve ''Sentence'', otherwise the transformation could never stop.&lt;br /&gt;
&lt;br /&gt;
The above change is known as right-recursive; a left-recursive formulation is also possible, and can in this example generate exactly the same sentences. As shown below  under 'Context-free grammar', there are situations where the choice of left- or right-recursive formulations can change the meaning. &lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''Sentence'' '''and''' ''NounPhrase'' ''VerbPhrase'' &lt;br /&gt;
&lt;br /&gt;
The distinction between left- and right-recursive grammars becomes important when trying to parse/analyse a sentence; some types of parser work best with left-recursive grammars, while other types work best with right-recursive grammars. This distinction is particularly relevant in connection with [[compiler|compiling or translating]] a program written in some high-level [[programming language]] so that it can be used on a [[computer]].&lt;br /&gt;
&lt;br /&gt;
The use of left-recursive or right-recursive rules may also affect the meaning, as shown in the 'arithmetic expression' example below.&lt;br /&gt;
&lt;br /&gt;
===Constraints for a context-free grammar===&lt;br /&gt;
The transformation rules for context-free grammars are fairly simple: &lt;br /&gt;
*Only a single non-terminal item can appear on the left-hand side of a rule.&lt;br /&gt;
*The right-hand side of any rule must be one of:&lt;br /&gt;
**[nothing].&lt;br /&gt;
**any combination of terminal items and non-terminal items.&lt;br /&gt;
&lt;br /&gt;
In the linguistic literature, [nothing] is often represented by the symbol '''ε'''.&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
===Arithmetic expressions===&lt;br /&gt;
The following example shows how context-free grammars can cope with arithmetic expressions involving possibly nested brackets. Also an expression such as &amp;quot;2 + 3 * 4&amp;quot; could be interpreted as either &amp;quot;(2 + 3) * 4&amp;quot; = 20 or as &amp;quot;2 + (3 * 4)&amp;quot; = 14. The latter interpretation is that which is normally used - multiplication &amp;quot;*&amp;quot; is said to have a higher priority than addition &amp;quot;+&amp;quot; - so the grammar must incorporate this priority concept. Furthermore, consecutive operators of the same priority are normally applied from left to right, so that &amp;quot;8 - 2 + 3&amp;quot; is interpreted as &amp;quot;(8 - 2) + 3&amp;quot; = 9, rather than as &amp;quot;8 - (2 + 3)&amp;quot; = 3.  This ordering must also be built in to the grammar.&lt;br /&gt;
&lt;br /&gt;
To avoid distracting side-issues, this example only deals with numbers which consist solely of a single digit. The example is a simplified version of the definition of an arithmetic expression given in the Revised Algol 60 Report (Section 3.3.1).&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.masswerk.at/algol60/report.htm&lt;br /&gt;
| title = Revised Report on the Algorithmic Language Algol 60&lt;br /&gt;
| accessdate = 2012-04-22&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ''Expression'' -&amp;gt; ''Term''                        # an ''Expression'' is either a ''Term''&lt;br /&gt;
 ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''    #   or an ''Expression'' followed by '''+''' or '''-''' followed by a ''Term''&lt;br /&gt;
                                           #&lt;br /&gt;
 ''Term''       -&amp;gt; ''Primary''                     # a ''Term'' is either a ''Primary''&lt;br /&gt;
 ''Term''       -&amp;gt; ''Term'' ''MulDivOp'' ''Primary''       #   or a ''Term'' followed by '''*''' or '''/''' followed by a ''Primary''&lt;br /&gt;
                                           #&lt;br /&gt;
 ''Primary''    -&amp;gt; ''Number''                      # a ''Primary'' is either a ''Number''&lt;br /&gt;
 ''Primary''    -&amp;gt; '''(''' ''Expression'' ''')'''              #   or an ''Expression'' enclosed in brackets&lt;br /&gt;
                                           #&lt;br /&gt;
 ''MulDivOp''   -&amp;gt; '''*'''. '''/'''                        # multiplication and division have the same priority&lt;br /&gt;
 ''AddSubOp''   -&amp;gt; '''+'''. '''-'''                        # addition and subtraction have the same priority&lt;br /&gt;
 ''Number''     -&amp;gt; '''0''', '''1''', ... '''9'''                 # this simple-minded definition of a ''Number'' is enough for this example&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
* Both ''Expression'' and ''Term'' are each defined via a left-recursive rule; this ensures that operators of the same priority are applied from left to right.&lt;br /&gt;
* The distinction between ''Expression'' and ''Term'' ensures that multiplication/division are applied before addition/subtraction.&lt;br /&gt;
* ''Expression'' is indirectly recursive via ''Term'' and ''Primary'' to allow bracketed sub-expressions to any depth.&lt;br /&gt;
&lt;br /&gt;
Application 1: generate 2 + 3 * 4&lt;br /&gt;
&lt;br /&gt;
  ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Term'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Primary'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' ''Term''                                 # '''+''' can not be applied until ''Term'' has been evaluated&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' ''Term'' ''MulDivOp'' ''Primary''&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' ''Primary'' ''MulDipOp'' ''Primary''&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' '''3''' '''*''' '''4'''&lt;br /&gt;
&lt;br /&gt;
Application 2: generate 2 * 3 + 4&lt;br /&gt;
&lt;br /&gt;
  ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Term'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Term'' ''MulDivOp'' ''Primary'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Primary'' ''MulDivOp'' ''Primary'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; '''2''' '''*''' '''3''' ''AddSubOp'' ''Term''                      # ''Term'' to left of ''AddSubOp'' is evaluated first&lt;br /&gt;
             -&amp;gt; '''2''' '''*''' '''3''' ''AddSubOp'' ''Primary''  &lt;br /&gt;
             -&amp;gt; '''2''' '''*''' '''3''' '''+''' '''4'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
{{reflist}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[category:linguistics]]&lt;br /&gt;
[[Category:Computer Science]]&lt;/div&gt;</summary>
		<author><name>RolandPlankton</name></author>
	</entry>
	<entry>
		<id>https://www.conservapedia.com/index.php?title=Context-free_grammar&amp;diff=981371</id>
		<title>Context-free grammar</title>
		<link rel="alternate" type="text/html" href="https://www.conservapedia.com/index.php?title=Context-free_grammar&amp;diff=981371"/>
		<updated>2012-05-14T20:07:34Z</updated>

		<summary type="html">&lt;p&gt;RolandPlankton: start making this article more accessible&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;:''An equivalent grammar [[Backus-Naur Form]] is often used for describing the syntax/grammar of programming languages.''&lt;br /&gt;
&lt;br /&gt;
A '''context-free grammar''' is a formal grammatical system for describing a particular class of language. The basic idea of such a generative grammar is to provide a set of rules which can be used to generate all possible grammatical 'sentences'; these rules must also avoid generating any ungrammatical sentences. A context-free grammar is not powerful enough to describe a natural language such as [[English]], but it is powerful enough to describe nearly all [[programming language]]s.&lt;br /&gt;
&lt;br /&gt;
A context-free grammar is the level 2 grammar in the [[Chomsky hierarchy]] and was first described in 1956 by the linguist [[Noam Chomsky|Chomsky]].&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite journal &lt;br /&gt;
| title = Three models for the description of language &lt;br /&gt;
| year = 1956 &lt;br /&gt;
| last = Chomsky &lt;br /&gt;
| first = Noam &lt;br /&gt;
| journal = IRE Transactions on Information Theory &lt;br /&gt;
| volume = 2 &lt;br /&gt;
| pages = 113–124 &lt;br /&gt;
| url = http://www.chomsky.info/articles/195609--.pdf &lt;br /&gt;
| accessdate = 2012-04-08&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example of a very simple context-free grammar==&lt;br /&gt;
This very simple example can handle only a tiny subset of English and should not be taken seriously as a guide to English grammar or vocabulary. It is based on an example by David Crystal&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite book &lt;br /&gt;
| last = Crystal &lt;br /&gt;
| first = David  &lt;br /&gt;
| title = The Cambridge Encyclopedia of Language &lt;br /&gt;
| publisher = Cambridge University Press &lt;br /&gt;
| year = 1987 &lt;br /&gt;
| isbn = 0-521-42443-7&lt;br /&gt;
| pages = page 97&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; and is a slight extension of an example on slide 9 of this lecture.&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.cs.princeton.edu/~rywang/99f126/slides/16th.pdf&lt;br /&gt;
| title = Lecture notes: Formal Languages&lt;br /&gt;
| accessdate = 2012-04-07}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase''         # A ''Sentence'' consists of a ''NounPhrase'' followed by a ''VerbPhrase''&lt;br /&gt;
 ''NounPhrase'' -&amp;gt;  ''Determiner'' ''Noun''               # A ''NounPhrase'' consists of a ''Determiner'' followed by a ''Noun''&lt;br /&gt;
 ''VerbPhrase'' -&amp;gt;  ''Verb'' ''NounPhrase''               # A ''VerbPhrase'' consists of a ''Verb'' followed by a ''NounPhrase''&lt;br /&gt;
 ''Determiner'' -&amp;gt;  '''a''', '''the'''                        # A ''Determiner''  is one of: '''a''' or '''the'''&lt;br /&gt;
 ''Noun''       -&amp;gt;  '''boy''', '''girl''', '''dog'''                # A ''Noun'' is one of: '''boy''' or '''girl''' or '''dog'''  &lt;br /&gt;
 ''Verb''       -&amp;gt;  '''chased''', '''heard''', '''saw'''            # A ''Verb'' is one of: '''chased''' or '''heard''' or '''saw'''&lt;br /&gt;
&lt;br /&gt;
Notation used above: &lt;br /&gt;
:The symbol &amp;quot;-&amp;gt;&amp;quot; means &amp;quot;can be replaced by&amp;quot;.  &lt;br /&gt;
:When there are several items on the right hand side separated by commas, just one of these items can be selected. &lt;br /&gt;
:The comments preceded by &amp;quot;#&amp;quot; are not part of the generative grammar, but hopefully will help folks understand the example a little better.&lt;br /&gt;
&lt;br /&gt;
By making appropriate substitutions we can generate such sentences as:&lt;br /&gt;
:The dog chased a girl.&lt;br /&gt;
:The girl heard the dog.&lt;br /&gt;
:The boy saw a girl.&lt;br /&gt;
&lt;br /&gt;
The stages in the generation of these examples are as follows:&lt;br /&gt;
:''Sentence''&lt;br /&gt;
:-&amp;gt; ''NounPhrase'' ''VerbPhrase''&lt;br /&gt;
:-&amp;gt; ''Determiner'' ''Noun'' ''Verb'' ''NounPhrase''&lt;br /&gt;
:-&amp;gt; ''Determiner'' ''Noun'' ''Verb'' ''Determiner'' ''Noun''&lt;br /&gt;
&lt;br /&gt;
By appropriate selection of words to substitute for ''Determiner'', ''Noun'', and ''Verb'' we can produce the 3 example sentences above.&lt;br /&gt;
&lt;br /&gt;
The simple grammar defines a few words which can be substituted for ''Determiner'', ''Noun'', and ''Verb''. There are two possibilities for ''Determiner'', three for ''Noun'', and three for ''Verb'', with both ''Determiner'' and ''Noun'' appearing twice in the expansion. Hence the total number of grammatical sentences which can be generated by this simple grammar is 108 (= 2 * 3 * 3 * 2 * 3). In this particular case the possible words have been carefully chosen so that all of these 108 sentences also actually mean something.&lt;br /&gt;
&lt;br /&gt;
Note that the use of ''italics'' and '''boldface''' in this example is merely a convenient way of indicating the difference between items which can be expanded further (e.g. concepts such as ''NounPhrase'') and items which can not be expanded further (e.g. words such as '''girl'''). In the linguistic literature, items which can be expanded further are referred to as 'non-terminal' items, while items which can't be expanded further are known as 'terminal' items.&lt;br /&gt;
&lt;br /&gt;
The 'comma' notation for alternatives is a form of shorthand. In some formulations this would be shown as several separate rules, so that:&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''a''', '''the''' &lt;br /&gt;
could be shown as two rules:&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''a'''&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''the'''&lt;br /&gt;
&lt;br /&gt;
==Caution==&lt;br /&gt;
While a generative grammar may produce sentences which are grammatically correct, there is no certainty that such sentences will actually mean anything. The classic example of such a meaningless sentence is from Chomsky's book&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite book &lt;br /&gt;
| last = Chomsky &lt;br /&gt;
| first = Noam &lt;br /&gt;
| title = Syntactic Structures &lt;br /&gt;
| year = 1957 &lt;br /&gt;
| publisher = Mouton &lt;br /&gt;
| location = The Hague/Paris &lt;br /&gt;
| pages = page 15 &lt;br /&gt;
| isbn = 3-11-017279-8&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; with the grammatically correct sentence:&lt;br /&gt;
&lt;br /&gt;
:&amp;quot;Colorless green ideas sleep furiously.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
:This example illustrates the difference between grammar/syntax and meaning/semantics.&lt;br /&gt;
&lt;br /&gt;
Another problem when analysing a sentence is that many English words have multiple meanings, so that there may be more than one way to interpret a sentence. A simple example is the sentence: &lt;br /&gt;
:&amp;quot;Time flies.&amp;quot; &lt;br /&gt;
:Is this an instruction to check how fast flies are flying, or an indication that time appears to be passing quickly? &lt;br /&gt;
:A varied and entertaining selection of such ambiguities has been compiled by Jeff Gray.&amp;lt;ref&amp;gt;{{Cite web &lt;br /&gt;
| title = Collection of Ambiguous or Inconsistent/Incomplete Statements  &lt;br /&gt;
| url = http://www.gray-area.org/Research/Ambig/ &lt;br /&gt;
| author = Jeff Gray&lt;br /&gt;
| accessdate = 2012-04-10&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Formal definition==&lt;br /&gt;
A '''Context-Free''' Grammar is a tuple (T, V, S, P);&lt;br /&gt;
T is a set of atomic symbols.&lt;br /&gt;
V is a set of variables.&lt;br /&gt;
S is a special start symbol.&lt;br /&gt;
P is a set of productions, each production describes how to produce a variable using a sequence of tokens and variables.&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
For example, a Context-Free Grammar for the real numbers would be:&lt;br /&gt;
:T = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, .}&lt;br /&gt;
:V = {real-number, part, digit}&lt;br /&gt;
:S = real-number&lt;br /&gt;
:P = { digit → 0&lt;br /&gt;
::digit → 1&lt;br /&gt;
::digit → 2&lt;br /&gt;
::digit → 3&lt;br /&gt;
::digit → 4&lt;br /&gt;
::digit → 5&lt;br /&gt;
::digit → 6&lt;br /&gt;
::digit → 7&lt;br /&gt;
::digit → 8&lt;br /&gt;
::digit → 9&lt;br /&gt;
::part → digit&lt;br /&gt;
::part → digit part&lt;br /&gt;
::real-number → part . part&lt;br /&gt;
:}&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
{{reflist}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[category:linguistics]]&lt;br /&gt;
[[Category:Computer Science]]&lt;/div&gt;</summary>
		<author><name>RolandPlankton</name></author>
	</entry>
	<entry>
		<id>https://www.conservapedia.com/index.php?title=Backus-Naur_Form&amp;diff=981368</id>
		<title>Backus-Naur Form</title>
		<link rel="alternate" type="text/html" href="https://www.conservapedia.com/index.php?title=Backus-Naur_Form&amp;diff=981368"/>
		<updated>2012-05-14T19:38:38Z</updated>

		<summary type="html">&lt;p&gt;RolandPlankton: add Category:Computer Science&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In the late 1950's, John Backus and Peter Naur developed a notation for describing the syntax (grammar) of [[programming language]]s. This notation is known as '''Backus-Naur Form''' (or BNF), and was first used in the Algol 60 Report&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.masswerk.at/algol60/report.htm&lt;br /&gt;
| title = Revised Report on the Algorithmic Language Algol 60&lt;br /&gt;
| accessdate = 2012-05-11&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
to specify the syntax of Algol 60, and has since been used for specifying the syntax of other programming languages. &lt;br /&gt;
&lt;br /&gt;
A few years earlier, in 1956, the linguist [[Noam Chomsky|Chomsky]] had published&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite journal &lt;br /&gt;
| title = Three models for the description of language &lt;br /&gt;
| year = 1956 &lt;br /&gt;
| last = Chomsky &lt;br /&gt;
| first = Noam &lt;br /&gt;
| journal = IRE Transactions on Information Theory &lt;br /&gt;
| volume = 2 &lt;br /&gt;
| pages = 113–124 &lt;br /&gt;
| url = http://www.chomsky.info/articles/195609--.pdf &lt;br /&gt;
| accessdate = 2012-05-11&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
an article about a [[Chomsky hierarchy|hierarchy]] of formal grammatical systems for describing various classes of languages.  Even though expressed very differently, and developed independently, it turns out that BNF is logically equivalent to Chomsky's level 2 grammar (often referred to as a [[context-free grammar]]).&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Computer Science]]&lt;/div&gt;</summary>
		<author><name>RolandPlankton</name></author>
	</entry>
	<entry>
		<id>https://www.conservapedia.com/index.php?title=Context-free_grammar&amp;diff=981367</id>
		<title>Context-free grammar</title>
		<link rel="alternate" type="text/html" href="https://www.conservapedia.com/index.php?title=Context-free_grammar&amp;diff=981367"/>
		<updated>2012-05-14T19:38:03Z</updated>

		<summary type="html">&lt;p&gt;RolandPlankton: add cross-reference to Backus-Naur Form&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''An equivalent grammar [[Backus-Naur Form]] is often used for describing the syntax/grammar of programming languages.''&lt;br /&gt;
&lt;br /&gt;
A '''Context-Free''' Grammar is a tuple (T, V, S, P);&lt;br /&gt;
T is a set of atomic symbols.&lt;br /&gt;
V is a set of variables.&lt;br /&gt;
S is a special start symbol.&lt;br /&gt;
P is a set of productions, each production describes how to produce a variable using a sequence of tokens and variables.&lt;br /&gt;
&lt;br /&gt;
For example, a Context-Free Grammar for the real numbers would be:&lt;br /&gt;
:T = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, .}&lt;br /&gt;
:V = {real-number, part, digit}&lt;br /&gt;
:S = real-number&lt;br /&gt;
:P = { digit → 0&lt;br /&gt;
::digit → 1&lt;br /&gt;
::digit → 2&lt;br /&gt;
::digit → 3&lt;br /&gt;
::digit → 4&lt;br /&gt;
::digit → 5&lt;br /&gt;
::digit → 6&lt;br /&gt;
::digit → 7&lt;br /&gt;
::digit → 8&lt;br /&gt;
::digit → 9&lt;br /&gt;
::part → digit&lt;br /&gt;
::part → digit part&lt;br /&gt;
::real-number → part . part&lt;br /&gt;
:}&lt;br /&gt;
&lt;br /&gt;
[[category:linguistics]]&lt;br /&gt;
[[Category:Computer Science]]&lt;/div&gt;</summary>
		<author><name>RolandPlankton</name></author>
	</entry>
	<entry>
		<id>https://www.conservapedia.com/index.php?title=User_talk:Brenden&amp;diff=980859</id>
		<title>User talk:Brenden</title>
		<link rel="alternate" type="text/html" href="https://www.conservapedia.com/index.php?title=User_talk:Brenden&amp;diff=980859"/>
		<updated>2012-05-11T22:46:18Z</updated>

		<summary type="html">&lt;p&gt;RolandPlankton: /* thanks */ new section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful links}}&lt;br /&gt;
&lt;br /&gt;
The socks which were blocked, including yours, had a single IP, but I will accept your explanation.  Please continue to edit in the site.  [[User:Karajou|Karajou]] 19:13, 17 April 2012 (EDT)&lt;br /&gt;
&lt;br /&gt;
Greetings from a fellow gay (and very much out and proud!) editor at conservapedia! --[[User:JHunter|JHunter]] 21:13, 23 April 2012 (EDT)&lt;br /&gt;
:I'm sorry, wut?&lt;br /&gt;
{| class=&amp;quot;collapsible collapsed&amp;quot; style=&amp;quot;border:1px dashed Gainsboro;margin:+.1em;width:20%&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;border:1px solid lightgray;margin:+.1em;text-align:center;padding:+.2em&amp;quot; | &amp;lt;font size=&amp;quot;2&amp;quot; face=&amp;quot;Trebuchet MS, Arial, Helvetica, sans-serif&amp;quot; color=&amp;quot;Silver&amp;quot;&amp;gt;[[user:Brenden|Brenden]].&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;padding: 8px; background-color: white;&amp;quot; |&lt;br /&gt;
*[[Special:Contributions/Brenden|Contribs]]&lt;br /&gt;
*[[user talk:Brenden|talk]]&lt;br /&gt;
*[[Special:Log&amp;amp;user=Brenden|&amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;log&amp;lt;/font&amp;gt;]]&lt;br /&gt;
|} 21:44, 24 April 2012 (EDT)&lt;br /&gt;
&lt;br /&gt;
== A special thank you ==&lt;br /&gt;
&lt;br /&gt;
Thank you for helping to tag the contributions by [[User:Slaine]] for speedy deletion.  I have blocked the user infinitely.  [[User:GregG|GregG]] 17:28, 29 April 2012 (EDT)&lt;br /&gt;
&lt;br /&gt;
== Quick Thanks ==&lt;br /&gt;
&lt;br /&gt;
Thank you for cleaning up my addition to [[Homosexual Agenda]]. Still learning to get the right 'tone' for articles, much appreciated. [[User:JRegden|JRegden]] 02:57, 11 May 2012 (EDT)&lt;br /&gt;
&lt;br /&gt;
== thanks ==&lt;br /&gt;
&lt;br /&gt;
Thank you for adding a category to [[Chomsky hierarchy]]. Perhaps you could have a look at the articles I'm interested in on my [[User talk:RolandPlankton|talk page]] and see if any of these need categorising. [[User:RolandPlankton|RolandPlankton]] 18:46, 11 May 2012 (EDT)&lt;/div&gt;</summary>
		<author><name>RolandPlankton</name></author>
	</entry>
	<entry>
		<id>https://www.conservapedia.com/index.php?title=Chomsky_hierarchy&amp;diff=980858</id>
		<title>Chomsky hierarchy</title>
		<link rel="alternate" type="text/html" href="https://www.conservapedia.com/index.php?title=Chomsky_hierarchy&amp;diff=980858"/>
		<updated>2012-05-11T22:42:02Z</updated>

		<summary type="html">&lt;p&gt;RolandPlankton: fix wikilink&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The '''Chomsky hierarchy''', sometimes known as the '''Chomsky-Schützenberger hierarchy''', is a hierarchy of formal grammatical systems for describing various classes of languages; the hierarchy can apply to both human and computer languages. This hierarchy was first published in 1956 by the linguist [[Noam Chomsky|Chomsky]].&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite journal &lt;br /&gt;
| title = Three models for the description of language &lt;br /&gt;
| year = 1956 &lt;br /&gt;
| last = Chomsky &lt;br /&gt;
| first = Noam &lt;br /&gt;
| journal = IRE Transactions on Information Theory &lt;br /&gt;
| volume = 2 &lt;br /&gt;
| pages = 113–124 &lt;br /&gt;
| url = http://www.chomsky.info/articles/195609--.pdf &lt;br /&gt;
| accessdate = 2012-04-08&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
These grammatical systems were referred to by Chomsky as ''transformational grammars''.  Other linguists have since developed a variety of similar grammars; together these are known as ''generative grammars''. &lt;br /&gt;
&lt;br /&gt;
The basic idea of a '''generative grammar''' is to provide a set of rules which are capable of generating all possible grammatical sentences in some language; the rules must constrain the generation so that only grammatical sentences are generated. The rules can also be used in reverse to parse a sentence and check if it is grammatical.&lt;br /&gt;
&lt;br /&gt;
In the late 1950's, [[John Backus]] and Peter Naur developed a notation for describing [[programming language]]s. This notation is known as [[Backus-Naur Form]] (or BNF) and turns out to be equivalent to Chomsky's grammar number two (context-free grammar), although it was developed independently of Chomsky's work. Backus-Naur Form was first used in the Algol 60 Report to specify the syntax of [[Algol 60]], and has since been used for specifying the syntax of other programming languages. &lt;br /&gt;
&lt;br /&gt;
==Example of a very simple generative grammar==&lt;br /&gt;
This very simple example can handle only a tiny subset of English and should not be taken seriously as a guide to English grammar or vocabulary. It is based on an example by David Crystal&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite book &lt;br /&gt;
| last = Crystal &lt;br /&gt;
| first = David  &lt;br /&gt;
| title = The Cambridge Encyclopedia of Language &lt;br /&gt;
| publisher = Cambridge University Press &lt;br /&gt;
| year = 1987 &lt;br /&gt;
| isbn = 0-521-42443-7&lt;br /&gt;
| pages = page 97&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; and is a slight extension of an example on slide 9 of this lecture.&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.cs.princeton.edu/~rywang/99f126/slides/16th.pdf&lt;br /&gt;
| title = Lecture notes: Formal Languages&lt;br /&gt;
| accessdate = 2012-04-07}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase''         # A ''Sentence'' consists of a ''NounPhrase'' followed by a ''VerbPhrase''&lt;br /&gt;
 ''NounPhrase'' -&amp;gt;  ''Determiner'' ''Noun''               # A ''NounPhrase'' consists of a ''Determiner'' followed by a ''Noun''&lt;br /&gt;
 ''VerbPhrase'' -&amp;gt;  ''Verb'' ''NounPhrase''               # A ''VerbPhrase'' consists of a ''Verb'' followed by a ''NounPhrase''&lt;br /&gt;
 ''Determiner'' -&amp;gt;  '''a''', '''the'''                        # A ''Determiner''  is one of: '''a''' or '''the'''&lt;br /&gt;
 ''Noun''       -&amp;gt;  '''boy''', '''girl''', '''dog'''                # A ''Noun'' is one of: '''boy''' or '''girl''' or '''dog'''  &lt;br /&gt;
 ''Verb''       -&amp;gt;  '''chased''', '''heard''', '''saw'''            # A ''Verb'' is one of: '''chased''' or '''heard''' or '''saw'''&lt;br /&gt;
&lt;br /&gt;
Notation used above: &lt;br /&gt;
:The symbol &amp;quot;-&amp;gt;&amp;quot; means &amp;quot;can be replaced by&amp;quot;.  &lt;br /&gt;
:When there are several items on the right hand side separated by commas, just one of these items can be selected. &lt;br /&gt;
:The comments preceded by &amp;quot;#&amp;quot; are not part of the generative grammar, but hopefully will help folks understand the example a little better.&lt;br /&gt;
&lt;br /&gt;
By making appropriate substitutions we can generate such sentences as:&lt;br /&gt;
:The dog chased a girl.&lt;br /&gt;
:The girl heard the dog.&lt;br /&gt;
:The boy saw a girl.&lt;br /&gt;
&lt;br /&gt;
The stages in the generation of these examples are as follows:&lt;br /&gt;
:''Sentence''&lt;br /&gt;
:-&amp;gt; ''NounPhrase'' ''VerbPhrase''&lt;br /&gt;
:-&amp;gt; ''Determiner'' ''Noun'' ''Verb'' ''NounPhrase''&lt;br /&gt;
:-&amp;gt; ''Determiner'' ''Noun'' ''Verb'' ''Determiner'' ''Noun''&lt;br /&gt;
&lt;br /&gt;
By appropriate selection of words to substitute for ''Determiner'', ''Noun'', and ''Verb'' we can produce the 3 example sentences above.&lt;br /&gt;
&lt;br /&gt;
The simple grammar defines a few words which can be substituted for ''Determiner'', ''Noun'', and ''Verb''. There are two possibilities for ''Determiner'', three for ''Noun'', and three for ''Verb'', with both ''Determiner'' and ''Noun'' appearing twice in the expansion. Hence the total number of grammatical sentences which can be generated by this simple grammar is 108 (= 2 * 3 * 3 * 2 * 3). In this particular case the possible words have been carefully chosen so that all of these 108 sentences also actually mean something.&lt;br /&gt;
&lt;br /&gt;
Note that the use of ''italics'' and '''boldface''' in this example is merely a convenient way of indicating the difference between items which can be expanded further (e.g. concepts such as ''NounPhrase'') and items which can not be expanded further (e.g. words such as '''girl'''). In the linguistic literature, items which can be expanded further are referred to as 'non-terminal' items, while items which can't be expanded further are known as 'terminal' items.&lt;br /&gt;
&lt;br /&gt;
The 'comma' notation for alternatives is a form of shorthand. In some formulations this would be shown as several separate rules, so that:&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''a''', '''the''' &lt;br /&gt;
could be shown as two rules:&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''a'''&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''the''' &lt;br /&gt;
&lt;br /&gt;
==Caution==&lt;br /&gt;
While a generative grammar may produce sentences which are grammatically correct, there is no certainty that such sentences will actually mean anything. The classic example of such a meaningless sentence is from Chomsky's book&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite book &lt;br /&gt;
| last = Chomsky &lt;br /&gt;
| first = Noam &lt;br /&gt;
| title = Syntactic Structures &lt;br /&gt;
| year = 1957 &lt;br /&gt;
| publisher = Mouton &lt;br /&gt;
| location = The Hague/Paris &lt;br /&gt;
| pages = page 15 &lt;br /&gt;
| isbn = 3-11-017279-8&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; with the grammatically correct sentence:&lt;br /&gt;
&lt;br /&gt;
:&amp;quot;Colorless green ideas sleep furiously.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
:This example illustrates the difference between grammar/syntax and meaning/semantics.&lt;br /&gt;
&lt;br /&gt;
Another problem when analysing a sentence is that many English words have multiple meanings, so that there may be more than one way to interpret a sentence. A simple example is the sentence: &lt;br /&gt;
:&amp;quot;Time flies.&amp;quot; &lt;br /&gt;
:Is this an instruction to check how fast flies are flying, or an indication that time appears to be passing quickly? &lt;br /&gt;
:A varied and entertaining selection of such ambiguities has been compiled by Jeff Gray.&amp;lt;ref&amp;gt;{{Cite web &lt;br /&gt;
| title = Collection of Ambiguous or Inconsistent/Incomplete Statements  &lt;br /&gt;
| url = http://www.gray-area.org/Research/Ambig/ &lt;br /&gt;
| author = Jeff Gray&lt;br /&gt;
| accessdate = 2012-04-10&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Formal grammar==&lt;br /&gt;
'''Note''': this section and subsequent sections are, by necessity, slightly more technical/formal than the earlier parts of this article, though specialist notation and abbreviations have been largely avoided. Make sure that you understand the 'Simple example' above before proceeding further, since references will be made to that example to help explain the technicalities, and variations on that example will be used to illustrate new ideas. &lt;br /&gt;
&lt;br /&gt;
A formal generative grammar has four components (as described in slide 19 of this lecture&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://adammikeal.org/courses/compute/Chomsky%20Presentation.pdf&lt;br /&gt;
| title = The Chomsky Hierarchy&lt;br /&gt;
| accessdate = 2012-04-06&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
):&lt;br /&gt;
# a finite number of non-terminal concepts (e.g. ''VerbPhrase'' in the example, or anything else in ''italics''),&lt;br /&gt;
# a finite number of terminal items (e.g. '''girl''' in the example, or anything else in '''bold-face''').&lt;br /&gt;
# a finite set of rules for transforming non-terminal items (e.g. the example has 6 rules).&lt;br /&gt;
# a single starting point (e.g. ''Sentence'' in the example).&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
:Terminal items are those which can not be transformed into anything else.&lt;br /&gt;
:A list of all the terminal items is effectively the vocabulary from which sentences are built.&lt;br /&gt;
:Non-terminal items are those which can be transformed into something else.&lt;br /&gt;
:Linguists have developed various classes of grammars by using constraints to govern what sort of rules can be used for any particular grammar.&lt;br /&gt;
&lt;br /&gt;
===Changing the rules===&lt;br /&gt;
An relatively small change to even a single rule can make a large change in the language which can be generated. For example, change the first rule in the simple example to read:&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''NounPhrase'' ''VerbPhrase'' '''and''' ''NounPhrase'' ''VerbPhrase''&lt;br /&gt;
This means that a ''Sentence'' is either a ''NounPhrase'' followed by a ''VerbPhrase'' or a ''NounPhrase'' followed by a ''VerbPhrase'' followed by '''and''' followed by a ''NounPhrase'' followed by a ''VerbPhrase''. In addition to the shorter sentences already discussed, this could also generate a sentence such as: &amp;quot;A dog saw a girl and the dog chased the girl&amp;quot;. The total number of grammatically-correct sentences which can be generated by this modified grammar is now 11,772 (108 + 108*108), though some of these may not be very meaingful.&lt;br /&gt;
&lt;br /&gt;
===Towards infinity===&lt;br /&gt;
A significantly different rule change can have an astounding effect. Consider changing the first rule to read:&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''NounPhrase'' ''VerbPhrase'' '''and''' ''Sentence''&lt;br /&gt;
This can generate a potentially infinite number of sentences (any number of these five-word sentences linked by '''and'''). This is an example of what is known as a [[Recursion|recursive]] definition, whereby a ''Sentence'' is partially defined in terms of itself. In such a recursive rule there must be at least one transformation option which does not involve ''Sentence'', otherwise the transformation could never stop.&lt;br /&gt;
&lt;br /&gt;
The above change is known as right-recursive; a left-recursive formulation is also possible, and can in this example generate exactly the same sentences. As shown below  under 'Context-free grammar', there are situations where the choice of left- or right-recursive formulations can change the meaning. &lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''Sentence'' '''and''' ''NounPhrase'' ''VerbPhrase'' &lt;br /&gt;
&lt;br /&gt;
The distinction between left- and right-recursive grammars becomes important when trying to parse/analyse a sentence; some types of parser work best with left-recursive grammars, while other types work best with right-recursive grammars. This distinction is particularly relevant in connection with [[compiler|compiling or translating]] a program written in some high-level [[programming language]] so that it can be used on a [[computer]].&lt;br /&gt;
&lt;br /&gt;
==Chomsky hierarchy==&lt;br /&gt;
By imposing different constraints&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.cs.uaf.edu/2011/spring/cs331/lectures/cs331_20110124_grammar.html&lt;br /&gt;
| title = Lecture notes: Languages &amp;amp; Grammars&lt;br /&gt;
| accessdate = 2012-04-07&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; &lt;br /&gt;
as to what sort of transformation rules could be used, Chomsky was able to define four strictly nested transformational grammars, which he numbered from 0 to 3. As the grammar number increases, the generated language becomes simpler. As the grammar number decreases, parsing a sentence in that language becomes more difficult.&lt;br /&gt;
Other linguists have described formal grammars which fit in between the various Chomsky levels. &lt;br /&gt;
&lt;br /&gt;
The following table provides a summary, which is then explained further in the subsequent subsections.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!| Chomsky&amp;lt;br&amp;gt;number || linguistic name || Rule constraints || Recogniser+ || Notes &lt;br /&gt;
|-&lt;br /&gt;
| 0 || recursively enumerable || [anything] -&amp;gt; [anything] || Turing machine || most human languages &lt;br /&gt;
|-&lt;br /&gt;
| 1 || context-sensitive || X ''A'' Y -&amp;gt; X [anything] Y || linear bounded automaton || X and Y provide the context in which ''A'' can be transformed &lt;br /&gt;
|-&lt;br /&gt;
| 2 || context-free || ''A'' -&amp;gt; [anything] || non-deterministic push-down automaton || syntax analysis for most programming languages &lt;br /&gt;
|-&lt;br /&gt;
| 3 || regular || ''A'' -&amp;gt; [nothing]&amp;lt;br&amp;gt;''A'' -&amp;gt; '''xyz'''&amp;lt;br&amp;gt;''A'' -&amp;gt; '''xyz''' ''B'' || finite automaton&amp;lt;br&amp;gt;or finite state machine || lexical analysis (combining characters into words/tokens)  &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''+''' The '''recogniser''' column indicates the type of mathematical or computer science theoretical model needed to recognise that a sentence belongs to a language, essentially by applying the transformation rules in reverse to work backwards from the actual words in order to finish up with a ''sentence'' (in programming languages the starting concept is usually a ''program''). A finite automaton uses only a small fixed amount of memory, operates in time proportional to the length of the input, and always reaches a decision, while a Turing machine may use an infinite amount of memory and time and may fail to reach a decision (may never stop).&lt;br /&gt;
&lt;br /&gt;
In the linguistic literature, [nothing] is often represented by the symbol '''ε'''.&lt;br /&gt;
&lt;br /&gt;
The descriptions of the various Chomsky levels which follow are presented in reverse order, so as to work up from a simple case to a rather complicated case.&lt;br /&gt;
&lt;br /&gt;
===Level 3: regular grammar===&lt;br /&gt;
The transformation rules for regular grammars are required to be very simple. &lt;br /&gt;
*Only a single non-terminal item can appear on the left-hand side of a rule.&lt;br /&gt;
*The right-hand side of any rule must be one of:&lt;br /&gt;
**[nothing].&lt;br /&gt;
**a terminal item.&lt;br /&gt;
**a terminal item followed by a non-terminal item.&lt;br /&gt;
Note that instead of a terminal item we could have a non-terminal item whose transformation rule immediately resolves to a single terminal item, or to one of several terminal items.&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
Informally we can define a 'word' as a sequence of one or more ''Letter''s. The following regular grammar provides a more formal definition; for simplicity it is restricted to lower-case letters.&lt;br /&gt;
&lt;br /&gt;
 ''Word''     -&amp;gt; ''Letter'' ''PartWord''&lt;br /&gt;
 ''PartWord'' -&amp;gt; [nothing]&lt;br /&gt;
 ''PartWord'' -&amp;gt; ''Letter'' ''PartWord''&lt;br /&gt;
 ''Letter''   -&amp;gt; '''a''', '''b''', ... '''z'''&lt;br /&gt;
&lt;br /&gt;
Note that ''PartWord'' is recursively defined, with the recursion stopping if it is transformed into [nothing].&lt;br /&gt;
&lt;br /&gt;
For one-letter words we expand as: &lt;br /&gt;
:''Word'' -&amp;gt; ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' [nothing] -&amp;gt; ''Letter''&lt;br /&gt;
&lt;br /&gt;
For two-letter words we expand as: &lt;br /&gt;
:''Word'' -&amp;gt; ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' ''Letter'' [nothing] -&amp;gt;  ''Letter'' ''Letter''&lt;br /&gt;
&lt;br /&gt;
Obviously, words of any length can be constructed, though they may well not actually be words from any language. &lt;br /&gt;
&lt;br /&gt;
====Discussion====&lt;br /&gt;
Trying to devise transformation rules to produce words which are more English-like is much more difficult - how do you insist on at least one vowel or on no more than 5 consecutive consonants (e.g. as in 'strengths').&lt;br /&gt;
&lt;br /&gt;
Further examples in [[Regular grammar]] show how numbers can be defined via a regular grammar, and also show how a hyphenated word could be defined.&lt;br /&gt;
&lt;br /&gt;
One of the limitations of a regular grammar is that it can't cope with nested matching brackets, so that it is impossible to write a regular grammar to describe an expression such as '''2 * (3+4)''' where that grammar is expected to allow brackets nested to any depth. A context-free grammar is needed for this, as described in the next section.&lt;br /&gt;
&lt;br /&gt;
Regular grammars or equivalent are widely used by [[compiler]]s in the lexical analysis of programming languages.&lt;br /&gt;
&lt;br /&gt;
===Level 2: context-free grammar===&lt;br /&gt;
The transformation rules for context-free grammars don't appear that much different from those for regular grammars. &lt;br /&gt;
*Only a single non-terminal item can appear on the left-hand side of a rule.&lt;br /&gt;
*The right-hand side of any rule must be one of:&lt;br /&gt;
**[nothing].&lt;br /&gt;
**any combination of terminal items and non-terminal items.&lt;br /&gt;
&lt;br /&gt;
The key difference is that in a regular grammar, any non-empty rule must effectively start with terminal item so that every rule transformation makes some immediate progress, while in a context-free grammar a rule could start with a non-terminal item which itself could be subject to arbitrary further transformations.&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
The following example shows how context-free grammars can cope with arithmetic expressions involving possibly nested brackets. Also an expression such as &amp;quot;2 + 3 * 4&amp;quot; could be interpreted as either &amp;quot;(2 + 3) * 4&amp;quot; = 20 or as &amp;quot;2 + (3 * 4)&amp;quot; = 14. The latter interpretation is that which is normally used - multiplication &amp;quot;*&amp;quot; is said to have a higher priority than addition &amp;quot;+&amp;quot; - so the grammar must incorporate this priority concept. Furthermore, consecutive operators of the same priority are normally applied from left to right, so that &amp;quot;8 - 2 + 3&amp;quot; is interpreted as &amp;quot;(8 - 2) + 3&amp;quot; = 9, rather than as &amp;quot;8 - (2 + 3)&amp;quot; = 3.  This ordering must also be built in to the grammar.&lt;br /&gt;
&lt;br /&gt;
To avoid distracting side-issues, this example only deals with numbers which consist solely of a single digit. The example is a simplified version of the definition of an arithmetic expression given in the Revised Algol 60 Report (Section 3.3.1).&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.masswerk.at/algol60/report.htm&lt;br /&gt;
| title = Revised Report on the Algorithmic Language Algol 60&lt;br /&gt;
| accessdate = 2012-04-22&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ''Expression'' -&amp;gt; ''Term''                        # an ''Expression'' is either a ''Term''&lt;br /&gt;
 ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''    #   or an ''Expression'' followed by '''+''' or '''-''' followed by a ''Term''&lt;br /&gt;
                                           #&lt;br /&gt;
 ''Term''       -&amp;gt; ''Primary''                     # a ''Term'' is either a ''Primary''&lt;br /&gt;
 ''Term''       -&amp;gt; ''Term'' ''MulDivOp'' ''Primary''       #   or a ''Term'' followed by '''*''' or '''/''' followed by a ''Primary''&lt;br /&gt;
                                           #&lt;br /&gt;
 ''Primary''    -&amp;gt; ''Number''                      # a ''Primary'' is either a ''Number''&lt;br /&gt;
 ''Primary''    -&amp;gt; '''(''' ''Expression'' ''')'''              #   or an ''Expression'' enclosed in brackets&lt;br /&gt;
                                           #&lt;br /&gt;
 ''MulDivOp''   -&amp;gt; '''*'''. '''/'''                        # multiplication and division have the same priority&lt;br /&gt;
 ''AddSubOp''   -&amp;gt; '''+'''. '''-'''                        # addition and subtraction have the same priority&lt;br /&gt;
 ''Number''     -&amp;gt; '''0''', '''1''', ... '''9'''                 # this simple-minded definition of a ''Number'' is enough for this example&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
* Both ''Expression'' and ''Term'' are each defined via a left-recursive rule; this ensures that operators of the same priority are applied from left to right.&lt;br /&gt;
* The distinction between ''Expression'' and ''Term'' ensures that multiplication/division are applied before addition/subtraction.&lt;br /&gt;
* ''Expression'' is indirectly recursive via ''Term'' and ''Primary'' to allow bracketed sub-expressions to any depth.&lt;br /&gt;
&lt;br /&gt;
Example 1: generate 2 + 3 * 4&lt;br /&gt;
&lt;br /&gt;
  ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Term'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Primary'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' ''Term''                                 # '''+''' can not be applied until ''Term'' has been evaluated&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' ''Term'' ''MulDivOp'' ''Primary''&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' ''Primary'' ''MulDipOp'' ''Primary''&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' '''3''' '''*''' '''4'''&lt;br /&gt;
&lt;br /&gt;
Example 2: generate 2 * 3 + 4&lt;br /&gt;
&lt;br /&gt;
  ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Term'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Term'' ''MulDivOp'' ''Primary'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Primary'' ''MulDivOp'' ''Primary'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; '''2''' '''*''' '''3''' ''AddSubOp'' ''Term''                      # ''Term'' to left of ''AddSubOp'' is evaluated first&lt;br /&gt;
             -&amp;gt; '''2''' '''*''' '''3''' ''AddSubOp'' ''Primary''  &lt;br /&gt;
             -&amp;gt; '''2''' '''*''' '''3''' '''+''' '''4'''&lt;br /&gt;
&lt;br /&gt;
====Discussion====&lt;br /&gt;
Context-free grammars (or equivalent definitions using Backus-Naur-Form) are widely used both to define the syntax of programming languages and to (semi-automatically) generate parsers for these languages.&lt;br /&gt;
&lt;br /&gt;
A limitation/feature of both regular grammars and context-free grammars is that the left-hand side of any rule is always a single non-terminal item, so any transformation is applied regardless of the context in which that non-terminal item appears.  A simple example which depends on context is the use of singular and plural nouns and verbs in English.  We say: '''the man runs''' or '''the men run''', but neither of '''the man run''' nor '''the men runs'''.  Which form of verb to use depends on the noun, i.e. there is a context dependency.&lt;br /&gt;
&lt;br /&gt;
===Level 1: context-sensitive grammar===&lt;br /&gt;
For context-sensitive grammars the left-hand side of a rule may indicate the context in which that rule applies, so that the same non-terminal item may be transformed in different ways depending on the context in which it appears.&lt;br /&gt;
&lt;br /&gt;
There is only one transformation rule for context-sensitive grammars:&lt;br /&gt;
*X [non-terminal] Y -&amp;gt; X [anything] Y&lt;br /&gt;
&lt;br /&gt;
where X and Y determine the context in which the [non-terminal] is transformed. Note that X and Y may each be terminals or non-terminals or [nothing]. When both X and Y are nothing there is no context and this reduces to a Level 2 or Level 3 grammar.&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
Taylor has provided several examples&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.divms.uiowa.edu/~fleck/taylor.pdf&lt;br /&gt;
| title = Context-sensitive Examples&lt;br /&gt;
| author = Taylor&lt;br /&gt;
| accessdate = 2012-04-26&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
and the following, inspired by his third example, is an extension of the original simple example above to handle singulars and plurals:&lt;br /&gt;
&lt;br /&gt;
 ''Sentence''                -&amp;gt;  ''NounPhrase'' ''VerbPhrase''            # simple sentence structure&lt;br /&gt;
 ''NounPhrase''              -&amp;gt;  ''Determiner'' ''Noun''                  # simple phrase structure&lt;br /&gt;
 ''VerbPhrase''              -&amp;gt;  ''Verb'' ''NounPhrase''                  # simple phrase structure&lt;br /&gt;
                                                              #&lt;br /&gt;
 ''Noun''                    -&amp;gt;  ''SingularNoun'', ''PluralNoun''         # nouns can be singular or plural &lt;br /&gt;
                                                              #&lt;br /&gt;
 ''Determiner'' ''SingularNoun'' -&amp;gt;  ''SingularDeterminer'' ''SingularNoun''  # context-sensitive:&lt;br /&gt;
 ''Determiner'' ''PluralNoun''   -&amp;gt;  ''PluralDeterminer'' ''PluralNoun''      #    determiner must agree with noun&lt;br /&gt;
                                                              #&lt;br /&gt;
 ''SingularNoun'' ''Verb''       -&amp;gt;  ''SingularNoun'' ''SingularVerb''        # context-sensitive: &lt;br /&gt;
 ''PluralNoun'' ''Verb''         -&amp;gt;  ''PluralNoun'' ''PluralVerb''            #    verb must agree with noun&lt;br /&gt;
                                                              #&lt;br /&gt;
 ''SingularDeterminer''      -&amp;gt;  '''a''', '''the'''                           # singular determiners&lt;br /&gt;
 ''PluralDeterminer''        -&amp;gt;  '''the'''                              # plural determiners&lt;br /&gt;
                                                              #&lt;br /&gt;
 ''SingularNoun''            -&amp;gt;  '''boy''', '''sheep''', '''dog'''                  # singular nouns&lt;br /&gt;
 ''PluralNoun''              -&amp;gt;  '''boys''', '''sheep''', '''dogs'''                # plural nouns&lt;br /&gt;
                                                              #&lt;br /&gt;
 ''SingularVerb''            -&amp;gt;  '''chases''', '''hears''', '''sees'''              # singular verbs&lt;br /&gt;
 ''PluralVerb''              -&amp;gt;  '''chase''', '''hear''', '''see'''                 # plural verbs&lt;br /&gt;
&lt;br /&gt;
The above grammar can generate sentences such as: '''a boy chases a dog''', '''the boys chase a dog''', etc. Because some words have the same form in both singular and plural, it can also generate meaningful (and grammatically-correct) sentences such as: '''the sheep sees the dog''', '''the sheep see the dog'''.&lt;br /&gt;
&lt;br /&gt;
But the above grammar can NOT generate sentences such as: '''a boys chases the sheep''', since this would violate the context-sensitive rules.&lt;br /&gt;
&lt;br /&gt;
====Discussion====&lt;br /&gt;
It is in fact possible to handle singular/plural issues by using only a Level 2 context-free grammar, but the above rules expressed as a Level 1 context-sensitive grammar are a closer match to ordinary concepts of English grammar (e.g. nouns and verbs must agree in number i.e. singular/plural).&lt;br /&gt;
&lt;br /&gt;
===Level 0: recursively enumerable grammar===&lt;br /&gt;
A recursively enumerable grammar has absolutely no restriction on what sort of transformation rules can be applied; hence it is also known as an unrestricted grammar. Rules take the general form:&lt;br /&gt;
*[anything] -&amp;gt; [anything]&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
The following rules can generate all symbols of the form: abc, aabbcc, aaabbbccc, etc., where there are equal numbers of a's, b's and c's. This example is taken from a lecture.&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.cs.utexas.edu/~cline/ear/Slides/Turing/TuringSlides3.doc&lt;br /&gt;
| title = Grammars, Recursively Enumerable Languages, and Turing Machines&lt;br /&gt;
| accessdate = 2012-05-10&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ''S''   -&amp;gt; '''a''' ''B'' ''S'' '''c'''&lt;br /&gt;
 ''S''   -&amp;gt; '''a''' ''B'' '''c'''&lt;br /&gt;
 ''B'' '''a''' -&amp;gt; '''a''' ''B''&lt;br /&gt;
 ''B'' '''c''' -&amp;gt; '''b''' '''c'''&lt;br /&gt;
 ''B'' '''b''' -&amp;gt; '''b''' '''b'''&lt;br /&gt;
&lt;br /&gt;
The derivations of the first three items in this infinite sequence are:&lt;br /&gt;
&lt;br /&gt;
# ''S'' -&amp;gt; '''a'''''B'''''c''' -&amp;gt; '''abc'''&lt;br /&gt;
# ''S'' -&amp;gt; '''a'''''BS'''''c''' -&amp;gt; '''a'''''B'''''a'''''B'''''cc''' -&amp;gt; '''aa'''''B B'''''cc''' -&amp;gt; '''aa'''''B'''''bcc''' -&amp;gt; '''aabbcc'''&lt;br /&gt;
# ''S'' -&amp;gt; '''a'''''BS'''''c''' -&amp;gt; '''a'''''B'''''a'''''BS'''''cc''' -&amp;gt; '''a'''''B'''''a'''''B'''''a'''''B'''''ccc''' -&amp;gt; '''aa'''''BB'''''a'''''B'''''ccc''' -&amp;gt; '''aa'''''B'''''a'''''BB'''''ccc''' -&amp;gt; '''aaa'''''BBB'''''ccc''' -&amp;gt; '''aaa'''''BB'''''bccc''' -&amp;gt; '''aaa'''''B'''''bbccc''' -&amp;gt; '''aaabbbccc'''&lt;br /&gt;
&lt;br /&gt;
===Beyond Level 0===&lt;br /&gt;
These lecture notes&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.google.co.uk/url?sa=t&amp;amp;rct=j&amp;amp;q=recursively+enumerable+languages+examples&amp;amp;source=web&amp;amp;cd=4&amp;amp;ved=0CF4QFjAD&amp;amp;url=http%3A%2F%2Fwww.cs.colostate.edu%2F~massey%2FTeaching%2Fcs301%2FRestrictedAccess%2FSlides%2F301lecture23.pdf&amp;amp;ei=6qelT4KMA6SA0AXIu7CQBA&amp;amp;usg=AFQjCNG3fc1mD7g5f-14vfDPdvyX2uScDg&lt;br /&gt;
| title = Recursive and Recursively Enumerable Languages&lt;br /&gt;
| accessdate = 2012-05-05&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
show that languages exist which can not be described by any set of rules. As is common with logical proofs of this nature, the proof doesn't actually produce or demonstrate such a language.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[category:linguistics]]&lt;br /&gt;
[[Category:Computer Science]]&lt;br /&gt;
[[Category:Language]]&lt;/div&gt;</summary>
		<author><name>RolandPlankton</name></author>
	</entry>
	<entry>
		<id>https://www.conservapedia.com/index.php?title=User_talk:RolandPlankton&amp;diff=980855</id>
		<title>User talk:RolandPlankton</title>
		<link rel="alternate" type="text/html" href="https://www.conservapedia.com/index.php?title=User_talk:RolandPlankton&amp;diff=980855"/>
		<updated>2012-05-11T22:29:56Z</updated>

		<summary type="html">&lt;p&gt;RolandPlankton: tidy up headings etc.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{welcome|sig=[[User:Joaquín Martínez|Joaquín Martínez]] 19:52, 21 March 2012 (EDT)}}&lt;br /&gt;
&lt;br /&gt;
==Rugby World Cup==&lt;br /&gt;
&lt;br /&gt;
Do you doubt the truth of the phrase you wanted cited? Its not a sentiment I share, and its bloody hard to find a cite for that sort of thing, but I don't think the sentiment is untrue for a casual fan.  I know from talking to non-rugby people that the low number of tries and the general style of play turns a lot of people off.  It doesn't turn me off, nor perhaps you, but I think it undisputable that it turns many off.  --[[User:DamianJohn|DamianJohn]] 17:30, 12 February 2012 (EST)&lt;br /&gt;
:Hi Damian, In [Rugby World Cup], the phrase &amp;quot;the sudden death nature of the later stages tend to produce dour rugby that is often unattractive to casual fans&amp;quot; may or may not be true, but it looks rather like opinion and contains vague words &amp;quot;tend to produce&amp;quot;, and hence needs to be attributed to someone. If no attribution can be found then the phrase should be deleted. I believe that this approach is in accordance with the Conservapedia Commandments and the Manual of Style. [[User:RolandPlankton|RolandPlankton]] 13:23, 13 February 2012 (EST)&lt;br /&gt;
::Well, perhaps, but there is also points 10 and 13 in the [http://www.conservapedia.com/Conservapedia:How_Conservapedia_Differs_from_Wikipedia differences with Wikipedia] page to consider which is appropriate here.  Remember also that on this website, personal conversations are a sufficient source [http://www.conservapedia.com/Essay:25_Worst_Court_Decisions#cite_note-8 for observations].  I do hear what you are saying, but I think that the claim being made is so obviously true, that the referencing standards of this website do not require a cite.  --[[User:DamianJohn|DamianJohn]] 13:32, 13 February 2012 (EST)&lt;br /&gt;
:::As someone who has a scientific background, I'm rather unhappy with the phrase 'obviously true', since there have been plenty of examples over the last 1000 years or so when what is 'obviously true' turns out to be false.  Another question: what is 'dour rugby'?  Unless you can provide an attribution I would suggest toning the comment down a little to read at the end: &amp;quot;turns some people off.&amp;quot; [[User:RolandPlankton|RolandPlankton]] 14:37, 13 February 2012 (EST)&lt;br /&gt;
&lt;br /&gt;
Pause in discussion please. I'm off on pilgrimage to the Holy Land for nearly 2 weeks. [[User:RolandPlankton|RolandPlankton]] 14:01, 14 February 2012 (EST)&lt;br /&gt;
:I wouldn't worry about it too much.  I don't think the rugby world cup article is high on the list of priorities for anyone here.  --[[User:DamianJohn|DamianJohn]] 17:08, 14 February 2012 (EST)&lt;br /&gt;
::I have added a citation for your reading pleasure.  Ps How is [http://en.wikipedia.org/wiki/Millennium_Stadium Cardiff Arms Park] these days?Or was it [http://en.wikipedia.org/wiki/Ellis_Park_Stadium Ellis Park], or even [http://en.wikipedia.org/wiki/Eden_Park Eden Park] you went to?  --[[User:DamianJohn|DamianJohn]] 00:45, 29 February 2012 (EST)&lt;br /&gt;
:::Fine re citation. For the 3 places you mention, the only one I've been to is Eden Park. [[User:RolandPlankton|RolandPlankton]] 17:56, 29 February 2012 (EST)&lt;br /&gt;
&lt;br /&gt;
==Articles==&lt;br /&gt;
===Articles worked on===&lt;br /&gt;
This list excludes trivial changes such as spelling, grammar, fixing references, and very minor tidying up.&lt;br /&gt;
&lt;br /&gt;
====Major changes made====&lt;br /&gt;
*[[Chomsky hierarchy]] (created)&lt;br /&gt;
*[[Compilation]]&lt;br /&gt;
*[[Compiler]] &lt;br /&gt;
*[[Pi]] Still need to tidy up the section on Pi and the Bible.&lt;br /&gt;
*[[Programming language]] &lt;br /&gt;
&lt;br /&gt;
====Minor changes made====&lt;br /&gt;
*[[BNF]] (created as redirect to [[Backus-Naur Form]])&lt;br /&gt;
*[[Generative grammar]] (created as redirect to [[Chomsky hierarchy]])&lt;br /&gt;
&lt;br /&gt;
====Extensive discussion====&lt;br /&gt;
*[[Talk:Theory of relativity]] discussions re GPS and relativity&lt;br /&gt;
&lt;br /&gt;
===Articles currently being worked on===&lt;br /&gt;
*[[Backus-Naur Form]]&lt;br /&gt;
*[[Context-free grammar]] Add less formal introduction and explain more clearly with examples. Make BNF a separate article.&lt;br /&gt;
&lt;br /&gt;
===Articles to work on===&lt;br /&gt;
====Meaning====&lt;br /&gt;
*[[Grammar]]&lt;br /&gt;
*[[Recursion]]&lt;br /&gt;
*[[Regular grammar]]&lt;br /&gt;
*[[Semantics]]&lt;br /&gt;
*[[Syntax]] currently a redirect to [[grammar]]; could we separate out 'syntax' as relating to computer languages, and 'grammar' as relating to human languages&lt;br /&gt;
&lt;br /&gt;
====Assorted====&lt;br /&gt;
*[[Anglican Communion]]&lt;br /&gt;
*[[Assembly line]]&lt;br /&gt;
*[[Bicycle]]&lt;br /&gt;
*[[Camping]]&lt;br /&gt;
*[[Castle]]&lt;br /&gt;
*[[Church of England]]&lt;br /&gt;
*[[Fantasy]]&lt;br /&gt;
*[[Infinity]]&lt;br /&gt;
*[[Philosophy of science]]&lt;br /&gt;
*[[Rail transport modelling]]&lt;br /&gt;
*[[Science fiction]]&lt;br /&gt;
*[[Tent]]&lt;br /&gt;
*[[The Hobbit]]&lt;br /&gt;
*[[The Lord of the Rings]]&lt;br /&gt;
*[[Tower of London]]&lt;br /&gt;
&lt;br /&gt;
====Biased====&lt;br /&gt;
Need to sort out myth from fact, possibly controversial.&lt;br /&gt;
*[[Evolution]]&lt;br /&gt;
*[[Intelligent design]]&lt;br /&gt;
*[[Pseudoscience]] &lt;br /&gt;
*[[Theory of relativity]]&lt;br /&gt;
*[[Wikipedia copyright]]&lt;br /&gt;
&lt;br /&gt;
====Computer-related====&lt;br /&gt;
*[[Algol 60]]&lt;br /&gt;
*[[Assembly language]]&lt;br /&gt;
*[[BASIC (programming language)]] &lt;br /&gt;
*[[C (programming language)]]&lt;br /&gt;
*[[Cobol]]&lt;br /&gt;
*[[Code maintenance]] could well be merged into [[Computer programming]]&lt;br /&gt;
*[[Computer]] distinguish hardware/software&lt;br /&gt;
*[[Computer program]] merge with [[Computer Program]], latter should be a redirect&lt;br /&gt;
*[[Computer programming]] currently a redirect to [[Computer Programming]], need to swap these over&lt;br /&gt;
*[[Computer science]]&lt;br /&gt;
*[[Computer software]] &lt;br /&gt;
*[[Fortran]]&lt;br /&gt;
*[[Hardware]] could be redirect to [[Computer]]&lt;br /&gt;
*[[Internet]]&lt;br /&gt;
*[[Interpreter (computing)]] &lt;br /&gt;
*[[Machine code]] could be part of [[Programming language]]&lt;br /&gt;
*[[Operating system]]&lt;br /&gt;
*[[Pascal (programming language)]] &lt;br /&gt;
*[[Pseudocode]]&lt;br /&gt;
*[[Software]] should be redirect to [[Computer software]]&lt;br /&gt;
*[[Source code]] could be merged into [[Programming language]]&lt;br /&gt;
*[[World Wide Web]]&lt;br /&gt;
&lt;br /&gt;
== Block ==&lt;br /&gt;
It seems that you were blocked in February... please be careful. --[[User:Joaquín Martínez|Joaquín Martínez]] 19:55, 21 March 2012 (EDT)&lt;br /&gt;
&lt;br /&gt;
: See: 14:23, 4 February 2012, Taj deleted &amp;quot;User:RolandPlankton&amp;quot; ‎ (Vandalism / parody). --[[User:JMR10|Joaquín Martínez]] 09:51, 22 March 2012 (EDT)&lt;br /&gt;
&lt;br /&gt;
::I believe that 4 February 2012 was when I first registered on Conservapedia. My user name was chosen in accordance with CP Guideline: &amp;quot;As a sign of good faith and accountability it is recommended that editors select a user name based on a permutation of their real name.&amp;quot;. Certainly my son was instantly able to recognise my user name as referring to me. [[User:RolandPlankton|RolandPlankton]] 10:02, 22 March 2012 (EDT)&lt;br /&gt;
&lt;br /&gt;
:::Hi, I just wanted to let you know that I answered your question on my talk page - I hope it clears up the misunderstanding. :-) Thanks, [[User:Taj|Taj]] 15:32, 22 March 2012 (EDT)&lt;br /&gt;
&lt;br /&gt;
:::Following is a copy of the answer referred to by Taj:&lt;br /&gt;
:::::Hello, thanks for the question, I looked into it. Please refer to this log: [http://www.conservapedia.com/index.php?title=Special%3ALog&amp;amp;type=delete&amp;amp;user=Taj&amp;amp;page=&amp;amp;year=&amp;amp;month=-1 Deletion Log] for explanation. It appears that on Feb 4, 2012, your User page and talk page were caught in a wave of vandalization along with several other users pages, and since you were a new user, and I, a new admin, apparently I deleted the page as opposed to reverting the offending edits. This had the effect of removing the edits in their entirety, so you were then able to recreate your own User page yourself. The action didn't substantially affect your page, however, I would probably choose to simply revert the edits if I were faced with this same situation today, with a little more experience as an Admin. I hope this clears up the matter, and apologize for any confusion created by this. Thank you for your continued contributions to Conservapedia! Blessings, [[User:Taj|Taj]] 12:50, 22 March 2012 (EDT). Copy made by [[User:RolandPlankton|RolandPlankton]] 16:03, 24 March 2012 (EDT)&lt;br /&gt;
&lt;br /&gt;
:::::: Godspeed! --[[User:Joaquín Martínez|Joaquín Martínez]] 16:41, 24 March 2012 (EDT)&lt;br /&gt;
&lt;br /&gt;
== Compiler ==&lt;br /&gt;
&lt;br /&gt;
I could fix no. 10 and 11; no. 12 has a wrong url. (Not Found). --[[User:Joaquín Martínez|Joaquín Martínez]] 13:19, 5 April 2012 (EDT)&lt;br /&gt;
&lt;br /&gt;
:Joaquin, thanks for your help. Following your example I've managed to correctly locate and sort out the remaining reference. [[User:RolandPlankton|RolandPlankton]] 14:32, 5 April 2012 (EDT)&lt;/div&gt;</summary>
		<author><name>RolandPlankton</name></author>
	</entry>
	<entry>
		<id>https://www.conservapedia.com/index.php?title=BNF&amp;diff=980854</id>
		<title>BNF</title>
		<link rel="alternate" type="text/html" href="https://www.conservapedia.com/index.php?title=BNF&amp;diff=980854"/>
		<updated>2012-05-11T22:26:09Z</updated>

		<summary type="html">&lt;p&gt;RolandPlankton: created as redirect to Backus-Naur Form&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Backus-Naur Form]]&lt;/div&gt;</summary>
		<author><name>RolandPlankton</name></author>
	</entry>
	<entry>
		<id>https://www.conservapedia.com/index.php?title=Backus-Naur_Form&amp;diff=980849</id>
		<title>Backus-Naur Form</title>
		<link rel="alternate" type="text/html" href="https://www.conservapedia.com/index.php?title=Backus-Naur_Form&amp;diff=980849"/>
		<updated>2012-05-11T22:17:52Z</updated>

		<summary type="html">&lt;p&gt;RolandPlankton: create article and provide introduction; details to come&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In the late 1950's, John Backus and Peter Naur developed a notation for describing the syntax (grammar) of [[programming language]]s. This notation is known as '''Backus-Naur Form''' (or BNF), and was first used in the Algol 60 Report&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.masswerk.at/algol60/report.htm&lt;br /&gt;
| title = Revised Report on the Algorithmic Language Algol 60&lt;br /&gt;
| accessdate = 2012-05-11&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
to specify the syntax of Algol 60, and has since been used for specifying the syntax of other programming languages. &lt;br /&gt;
&lt;br /&gt;
A few years earlier, in 1956, the linguist [[Noam Chomsky|Chomsky]] had published&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite journal &lt;br /&gt;
| title = Three models for the description of language &lt;br /&gt;
| year = 1956 &lt;br /&gt;
| last = Chomsky &lt;br /&gt;
| first = Noam &lt;br /&gt;
| journal = IRE Transactions on Information Theory &lt;br /&gt;
| volume = 2 &lt;br /&gt;
| pages = 113–124 &lt;br /&gt;
| url = http://www.chomsky.info/articles/195609--.pdf &lt;br /&gt;
| accessdate = 2012-05-11&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
an article about a [[Chomsky hierarchy|hierarchy]] of formal grammatical systems for describing various classes of languages.  Even though expressed very differently, and developed independently, it turns out that BNF is logically equivalent to Chomsky's level 2 grammar (often referred to as a [[context-free grammar]]).&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>RolandPlankton</name></author>
	</entry>
	<entry>
		<id>https://www.conservapedia.com/index.php?title=Chomsky_hierarchy&amp;diff=980848</id>
		<title>Chomsky hierarchy</title>
		<link rel="alternate" type="text/html" href="https://www.conservapedia.com/index.php?title=Chomsky_hierarchy&amp;diff=980848"/>
		<updated>2012-05-11T22:07:07Z</updated>

		<summary type="html">&lt;p&gt;RolandPlankton: clarify&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The '''Chomsky hierarchy''', sometimes known as the '''Chomsky-Schützenberger hierarchy''', is a hierarchy of formal grammatical systems for describing various classes of languages; the hierarchy can apply to both human and computer languages. This hierarchy was first published in 1956 by the linguist [[Noam Chomsky|Chomsky]].&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite journal &lt;br /&gt;
| title = Three models for the description of language &lt;br /&gt;
| year = 1956 &lt;br /&gt;
| last = Chomsky &lt;br /&gt;
| first = Noam &lt;br /&gt;
| journal = IRE Transactions on Information Theory &lt;br /&gt;
| volume = 2 &lt;br /&gt;
| pages = 113–124 &lt;br /&gt;
| url = http://www.chomsky.info/articles/195609--.pdf &lt;br /&gt;
| accessdate = 2012-04-08&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
These grammatical systems were referred to by Chomsky as ''transformational grammars''.  Other linguists have since developed a variety of similar grammars; together these are known as ''generative grammars''. &lt;br /&gt;
&lt;br /&gt;
The basic idea of a '''generative grammar''' is to provide a set of rules which are capable of generating all possible grammatical sentences in some language; the rules must constrain the generation so that only grammatical sentences are generated. The rules can also be used in reverse to parse a sentence and check if it is grammatical.&lt;br /&gt;
&lt;br /&gt;
In the late 1950's, [[John Backus]] and Peter Naur developed a notation for describing [[programming language]]s. This notation is known as [[Backus Naur Form]] (or BNF) and turns out to be equivalent to Chomsky's grammar number two (context-free grammar), although it was developed independently of Chomsky's work. Backus-Naur Form was first used in the Algol 60 Report to specify the syntax of [[Algol 60]], and has since been used for specifying the syntax of other programming languages. &lt;br /&gt;
&lt;br /&gt;
==Example of a very simple generative grammar==&lt;br /&gt;
This very simple example can handle only a tiny subset of English and should not be taken seriously as a guide to English grammar or vocabulary. It is based on an example by David Crystal&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite book &lt;br /&gt;
| last = Crystal &lt;br /&gt;
| first = David  &lt;br /&gt;
| title = The Cambridge Encyclopedia of Language &lt;br /&gt;
| publisher = Cambridge University Press &lt;br /&gt;
| year = 1987 &lt;br /&gt;
| isbn = 0-521-42443-7&lt;br /&gt;
| pages = page 97&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; and is a slight extension of an example on slide 9 of this lecture.&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.cs.princeton.edu/~rywang/99f126/slides/16th.pdf&lt;br /&gt;
| title = Lecture notes: Formal Languages&lt;br /&gt;
| accessdate = 2012-04-07}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase''         # A ''Sentence'' consists of a ''NounPhrase'' followed by a ''VerbPhrase''&lt;br /&gt;
 ''NounPhrase'' -&amp;gt;  ''Determiner'' ''Noun''               # A ''NounPhrase'' consists of a ''Determiner'' followed by a ''Noun''&lt;br /&gt;
 ''VerbPhrase'' -&amp;gt;  ''Verb'' ''NounPhrase''               # A ''VerbPhrase'' consists of a ''Verb'' followed by a ''NounPhrase''&lt;br /&gt;
 ''Determiner'' -&amp;gt;  '''a''', '''the'''                        # A ''Determiner''  is one of: '''a''' or '''the'''&lt;br /&gt;
 ''Noun''       -&amp;gt;  '''boy''', '''girl''', '''dog'''                # A ''Noun'' is one of: '''boy''' or '''girl''' or '''dog'''  &lt;br /&gt;
 ''Verb''       -&amp;gt;  '''chased''', '''heard''', '''saw'''            # A ''Verb'' is one of: '''chased''' or '''heard''' or '''saw'''&lt;br /&gt;
&lt;br /&gt;
Notation used above: &lt;br /&gt;
:The symbol &amp;quot;-&amp;gt;&amp;quot; means &amp;quot;can be replaced by&amp;quot;.  &lt;br /&gt;
:When there are several items on the right hand side separated by commas, just one of these items can be selected. &lt;br /&gt;
:The comments preceded by &amp;quot;#&amp;quot; are not part of the generative grammar, but hopefully will help folks understand the example a little better.&lt;br /&gt;
&lt;br /&gt;
By making appropriate substitutions we can generate such sentences as:&lt;br /&gt;
:The dog chased a girl.&lt;br /&gt;
:The girl heard the dog.&lt;br /&gt;
:The boy saw a girl.&lt;br /&gt;
&lt;br /&gt;
The stages in the generation of these examples are as follows:&lt;br /&gt;
:''Sentence''&lt;br /&gt;
:-&amp;gt; ''NounPhrase'' ''VerbPhrase''&lt;br /&gt;
:-&amp;gt; ''Determiner'' ''Noun'' ''Verb'' ''NounPhrase''&lt;br /&gt;
:-&amp;gt; ''Determiner'' ''Noun'' ''Verb'' ''Determiner'' ''Noun''&lt;br /&gt;
&lt;br /&gt;
By appropriate selection of words to substitute for ''Determiner'', ''Noun'', and ''Verb'' we can produce the 3 example sentences above.&lt;br /&gt;
&lt;br /&gt;
The simple grammar defines a few words which can be substituted for ''Determiner'', ''Noun'', and ''Verb''. There are two possibilities for ''Determiner'', three for ''Noun'', and three for ''Verb'', with both ''Determiner'' and ''Noun'' appearing twice in the expansion. Hence the total number of grammatical sentences which can be generated by this simple grammar is 108 (= 2 * 3 * 3 * 2 * 3). In this particular case the possible words have been carefully chosen so that all of these 108 sentences also actually mean something.&lt;br /&gt;
&lt;br /&gt;
Note that the use of ''italics'' and '''boldface''' in this example is merely a convenient way of indicating the difference between items which can be expanded further (e.g. concepts such as ''NounPhrase'') and items which can not be expanded further (e.g. words such as '''girl'''). In the linguistic literature, items which can be expanded further are referred to as 'non-terminal' items, while items which can't be expanded further are known as 'terminal' items.&lt;br /&gt;
&lt;br /&gt;
The 'comma' notation for alternatives is a form of shorthand. In some formulations this would be shown as several separate rules, so that:&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''a''', '''the''' &lt;br /&gt;
could be shown as two rules:&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''a'''&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''the''' &lt;br /&gt;
&lt;br /&gt;
==Caution==&lt;br /&gt;
While a generative grammar may produce sentences which are grammatically correct, there is no certainty that such sentences will actually mean anything. The classic example of such a meaningless sentence is from Chomsky's book&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite book &lt;br /&gt;
| last = Chomsky &lt;br /&gt;
| first = Noam &lt;br /&gt;
| title = Syntactic Structures &lt;br /&gt;
| year = 1957 &lt;br /&gt;
| publisher = Mouton &lt;br /&gt;
| location = The Hague/Paris &lt;br /&gt;
| pages = page 15 &lt;br /&gt;
| isbn = 3-11-017279-8&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; with the grammatically correct sentence:&lt;br /&gt;
&lt;br /&gt;
:&amp;quot;Colorless green ideas sleep furiously.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
:This example illustrates the difference between grammar/syntax and meaning/semantics.&lt;br /&gt;
&lt;br /&gt;
Another problem when analysing a sentence is that many English words have multiple meanings, so that there may be more than one way to interpret a sentence. A simple example is the sentence: &lt;br /&gt;
:&amp;quot;Time flies.&amp;quot; &lt;br /&gt;
:Is this an instruction to check how fast flies are flying, or an indication that time appears to be passing quickly? &lt;br /&gt;
:A varied and entertaining selection of such ambiguities has been compiled by Jeff Gray.&amp;lt;ref&amp;gt;{{Cite web &lt;br /&gt;
| title = Collection of Ambiguous or Inconsistent/Incomplete Statements  &lt;br /&gt;
| url = http://www.gray-area.org/Research/Ambig/ &lt;br /&gt;
| author = Jeff Gray&lt;br /&gt;
| accessdate = 2012-04-10&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Formal grammar==&lt;br /&gt;
'''Note''': this section and subsequent sections are, by necessity, slightly more technical/formal than the earlier parts of this article, though specialist notation and abbreviations have been largely avoided. Make sure that you understand the 'Simple example' above before proceeding further, since references will be made to that example to help explain the technicalities, and variations on that example will be used to illustrate new ideas. &lt;br /&gt;
&lt;br /&gt;
A formal generative grammar has four components (as described in slide 19 of this lecture&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://adammikeal.org/courses/compute/Chomsky%20Presentation.pdf&lt;br /&gt;
| title = The Chomsky Hierarchy&lt;br /&gt;
| accessdate = 2012-04-06&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
):&lt;br /&gt;
# a finite number of non-terminal concepts (e.g. ''VerbPhrase'' in the example, or anything else in ''italics''),&lt;br /&gt;
# a finite number of terminal items (e.g. '''girl''' in the example, or anything else in '''bold-face''').&lt;br /&gt;
# a finite set of rules for transforming non-terminal items (e.g. the example has 6 rules).&lt;br /&gt;
# a single starting point (e.g. ''Sentence'' in the example).&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
:Terminal items are those which can not be transformed into anything else.&lt;br /&gt;
:A list of all the terminal items is effectively the vocabulary from which sentences are built.&lt;br /&gt;
:Non-terminal items are those which can be transformed into something else.&lt;br /&gt;
:Linguists have developed various classes of grammars by using constraints to govern what sort of rules can be used for any particular grammar.&lt;br /&gt;
&lt;br /&gt;
===Changing the rules===&lt;br /&gt;
An relatively small change to even a single rule can make a large change in the language which can be generated. For example, change the first rule in the simple example to read:&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''NounPhrase'' ''VerbPhrase'' '''and''' ''NounPhrase'' ''VerbPhrase''&lt;br /&gt;
This means that a ''Sentence'' is either a ''NounPhrase'' followed by a ''VerbPhrase'' or a ''NounPhrase'' followed by a ''VerbPhrase'' followed by '''and''' followed by a ''NounPhrase'' followed by a ''VerbPhrase''. In addition to the shorter sentences already discussed, this could also generate a sentence such as: &amp;quot;A dog saw a girl and the dog chased the girl&amp;quot;. The total number of grammatically-correct sentences which can be generated by this modified grammar is now 11,772 (108 + 108*108), though some of these may not be very meaingful.&lt;br /&gt;
&lt;br /&gt;
===Towards infinity===&lt;br /&gt;
A significantly different rule change can have an astounding effect. Consider changing the first rule to read:&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''NounPhrase'' ''VerbPhrase'' '''and''' ''Sentence''&lt;br /&gt;
This can generate a potentially infinite number of sentences (any number of these five-word sentences linked by '''and'''). This is an example of what is known as a [[Recursion|recursive]] definition, whereby a ''Sentence'' is partially defined in terms of itself. In such a recursive rule there must be at least one transformation option which does not involve ''Sentence'', otherwise the transformation could never stop.&lt;br /&gt;
&lt;br /&gt;
The above change is known as right-recursive; a left-recursive formulation is also possible, and can in this example generate exactly the same sentences. As shown below  under 'Context-free grammar', there are situations where the choice of left- or right-recursive formulations can change the meaning. &lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''Sentence'' '''and''' ''NounPhrase'' ''VerbPhrase'' &lt;br /&gt;
&lt;br /&gt;
The distinction between left- and right-recursive grammars becomes important when trying to parse/analyse a sentence; some types of parser work best with left-recursive grammars, while other types work best with right-recursive grammars. This distinction is particularly relevant in connection with [[compiler|compiling or translating]] a program written in some high-level [[programming language]] so that it can be used on a [[computer]].&lt;br /&gt;
&lt;br /&gt;
==Chomsky hierarchy==&lt;br /&gt;
By imposing different constraints&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.cs.uaf.edu/2011/spring/cs331/lectures/cs331_20110124_grammar.html&lt;br /&gt;
| title = Lecture notes: Languages &amp;amp; Grammars&lt;br /&gt;
| accessdate = 2012-04-07&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; &lt;br /&gt;
as to what sort of transformation rules could be used, Chomsky was able to define four strictly nested transformational grammars, which he numbered from 0 to 3. As the grammar number increases, the generated language becomes simpler. As the grammar number decreases, parsing a sentence in that language becomes more difficult.&lt;br /&gt;
Other linguists have described formal grammars which fit in between the various Chomsky levels. &lt;br /&gt;
&lt;br /&gt;
The following table provides a summary, which is then explained further in the subsequent subsections.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!| Chomsky&amp;lt;br&amp;gt;number || linguistic name || Rule constraints || Recogniser+ || Notes &lt;br /&gt;
|-&lt;br /&gt;
| 0 || recursively enumerable || [anything] -&amp;gt; [anything] || Turing machine || most human languages &lt;br /&gt;
|-&lt;br /&gt;
| 1 || context-sensitive || X ''A'' Y -&amp;gt; X [anything] Y || linear bounded automaton || X and Y provide the context in which ''A'' can be transformed &lt;br /&gt;
|-&lt;br /&gt;
| 2 || context-free || ''A'' -&amp;gt; [anything] || non-deterministic push-down automaton || syntax analysis for most programming languages &lt;br /&gt;
|-&lt;br /&gt;
| 3 || regular || ''A'' -&amp;gt; [nothing]&amp;lt;br&amp;gt;''A'' -&amp;gt; '''xyz'''&amp;lt;br&amp;gt;''A'' -&amp;gt; '''xyz''' ''B'' || finite automaton&amp;lt;br&amp;gt;or finite state machine || lexical analysis (combining characters into words/tokens)  &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''+''' The '''recogniser''' column indicates the type of mathematical or computer science theoretical model needed to recognise that a sentence belongs to a language, essentially by applying the transformation rules in reverse to work backwards from the actual words in order to finish up with a ''sentence'' (in programming languages the starting concept is usually a ''program''). A finite automaton uses only a small fixed amount of memory, operates in time proportional to the length of the input, and always reaches a decision, while a Turing machine may use an infinite amount of memory and time and may fail to reach a decision (may never stop).&lt;br /&gt;
&lt;br /&gt;
In the linguistic literature, [nothing] is often represented by the symbol '''ε'''.&lt;br /&gt;
&lt;br /&gt;
The descriptions of the various Chomsky levels which follow are presented in reverse order, so as to work up from a simple case to a rather complicated case.&lt;br /&gt;
&lt;br /&gt;
===Level 3: regular grammar===&lt;br /&gt;
The transformation rules for regular grammars are required to be very simple. &lt;br /&gt;
*Only a single non-terminal item can appear on the left-hand side of a rule.&lt;br /&gt;
*The right-hand side of any rule must be one of:&lt;br /&gt;
**[nothing].&lt;br /&gt;
**a terminal item.&lt;br /&gt;
**a terminal item followed by a non-terminal item.&lt;br /&gt;
Note that instead of a terminal item we could have a non-terminal item whose transformation rule immediately resolves to a single terminal item, or to one of several terminal items.&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
Informally we can define a 'word' as a sequence of one or more ''Letter''s. The following regular grammar provides a more formal definition; for simplicity it is restricted to lower-case letters.&lt;br /&gt;
&lt;br /&gt;
 ''Word''     -&amp;gt; ''Letter'' ''PartWord''&lt;br /&gt;
 ''PartWord'' -&amp;gt; [nothing]&lt;br /&gt;
 ''PartWord'' -&amp;gt; ''Letter'' ''PartWord''&lt;br /&gt;
 ''Letter''   -&amp;gt; '''a''', '''b''', ... '''z'''&lt;br /&gt;
&lt;br /&gt;
Note that ''PartWord'' is recursively defined, with the recursion stopping if it is transformed into [nothing].&lt;br /&gt;
&lt;br /&gt;
For one-letter words we expand as: &lt;br /&gt;
:''Word'' -&amp;gt; ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' [nothing] -&amp;gt; ''Letter''&lt;br /&gt;
&lt;br /&gt;
For two-letter words we expand as: &lt;br /&gt;
:''Word'' -&amp;gt; ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' ''Letter'' [nothing] -&amp;gt;  ''Letter'' ''Letter''&lt;br /&gt;
&lt;br /&gt;
Obviously, words of any length can be constructed, though they may well not actually be words from any language. &lt;br /&gt;
&lt;br /&gt;
====Discussion====&lt;br /&gt;
Trying to devise transformation rules to produce words which are more English-like is much more difficult - how do you insist on at least one vowel or on no more than 5 consecutive consonants (e.g. as in 'strengths').&lt;br /&gt;
&lt;br /&gt;
Further examples in [[Regular grammar]] show how numbers can be defined via a regular grammar, and also show how a hyphenated word could be defined.&lt;br /&gt;
&lt;br /&gt;
One of the limitations of a regular grammar is that it can't cope with nested matching brackets, so that it is impossible to write a regular grammar to describe an expression such as '''2 * (3+4)''' where that grammar is expected to allow brackets nested to any depth. A context-free grammar is needed for this, as described in the next section.&lt;br /&gt;
&lt;br /&gt;
Regular grammars or equivalent are widely used by [[compiler]]s in the lexical analysis of programming languages.&lt;br /&gt;
&lt;br /&gt;
===Level 2: context-free grammar===&lt;br /&gt;
The transformation rules for context-free grammars don't appear that much different from those for regular grammars. &lt;br /&gt;
*Only a single non-terminal item can appear on the left-hand side of a rule.&lt;br /&gt;
*The right-hand side of any rule must be one of:&lt;br /&gt;
**[nothing].&lt;br /&gt;
**any combination of terminal items and non-terminal items.&lt;br /&gt;
&lt;br /&gt;
The key difference is that in a regular grammar, any non-empty rule must effectively start with terminal item so that every rule transformation makes some immediate progress, while in a context-free grammar a rule could start with a non-terminal item which itself could be subject to arbitrary further transformations.&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
The following example shows how context-free grammars can cope with arithmetic expressions involving possibly nested brackets. Also an expression such as &amp;quot;2 + 3 * 4&amp;quot; could be interpreted as either &amp;quot;(2 + 3) * 4&amp;quot; = 20 or as &amp;quot;2 + (3 * 4)&amp;quot; = 14. The latter interpretation is that which is normally used - multiplication &amp;quot;*&amp;quot; is said to have a higher priority than addition &amp;quot;+&amp;quot; - so the grammar must incorporate this priority concept. Furthermore, consecutive operators of the same priority are normally applied from left to right, so that &amp;quot;8 - 2 + 3&amp;quot; is interpreted as &amp;quot;(8 - 2) + 3&amp;quot; = 9, rather than as &amp;quot;8 - (2 + 3)&amp;quot; = 3.  This ordering must also be built in to the grammar.&lt;br /&gt;
&lt;br /&gt;
To avoid distracting side-issues, this example only deals with numbers which consist solely of a single digit. The example is a simplified version of the definition of an arithmetic expression given in the Revised Algol 60 Report (Section 3.3.1).&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.masswerk.at/algol60/report.htm&lt;br /&gt;
| title = Revised Report on the Algorithmic Language Algol 60&lt;br /&gt;
| accessdate = 2012-04-22&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ''Expression'' -&amp;gt; ''Term''                        # an ''Expression'' is either a ''Term''&lt;br /&gt;
 ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''    #   or an ''Expression'' followed by '''+''' or '''-''' followed by a ''Term''&lt;br /&gt;
                                           #&lt;br /&gt;
 ''Term''       -&amp;gt; ''Primary''                     # a ''Term'' is either a ''Primary''&lt;br /&gt;
 ''Term''       -&amp;gt; ''Term'' ''MulDivOp'' ''Primary''       #   or a ''Term'' followed by '''*''' or '''/''' followed by a ''Primary''&lt;br /&gt;
                                           #&lt;br /&gt;
 ''Primary''    -&amp;gt; ''Number''                      # a ''Primary'' is either a ''Number''&lt;br /&gt;
 ''Primary''    -&amp;gt; '''(''' ''Expression'' ''')'''              #   or an ''Expression'' enclosed in brackets&lt;br /&gt;
                                           #&lt;br /&gt;
 ''MulDivOp''   -&amp;gt; '''*'''. '''/'''                        # multiplication and division have the same priority&lt;br /&gt;
 ''AddSubOp''   -&amp;gt; '''+'''. '''-'''                        # addition and subtraction have the same priority&lt;br /&gt;
 ''Number''     -&amp;gt; '''0''', '''1''', ... '''9'''                 # this simple-minded definition of a ''Number'' is enough for this example&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
* Both ''Expression'' and ''Term'' are each defined via a left-recursive rule; this ensures that operators of the same priority are applied from left to right.&lt;br /&gt;
* The distinction between ''Expression'' and ''Term'' ensures that multiplication/division are applied before addition/subtraction.&lt;br /&gt;
* ''Expression'' is indirectly recursive via ''Term'' and ''Primary'' to allow bracketed sub-expressions to any depth.&lt;br /&gt;
&lt;br /&gt;
Example 1: generate 2 + 3 * 4&lt;br /&gt;
&lt;br /&gt;
  ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Term'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Primary'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' ''Term''                                 # '''+''' can not be applied until ''Term'' has been evaluated&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' ''Term'' ''MulDivOp'' ''Primary''&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' ''Primary'' ''MulDipOp'' ''Primary''&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' '''3''' '''*''' '''4'''&lt;br /&gt;
&lt;br /&gt;
Example 2: generate 2 * 3 + 4&lt;br /&gt;
&lt;br /&gt;
  ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Term'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Term'' ''MulDivOp'' ''Primary'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Primary'' ''MulDivOp'' ''Primary'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; '''2''' '''*''' '''3''' ''AddSubOp'' ''Term''                      # ''Term'' to left of ''AddSubOp'' is evaluated first&lt;br /&gt;
             -&amp;gt; '''2''' '''*''' '''3''' ''AddSubOp'' ''Primary''  &lt;br /&gt;
             -&amp;gt; '''2''' '''*''' '''3''' '''+''' '''4'''&lt;br /&gt;
&lt;br /&gt;
====Discussion====&lt;br /&gt;
Context-free grammars (or equivalent definitions using Backus-Naur-Form) are widely used both to define the syntax of programming languages and to (semi-automatically) generate parsers for these languages.&lt;br /&gt;
&lt;br /&gt;
A limitation/feature of both regular grammars and context-free grammars is that the left-hand side of any rule is always a single non-terminal item, so any transformation is applied regardless of the context in which that non-terminal item appears.  A simple example which depends on context is the use of singular and plural nouns and verbs in English.  We say: '''the man runs''' or '''the men run''', but neither of '''the man run''' nor '''the men runs'''.  Which form of verb to use depends on the noun, i.e. there is a context dependency.&lt;br /&gt;
&lt;br /&gt;
===Level 1: context-sensitive grammar===&lt;br /&gt;
For context-sensitive grammars the left-hand side of a rule may indicate the context in which that rule applies, so that the same non-terminal item may be transformed in different ways depending on the context in which it appears.&lt;br /&gt;
&lt;br /&gt;
There is only one transformation rule for context-sensitive grammars:&lt;br /&gt;
*X [non-terminal] Y -&amp;gt; X [anything] Y&lt;br /&gt;
&lt;br /&gt;
where X and Y determine the context in which the [non-terminal] is transformed. Note that X and Y may each be terminals or non-terminals or [nothing]. When both X and Y are nothing there is no context and this reduces to a Level 2 or Level 3 grammar.&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
Taylor has provided several examples&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.divms.uiowa.edu/~fleck/taylor.pdf&lt;br /&gt;
| title = Context-sensitive Examples&lt;br /&gt;
| author = Taylor&lt;br /&gt;
| accessdate = 2012-04-26&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
and the following, inspired by his third example, is an extension of the original simple example above to handle singulars and plurals:&lt;br /&gt;
&lt;br /&gt;
 ''Sentence''                -&amp;gt;  ''NounPhrase'' ''VerbPhrase''            # simple sentence structure&lt;br /&gt;
 ''NounPhrase''              -&amp;gt;  ''Determiner'' ''Noun''                  # simple phrase structure&lt;br /&gt;
 ''VerbPhrase''              -&amp;gt;  ''Verb'' ''NounPhrase''                  # simple phrase structure&lt;br /&gt;
                                                              #&lt;br /&gt;
 ''Noun''                    -&amp;gt;  ''SingularNoun'', ''PluralNoun''         # nouns can be singular or plural &lt;br /&gt;
                                                              #&lt;br /&gt;
 ''Determiner'' ''SingularNoun'' -&amp;gt;  ''SingularDeterminer'' ''SingularNoun''  # context-sensitive:&lt;br /&gt;
 ''Determiner'' ''PluralNoun''   -&amp;gt;  ''PluralDeterminer'' ''PluralNoun''      #    determiner must agree with noun&lt;br /&gt;
                                                              #&lt;br /&gt;
 ''SingularNoun'' ''Verb''       -&amp;gt;  ''SingularNoun'' ''SingularVerb''        # context-sensitive: &lt;br /&gt;
 ''PluralNoun'' ''Verb''         -&amp;gt;  ''PluralNoun'' ''PluralVerb''            #    verb must agree with noun&lt;br /&gt;
                                                              #&lt;br /&gt;
 ''SingularDeterminer''      -&amp;gt;  '''a''', '''the'''                           # singular determiners&lt;br /&gt;
 ''PluralDeterminer''        -&amp;gt;  '''the'''                              # plural determiners&lt;br /&gt;
                                                              #&lt;br /&gt;
 ''SingularNoun''            -&amp;gt;  '''boy''', '''sheep''', '''dog'''                  # singular nouns&lt;br /&gt;
 ''PluralNoun''              -&amp;gt;  '''boys''', '''sheep''', '''dogs'''                # plural nouns&lt;br /&gt;
                                                              #&lt;br /&gt;
 ''SingularVerb''            -&amp;gt;  '''chases''', '''hears''', '''sees'''              # singular verbs&lt;br /&gt;
 ''PluralVerb''              -&amp;gt;  '''chase''', '''hear''', '''see'''                 # plural verbs&lt;br /&gt;
&lt;br /&gt;
The above grammar can generate sentences such as: '''a boy chases a dog''', '''the boys chase a dog''', etc. Because some words have the same form in both singular and plural, it can also generate meaningful (and grammatically-correct) sentences such as: '''the sheep sees the dog''', '''the sheep see the dog'''.&lt;br /&gt;
&lt;br /&gt;
But the above grammar can NOT generate sentences such as: '''a boys chases the sheep''', since this would violate the context-sensitive rules.&lt;br /&gt;
&lt;br /&gt;
====Discussion====&lt;br /&gt;
It is in fact possible to handle singular/plural issues by using only a Level 2 context-free grammar, but the above rules expressed as a Level 1 context-sensitive grammar are a closer match to ordinary concepts of English grammar (e.g. nouns and verbs must agree in number i.e. singular/plural).&lt;br /&gt;
&lt;br /&gt;
===Level 0: recursively enumerable grammar===&lt;br /&gt;
A recursively enumerable grammar has absolutely no restriction on what sort of transformation rules can be applied; hence it is also known as an unrestricted grammar. Rules take the general form:&lt;br /&gt;
*[anything] -&amp;gt; [anything]&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
The following rules can generate all symbols of the form: abc, aabbcc, aaabbbccc, etc., where there are equal numbers of a's, b's and c's. This example is taken from a lecture.&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.cs.utexas.edu/~cline/ear/Slides/Turing/TuringSlides3.doc&lt;br /&gt;
| title = Grammars, Recursively Enumerable Languages, and Turing Machines&lt;br /&gt;
| accessdate = 2012-05-10&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ''S''   -&amp;gt; '''a''' ''B'' ''S'' '''c'''&lt;br /&gt;
 ''S''   -&amp;gt; '''a''' ''B'' '''c'''&lt;br /&gt;
 ''B'' '''a''' -&amp;gt; '''a''' ''B''&lt;br /&gt;
 ''B'' '''c''' -&amp;gt; '''b''' '''c'''&lt;br /&gt;
 ''B'' '''b''' -&amp;gt; '''b''' '''b'''&lt;br /&gt;
&lt;br /&gt;
The derivations of the first three items in this infinite sequence are:&lt;br /&gt;
&lt;br /&gt;
# ''S'' -&amp;gt; '''a'''''B'''''c''' -&amp;gt; '''abc'''&lt;br /&gt;
# ''S'' -&amp;gt; '''a'''''BS'''''c''' -&amp;gt; '''a'''''B'''''a'''''B'''''cc''' -&amp;gt; '''aa'''''B B'''''cc''' -&amp;gt; '''aa'''''B'''''bcc''' -&amp;gt; '''aabbcc'''&lt;br /&gt;
# ''S'' -&amp;gt; '''a'''''BS'''''c''' -&amp;gt; '''a'''''B'''''a'''''BS'''''cc''' -&amp;gt; '''a'''''B'''''a'''''B'''''a'''''B'''''ccc''' -&amp;gt; '''aa'''''BB'''''a'''''B'''''ccc''' -&amp;gt; '''aa'''''B'''''a'''''BB'''''ccc''' -&amp;gt; '''aaa'''''BBB'''''ccc''' -&amp;gt; '''aaa'''''BB'''''bccc''' -&amp;gt; '''aaa'''''B'''''bbccc''' -&amp;gt; '''aaabbbccc'''&lt;br /&gt;
&lt;br /&gt;
===Beyond Level 0===&lt;br /&gt;
These lecture notes&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.google.co.uk/url?sa=t&amp;amp;rct=j&amp;amp;q=recursively+enumerable+languages+examples&amp;amp;source=web&amp;amp;cd=4&amp;amp;ved=0CF4QFjAD&amp;amp;url=http%3A%2F%2Fwww.cs.colostate.edu%2F~massey%2FTeaching%2Fcs301%2FRestrictedAccess%2FSlides%2F301lecture23.pdf&amp;amp;ei=6qelT4KMA6SA0AXIu7CQBA&amp;amp;usg=AFQjCNG3fc1mD7g5f-14vfDPdvyX2uScDg&lt;br /&gt;
| title = Recursive and Recursively Enumerable Languages&lt;br /&gt;
| accessdate = 2012-05-05&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
show that languages exist which can not be described by any set of rules. As is common with logical proofs of this nature, the proof doesn't actually produce or demonstrate such a language.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[category:linguistics]]&lt;br /&gt;
[[Category:Computer Science]]&lt;/div&gt;</summary>
		<author><name>RolandPlankton</name></author>
	</entry>
	<entry>
		<id>https://www.conservapedia.com/index.php?title=User_talk:RolandPlankton&amp;diff=980838</id>
		<title>User talk:RolandPlankton</title>
		<link rel="alternate" type="text/html" href="https://www.conservapedia.com/index.php?title=User_talk:RolandPlankton&amp;diff=980838"/>
		<updated>2012-05-11T21:40:38Z</updated>

		<summary type="html">&lt;p&gt;RolandPlankton: /* Assorted */ add Infinity&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{welcome|sig=[[User:Joaquín Martínez|Joaquín Martínez]] 19:52, 21 March 2012 (EDT)}}&lt;br /&gt;
&lt;br /&gt;
==Rugby World Cup==&lt;br /&gt;
&lt;br /&gt;
Do you doubt the truth of the phrase you wanted cited? Its not a sentiment I share, and its bloody hard to find a cite for that sort of thing, but I don't think the sentiment is untrue for a casual fan.  I know from talking to non-rugby people that the low number of tries and the general style of play turns a lot of people off.  It doesn't turn me off, nor perhaps you, but I think it undisputable that it turns many off.  --[[User:DamianJohn|DamianJohn]] 17:30, 12 February 2012 (EST)&lt;br /&gt;
:Hi Damian, In [Rugby World Cup], the phrase &amp;quot;the sudden death nature of the later stages tend to produce dour rugby that is often unattractive to casual fans&amp;quot; may or may not be true, but it looks rather like opinion and contains vague words &amp;quot;tend to produce&amp;quot;, and hence needs to be attributed to someone. If no attribution can be found then the phrase should be deleted. I believe that this approach is in accordance with the Conservapedia Commandments and the Manual of Style. [[User:RolandPlankton|RolandPlankton]] 13:23, 13 February 2012 (EST)&lt;br /&gt;
::Well, perhaps, but there is also points 10 and 13 in the [http://www.conservapedia.com/Conservapedia:How_Conservapedia_Differs_from_Wikipedia differences with Wikipedia] page to consider which is appropriate here.  Remember also that on this website, personal conversations are a sufficient source [http://www.conservapedia.com/Essay:25_Worst_Court_Decisions#cite_note-8 for observations].  I do hear what you are saying, but I think that the claim being made is so obviously true, that the referencing standards of this website do not require a cite.  --[[User:DamianJohn|DamianJohn]] 13:32, 13 February 2012 (EST)&lt;br /&gt;
:::As someone who has a scientific background, I'm rather unhappy with the phrase 'obviously true', since there have been plenty of examples over the last 1000 years or so when what is 'obviously true' turns out to be false.  Another question: what is 'dour rugby'?  Unless you can provide an attribution I would suggest toning the comment down a little to read at the end: &amp;quot;turns some people off.&amp;quot; [[User:RolandPlankton|RolandPlankton]] 14:37, 13 February 2012 (EST)&lt;br /&gt;
&lt;br /&gt;
Pause in discussion please. I'm off on pilgrimage to the Holy Land for nearly 2 weeks. [[User:RolandPlankton|RolandPlankton]] 14:01, 14 February 2012 (EST)&lt;br /&gt;
:I wouldn't worry about it too much.  I don't think the rugby world cup article is high on the list of priorities for anyone here.  --[[User:DamianJohn|DamianJohn]] 17:08, 14 February 2012 (EST)&lt;br /&gt;
::I have added a citation for your reading pleasure.  Ps How is [http://en.wikipedia.org/wiki/Millennium_Stadium Cardiff Arms Park] these days?Or was it [http://en.wikipedia.org/wiki/Ellis_Park_Stadium Ellis Park], or even [http://en.wikipedia.org/wiki/Eden_Park Eden Park] you went to?  --[[User:DamianJohn|DamianJohn]] 00:45, 29 February 2012 (EST)&lt;br /&gt;
:::Fine re citation. For the 3 places you mention, the only one I've been to is Eden Park. [[User:RolandPlankton|RolandPlankton]] 17:56, 29 February 2012 (EST)&lt;br /&gt;
&lt;br /&gt;
==Articles worked on==&lt;br /&gt;
This list excludes trivial changes such as spelling, grammar, fixing references, and very minor tidying up.&lt;br /&gt;
&lt;br /&gt;
===Major changes made===&lt;br /&gt;
*[[Chomsky hierarchy]] (created)&lt;br /&gt;
*[[Compilation]]&lt;br /&gt;
*[[Compiler]] &lt;br /&gt;
*[[Pi]] Still need to tidy up the section on Pi and the Bible.&lt;br /&gt;
*[[Programming language]] &lt;br /&gt;
&lt;br /&gt;
===Minor changes made===&lt;br /&gt;
*[[Generative grammar]] (created as redirect to [[Chomsky hierarchy]])&lt;br /&gt;
&lt;br /&gt;
===Extensive discussion===&lt;br /&gt;
*[[Talk:Theory of relativity]] discussions re GPS and relativity&lt;br /&gt;
&lt;br /&gt;
==Articles currently being worked on==&lt;br /&gt;
*[[Backus-Naur Form]]&lt;br /&gt;
*[[BNF]] redirect to [[Backus-Naur Form]]&lt;br /&gt;
*[[Context-free grammar]] Add less formal introduction and explain more clearly with examples. Make BNF a separate article.&lt;br /&gt;
&lt;br /&gt;
==Articles to work on==&lt;br /&gt;
===Meaning===&lt;br /&gt;
*[[Grammar]]&lt;br /&gt;
*[[Recursion]]&lt;br /&gt;
*[[Regular grammar]]&lt;br /&gt;
*[[Semantics]]&lt;br /&gt;
*[[Syntax]] currently a redirect to [[grammar]]; could we separate out 'syntax' as relating to computer languages, and 'grammar' as relating to human languages&lt;br /&gt;
&lt;br /&gt;
===Assorted===&lt;br /&gt;
*[[Anglican Communion]]&lt;br /&gt;
*[[Assembly line]]&lt;br /&gt;
*[[Bicycle]]&lt;br /&gt;
*[[Camping]]&lt;br /&gt;
*[[Castle]]&lt;br /&gt;
*[[Church of England]]&lt;br /&gt;
*[[Fantasy]]&lt;br /&gt;
*[[Infinity]]&lt;br /&gt;
*[[Philosophy of science]]&lt;br /&gt;
*[[Rail transport modelling]]&lt;br /&gt;
*[[Science fiction]]&lt;br /&gt;
*[[Tent]]&lt;br /&gt;
*[[The Hobbit]]&lt;br /&gt;
*[[The Lord of the Rings]]&lt;br /&gt;
*[[Tower of London]]&lt;br /&gt;
&lt;br /&gt;
===Biased===&lt;br /&gt;
Need to sort out myth from fact, possibly controversial.&lt;br /&gt;
*[[Evolution]]&lt;br /&gt;
*[[Intelligent design]]&lt;br /&gt;
*[[Pseudoscience]] &lt;br /&gt;
*[[Theory of relativity]]&lt;br /&gt;
*[[Wikipedia copyright]]&lt;br /&gt;
&lt;br /&gt;
===Computer-related===&lt;br /&gt;
*[[Algol 60]]&lt;br /&gt;
*[[Assembly language]]&lt;br /&gt;
*[[BASIC (programming language)]] &lt;br /&gt;
*[[C (programming language)]]&lt;br /&gt;
*[[Cobol]]&lt;br /&gt;
*[[Code maintenance]] could well be merged into [[Computer programming]]&lt;br /&gt;
*[[Computer]] distinguish hardware/software&lt;br /&gt;
*[[Computer program]] merge with [[Computer Program]], latter should be a redirect&lt;br /&gt;
*[[Computer programming]] currently a redirect to [[Computer Programming]], need to swap these over&lt;br /&gt;
*[[Computer science]]&lt;br /&gt;
*[[Computer software]] &lt;br /&gt;
*[[Fortran]]&lt;br /&gt;
*[[Hardware]] could be redirect to [[Computer]]&lt;br /&gt;
*[[Internet]]&lt;br /&gt;
*[[Interpreter (computing)]] &lt;br /&gt;
*[[Machine code]] could be part of [[Programming language]]&lt;br /&gt;
*[[Operating system]]&lt;br /&gt;
*[[Pascal (programming language)]] &lt;br /&gt;
*[[Pseudocode]]&lt;br /&gt;
*[[Software]] should be redirect to [[Computer software]]&lt;br /&gt;
*[[Source code]] could be merged into [[Programming language]]&lt;br /&gt;
*[[World Wide Web]]&lt;br /&gt;
&lt;br /&gt;
== Block ==&lt;br /&gt;
It seems that you were blocked in February... please be careful. --[[User:Joaquín Martínez|Joaquín Martínez]] 19:55, 21 March 2012 (EDT)&lt;br /&gt;
&lt;br /&gt;
: See: 14:23, 4 February 2012, Taj deleted &amp;quot;User:RolandPlankton&amp;quot; ‎ (Vandalism / parody). --[[User:JMR10|Joaquín Martínez]] 09:51, 22 March 2012 (EDT)&lt;br /&gt;
&lt;br /&gt;
::I believe that 4 February 2012 was when I first registered on Conservapedia. My user name was chosen in accordance with CP Guideline: &amp;quot;As a sign of good faith and accountability it is recommended that editors select a user name based on a permutation of their real name.&amp;quot;. Certainly my son was instantly able to recognise my user name as referring to me. [[User:RolandPlankton|RolandPlankton]] 10:02, 22 March 2012 (EDT)&lt;br /&gt;
&lt;br /&gt;
:::Hi, I just wanted to let you know that I answered your question on my talk page - I hope it clears up the misunderstanding. :-) Thanks, [[User:Taj|Taj]] 15:32, 22 March 2012 (EDT)&lt;br /&gt;
&lt;br /&gt;
:::Following is a copy of the answer referred to by Taj:&lt;br /&gt;
:::::Hello, thanks for the question, I looked into it. Please refer to this log: [http://www.conservapedia.com/index.php?title=Special%3ALog&amp;amp;type=delete&amp;amp;user=Taj&amp;amp;page=&amp;amp;year=&amp;amp;month=-1 Deletion Log] for explanation. It appears that on Feb 4, 2012, your User page and talk page were caught in a wave of vandalization along with several other users pages, and since you were a new user, and I, a new admin, apparently I deleted the page as opposed to reverting the offending edits. This had the effect of removing the edits in their entirety, so you were then able to recreate your own User page yourself. The action didn't substantially affect your page, however, I would probably choose to simply revert the edits if I were faced with this same situation today, with a little more experience as an Admin. I hope this clears up the matter, and apologize for any confusion created by this. Thank you for your continued contributions to Conservapedia! Blessings, [[User:Taj|Taj]] 12:50, 22 March 2012 (EDT). Copy made by [[User:RolandPlankton|RolandPlankton]] 16:03, 24 March 2012 (EDT)&lt;br /&gt;
&lt;br /&gt;
:::::: Godspeed! --[[User:Joaquín Martínez|Joaquín Martínez]] 16:41, 24 March 2012 (EDT)&lt;br /&gt;
&lt;br /&gt;
== Compiler ==&lt;br /&gt;
&lt;br /&gt;
I could fix no. 10 and 11; no. 12 has a wrong url. (Not Found). --[[User:Joaquín Martínez|Joaquín Martínez]] 13:19, 5 April 2012 (EDT)&lt;br /&gt;
&lt;br /&gt;
:Joaquin, thanks for your help. Following your example I've managed to correctly locate and sort out the remaining reference. [[User:RolandPlankton|RolandPlankton]] 14:32, 5 April 2012 (EDT)&lt;/div&gt;</summary>
		<author><name>RolandPlankton</name></author>
	</entry>
	<entry>
		<id>https://www.conservapedia.com/index.php?title=Theory_of_relativity&amp;diff=980832</id>
		<title>Theory of relativity</title>
		<link rel="alternate" type="text/html" href="https://www.conservapedia.com/index.php?title=Theory_of_relativity&amp;diff=980832"/>
		<updated>2012-05-11T21:03:34Z</updated>

		<summary type="html">&lt;p&gt;RolandPlankton: revert implausible/biased changes&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;small&amp;gt;''See also [[Counterexamples to Relativity]].''&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''theory of relativity''' has been repeatedly contradicted by experiments, such as precise measurements of the advance of the perihelion of Mercury that show a shift greater than predicted by Relativity, well beyond the margin of error.  Criticism of the theory, however, caused physicist [[Robert Dicke]] to be denied the [[Nobel Prize]], and it is unlikely tenure or a Ph.D would be awarded to any critic of the theory.&lt;br /&gt;
&lt;br /&gt;
'''Relativity''' refers to two closely-related mathematical theories in [[physics]]:&lt;br /&gt;
&lt;br /&gt;
*'''[[Special theory of relativity|Special relativity]]''' (SR) is a theory which describes the laws of motion for non-accelerating bodies traveling at a significant fraction of the [[speed of light]].  As speeds approach zero, Special Relativity tends towards equivalence with [[Newton's Laws of Motion]].  Special Relativity was developed by [[Hendrik Lorentz]], [[Henri Poincaré]], and Hermann Minkowski,&amp;lt;ref&amp;gt;&amp;quot;German mathematician who developed the geometrical theory of numbers and who made numerous contributions to number theory, mathematical physics, and the theory of relativity.&amp;quot; [http://www.britannica.com/eb/article-9052860/Hermann-Minkowski Hermann Minkowski -- Britannica Online Encyclopedia]&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;[http://www-groups.dcs.st-and.ac.uk/~history/Biographies/Minkowski.html Hermann Minkowski, Biography]&amp;lt;/ref&amp;gt; and [[Albert Einstein]]. &lt;br /&gt;
&lt;br /&gt;
*'''[[General theory of relativity|General Relativity]]''' (GR) is a theory which explains the laws of motion as viewed from accelerating reference frames and includes a geometric explanation for gravity.  This theory was developed by [[David Hilbert]] and [[Albert Einstein]] as an extension of the postulates of Special Relativity.&amp;lt;ref&amp;gt;&amp;quot;[T]he German mathematician David Hilbert submitted an article containing the correct field equations for general relativity five days before Einstein.&amp;quot;[http://nobelprize.org/educational_games/physics/relativity/history-1.html Nobel Prize historical account]&amp;lt;/ref&amp;gt; A dramatic but later discredited claim by Sir [[Arthur Eddington]] of experimental proof of General Relativity in 1919 made Einstein a household name.&lt;br /&gt;
&lt;br /&gt;
These theories have augmented earlier approaches, such as [[Galilean Relativity]].&lt;br /&gt;
&lt;br /&gt;
Unlike most of physics, the theories of relativity have discontinuities whereby the limit of a physical quantity as a variable (such as mass or velocity) approaches a fixed value is not the same as the physical quantity at the fixed value.  For example, the limit of momentum as mass approaches 0 and velocity approaches the speed of light is not equal to the momentum of (massless) light.&amp;lt;ref&amp;gt;Discontinuities in General Relativity are also well-recognized. See, e.g., [http://www.springerlink.com/content/u47l341u2q555455/]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
More generally, and also unlike most of physics, the theories of relativity consist of complex mathematical equations relying on several hypotheses.  For example, at Hofstra University general relativity is taught as part of an upperclass math course on differential geometry, based on three stated assumptions.&amp;lt;ref&amp;gt;http://people.hofstra.edu/Stefan_Waner/diff_geom/tc.html&amp;lt;/ref&amp;gt;  The equations for special relativity assume that it is forever impossible to attain a velocity faster than the speed of light and that all inertial frames of reference are equivalent, hypotheses that can never be fully tested. Relativity rejects Newton's [[action at a distance]], which is basic to Newtonian gravity and [[quantum mechanics]].  The mathematics of relativity assume no exceptions, yet in the time period immediately following the origin of the universe the relativity equations could not possibly have been valid.&lt;br /&gt;
&lt;br /&gt;
Relativity has been met with much resistance in the scientific world. To date, a Nobel Prize has never been awarded for Relativity.&amp;lt;ref&amp;gt;Increasingly the Nobel Prize Committee has attempted to relate its physics awards to Relativity in some way, including perhaps 20 of the more recent prizes.&amp;lt;/ref&amp;gt; Louis Essen, the man credited with determining the speed of light, wrote many fiery papers against it such as ''The Special Theory of Relativity: A Critical Analysis''.&amp;lt;ref&amp;gt;http://ephysics.fileave.com/physics/Essen/oxford5-essen.pdf&amp;lt;/ref&amp;gt; Relativity is in conflict with [[quantum mechanics]],&amp;lt;ref&amp;gt;For example, Relativity claims that space and time are smooth and continuous, while [[quantum mechanics]] suggests otherwise. [http://www.csmonitor.com/Science/Cool-Astronomy/2010/1025/Is-the-universe-a-big-hologram-This-device-could-find-out.]  Relativity also denies [[action-at-a-distance]], while quantum mechanics suggests otherwise.  Relativity denies any role for chance, while quantum mechanics is heavily dependent on it.&amp;lt;/ref&amp;gt; and although theories like [[string theory]] and [[quantum field theory]] have attempted to unify relativity and quantum mechanics, neither has been entirely successful or proven.&lt;br /&gt;
&lt;br /&gt;
Unlike [[Classical mechanics|Newtonian physics]], in which space and time intervals are each invariant as seen by all observers, in SR the only invariant quantity is a quadratic combination of space and time intervals (x&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; - c&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; t&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;). The (assumed) instantaneous transmission of Newtonian gravitational effects also contradicts special relativity.&lt;br /&gt;
&lt;br /&gt;
In quantum mechanics, the [[uncertainty principle]] suggests that virtual particles can sometimes travel faster than the speed of light which would violate causality, but &amp;quot;[t]he only known way to resolve this tension involves introducing the idea of antiparticles.&amp;quot;&amp;lt;ref&amp;gt;http://nobelprize.org/nobel_prizes/physics/laureates/2004/wilczek-lecture.pdf (p. 102)&amp;lt;/ref&amp;gt;  Consequently, in 1928 Paul Dirac derived the Dirac equation, one of the first quantum mechanical equations compatible with special relativity, by which Dirac predicted the existence of antimatter. Four years later, antimatter (the positron) was discovered by Carl Anderson, as successfully predicted by relativistic quantum mechanics.  [[Quantum field theory]], a generalization of quantum mechanics, is fully compatible with special relativity but not with general relativity, and still lacks a vital piece: evidence of the [[graviton]].&lt;br /&gt;
&lt;br /&gt;
== Special Relativity ==&lt;br /&gt;
Lorentz and Poincare developed Special Relativity as way of understanding how Maxwell's equations for electromagnetism could be valid in different frames of reference. Einstein famously published an explanation of Poincare's theory in terms of two assumptions (postulates):&lt;br /&gt;
&lt;br /&gt;
# ''The [[speed of light]] is constant for all (inertial) observers, regardless of their velocities relative to each other.''&lt;br /&gt;
# ''The laws of physics are identical in all inertial reference frames.''&lt;br /&gt;
&lt;br /&gt;
In layman's terms, these two assumptions can be restated as:&lt;br /&gt;
# It is impossible ever to transmit information faster than the speed of light.&amp;lt;ref&amp;gt;This assumption is commonly restated in this manner.  For example, a discussion of hypothetical [[tachyons]] talks &amp;quot;about using tachyons to transmit information faster than the speed of light, '''in violation of Special Relativity'''.&amp;quot;[http://www.math.ucr.edu/home/baez/physics/ParticleAndNuclear/tachyons.html]  However, there is some question whether the Theory of Special Relativity really restricts faster-than-light communication of information.&amp;lt;/ref&amp;gt;&lt;br /&gt;
# The laws of physics are identical, without any variation, in every location throughout the universe.&lt;br /&gt;
# The laws of physics are identical, without any variation, no matter how fast something is traveling (in the absence of acceleration).&lt;br /&gt;
&lt;br /&gt;
Or, in more concise, clearer terms, these assumptions are this:&lt;br /&gt;
&lt;br /&gt;
#there is no [[action at a distance]] (because that would make observations dependent on the frame of reference)&lt;br /&gt;
#space and time are completely symmetric throughout the universe (because otherwise frames of reference would not be interchangeable)&lt;br /&gt;
&lt;br /&gt;
When the assumptions are stated clearly as above, the weaknesses in the theory are more apparent.  There ''is'' action at a distance in [[quantum entanglement]] and apparently also in gravity, as no gravitons can be found. However, no information has yet been transmitted via quantum entanglement, so while non-locality violates the spirit of relativity it is consistent with it if relativity is limited to the transmission of information. [[Quantum field theory]], an attempt to partially reconcile [[quantum mechanics]] with relativity, is incomplete at best.  As to the second assumption, it is contrary to the [[arrow of time]], which illustrates the lack of symmetry in time.  Logical defects include the incoherence of relativistic mass (see discussion below) and the lack of relativistic constraints near the beginning the universe (see above).&lt;br /&gt;
&lt;br /&gt;
Special Relativity (SR) was initially developed by [[Henri Poincaré]] and [[Hendrik Lorentz]], working on problems in electrodynamics and the [[Michelson-Morley experiment]], which had not found any sign of [[aether (science)|luminiferous aether]], which was believed to be the substance which carried electromagnetic waves. Special relativity alters [[Isaac Newton]]'s laws of motion by assuming that the speed of light will be the same for all observers, despite their relative velocities and the source of the light. (Therefore, if A sends a beam of light to B, and both measure the speed, it will be the same for both, no matter what the relative velocity of A and B. In Newtonian/Galilean mechanics, If A sends a physical object at a particular velocity towards B, and nothing slows it, the velocity of the object relative to B depends on the velocities of the object and of B relative to A.)&lt;br /&gt;
&lt;br /&gt;
At low speeds (relative to light-speed), the Lorentz-Poincare relativity equations are equivalent to Newton's equations. The famous equation ''[[E=mc²]]'', describes the relationship between energy and the rest mass of a body.&lt;br /&gt;
&lt;br /&gt;
Under relativity, particles at low mass and low speed can be accurately approximated by [[classical mechanics]] (such as [[Isaac Newton]]'s laws of motion). At the two extremes, modeling the behavior of electrons requires that relativistic effects be taken into account (the chemically significant phenomenon of electron spin arises from relativity), and the course light passing through a region containing many massive bodies such as galaxies will be distorted ([[classical mechanics]], in which light travels in straight lines, does not predict this). These are both experimentally confirmed (electron spin was known before relativity arose, and telescopic observations confirm that galactic clusters distort the paths of the light passing through them).&lt;br /&gt;
&lt;br /&gt;
Many scientists have indicated problems with the postulates of special relativity.  Paul Davies, formerly of Macquarie University and now at the University of Arizona believes that the speed of light has changed over time.  Since the speed of light is a constant speed 'c' this indicates problems with the theory [http://news.bbc.co.uk/2/hi/science/nature/2181455.stm light speed].  Other engineers and scientist have written about problems in the basic set of special relativity equations.  Based on the ideas of not Einstein but of the scientist Fitzgerald as well as others, a length contraction effect was predicted as an explanation of the failure of the Michelson Morley experiment. This idea was taken up by Hendrik Lorentz and shown by others to be a useful mechanism by which theory could be forced into conformance with experimental results. However, in 2005, Michael Strauss a computer engineer invalidated much of Special Relativity theory by showing clear contradictions in the theory. [http://www.relativitycollapse.com relativity]&lt;br /&gt;
&lt;br /&gt;
== General Relativity ==&lt;br /&gt;
&lt;br /&gt;
General Relativity is a theory of gravity that is compatible with Special Relativity.  Einstein explains a thought experiment involving two elevators.  The first elevator is stationary on the Earth, while the other is being pulled through space at a constant acceleration of g.  Einstein realized that any physical experiment carried out in the elevators would give the same result.  This realization is known as the equivalence principle and it states that accelerating frames of reference and gravitational fields are indistinguishable.  General Relativity is the theory of gravity that incorporates Special Relativity and the equivalence principle.  &lt;br /&gt;
&lt;br /&gt;
General Relativity is a mathematical extension of Special Relativity. GR views space-time as a 4-dimensional [[manifold]], which looks locally like [[Minkowski space]], and which acquires [[curvature]] due to the presence of massive bodies. Thus, near massive bodies, the geometry of space-time differs to a large degree from [[Euclidean geometry]]: for example, the sum of the angles in a triangle is not exactly 180 degrees. Just as in classical physics, objects travel along [[geodesic]]s in the absence of external forces. Importantly though, near a massive body, geodesics are no longer straight lines. It is this phenomenon of objects traveling along geodesics in a curved spacetime that accounts for gravity.&lt;br /&gt;
&lt;br /&gt;
At one time the anomalous precession of Mercury's [[perihelion]] seemed to support the Theory of General Relativity, but increasingly accurate measurements show a divergence of the data from the theory.&amp;lt;ref&amp;gt;[[Counterexamples to Relativity]].&amp;lt;/ref&amp;gt;  There are other explanations based in Newtonian gravity, such as factoring in the pull of the other planets on Mercury's orbit.  One Newtonian explanation requires a slight alternation to the precise inverse-square relation of Newtonian gravity to distance, which is disfavored by mathematicians due to its inelegance in integrating.&lt;br /&gt;
&lt;br /&gt;
British Historian Paul Johnson declares the turning point in 20th century to have been when fellow Briton Sir [[Arthur Eddington]], an esteemed English astronomer, ventured out on a boat off Africa in 1919 with a local Army unit to observe the bending of starlight around the sun during a total eclipse.   Upon his return to England declared that his observations proven the theory of relativity.  In fact recent analysis of Eddington's work revealed that he was biased in selecting his data, and that overall his data were inconclusive about the theory of relativity. The prediction was later confirmed by more rigorous experiments, such as those performed by the [[Hubble Space Telescope]] &amp;lt;ref&amp;gt;[http://www.spaceimages.com/gravlen.html Hubble Gravitational Lens Photo]&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt; [http://csep10.phys.utk.edu/astr162/lect/galaxies/lensing.html Gravitational Lensing] &amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;[http://www.iam.ubc.ca/~newbury/lenses/glgallery.html]&amp;lt;/ref&amp;gt;. Lorentz has this to say on the discrepancies between the empirical eclipse data and Einstein's predictions.&lt;br /&gt;
&lt;br /&gt;
::''It indeed seems that the discrepancies may be ascribed to faults in observations, which supposition is supported by the fact that the observations at Prince's Island, which, it is true, did not turn out quite as well as those mentioned above, gave the result, of 1.64, somewhat lower than Einstein's figure.''&amp;lt;ref&amp;gt;Lorentz, H.A. [http://ia331314.us.archive.org/2/items/theeinsteintheor11335gut/11335-h/11335-h.htm The Einstein Theory of Relativity]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The prediction that light is bent by gravity is predicted both by Newtonian physics and relativity, but relativity predicts a larger deflection.&lt;br /&gt;
&lt;br /&gt;
Special relativity is the limiting case of general relativity where all gravitational fields are weak.  Alternatively, special relativity is the limiting case of general relativity when all reference frames are inertial (non-accelerating and without gravity).&lt;br /&gt;
&lt;br /&gt;
==Lack of evidence for Relativity==&lt;br /&gt;
The Theory of relativity assumes that time is symmetric just as space is, but the biggest early promoter of relativity, Arthur Eddington, coined the term &amp;quot;[[arrow of time]]&amp;quot; admitting how time is ''not'' symmetric but is directional.  The passage of time is tied to an increase in disorder, or [[entropy]].  The Theory of relativity cannot explain this, and implicitly denies it, specifically allowing for theoretical time travel (e.g., [[wormholes]]) and different rates of passage of time based on velocity and acceleration.&lt;br /&gt;
&lt;br /&gt;
Claims that relativity was used to develop the [[Global Positioning System]] ([[GPS]]) are false. A 1996 article explains:&lt;br /&gt;
&lt;br /&gt;
:&amp;quot;The Operational Control System (OCS) of the Global Positioning System (GPS) does not include the rigorous transformations between coordinate systems that Einstein's general theory of relativity would seem to require - transformations to and from the individual space vehicles (SVs), the Monitor Stations (MSs), and the users on the surface of the rotating earth, and the geocentric Earth Centered Inertial System (ECI) in which the SV orbits are calculated.  There is a very good reason for the omission: the effects of relativity, where they are different from the effects predicted by classical mechanics and electromagnetic theory, are too small to matter - less than one centimeter, for users on or near the earth.&amp;quot;&amp;lt;ref&amp;gt;http://tycho.usno.navy.mil/ptti/1996/Vol%2028_16.pdf&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;Some do claim that relativity is &amp;quot;vital&amp;quot; to GPS even though GPS developed independently of theoretical predictions and theoreticians disagree about how the relativistic effects for GPS should be calculated.  ''See id.  See also'' [http://www.rand.org/pubs/monograph_reports/MR614/MR614.appb.pdf]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This article, which was published in 1996, goes on to propose relativistic corrections that might be used to design more accurate GPS systems.  Clocks on board GPS satellites require adjustments to their clock frequencies if they are to be synchronized with those on the surface of the Earth. &lt;br /&gt;
&lt;br /&gt;
Tom Van Flandern, an astronomer hired to work on GPS in the late 1990s, concluded that &amp;quot;[t]he GPS programmers don't need relativity.&amp;quot;  He was quoted as saying that the GPS programmers &amp;quot;have basically blown off Einstein.&amp;quot;&amp;lt;ref&amp;gt;http://archive.salon.com/people/feature/2000/07/06/einstein/index.html See also [http://www.metaresearch.org/solar%20system/gps/absolute-gps-1meter-3.ASP], where Van Flandern discusses how relativistic corrections might improve GPS accuracy.&amp;lt;/ref&amp;gt;  Asynchronization can be easily addressed through communications between the satellites and ground stations, so it is unclear why any theory would be needed for GPS. But other obscure physicists having no connection with GPS design claim that Van Flandern is wrong about GPS, and insist that relativity provides the best explanation for its timing adjustments.&amp;lt;ref&amp;gt;''Ibid.''&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some internet articles claim that GPS timing differences ''confirm'' the Theory of Relativity or its Lorentzian counterpart (which uses a preferred frame of reference). GPS clocks run slower in the weaker gravitation field of the satellites than on ground stations on Earth, with the effects predicted by general relativity far outweighing the effects predicted by special relativity.  However, the articles claiming that the slower GPS satellite clocks confirm relativity do not address the effect, if any, of the weaker gravitational force under Newton's theory on the GPS satellite clocks, likely because in Newtonian Mechanics every clock in the universe keeps time at the same rate regardless of velocity, acceleration, or the presence or absence of force.&lt;br /&gt;
&lt;br /&gt;
Currently, GPS satellites are synchronized to Coordinated Universal Time by radio signals from the ground; therefore, they cannot currently be used to test general relativity.&amp;lt;ref&amp;gt;[http://www.phys.lsu.edu/mog/mog9/node9.html &amp;quot;General Relativity in the Global Positioning System.&amp;quot;] Neil Ashby, U. of Colorado&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are claims that the effects of relativity have been observed with the frequency shift of the signal being sent back to [[Earth]] several times as various spacecraft have dipped into the gravity wells around massive objects such as the [[sun]] (see image at right)&amp;lt;ref&amp;gt;[http://saturn.jpl.nasa.gov/news/press-releases-03/20031002-pr-a.cfm Saturn-Bound Spacecraft Tests Einstein's Theory]&amp;lt;/ref&amp;gt; or Saturn&amp;lt;ref&amp;gt;[http://www.newscientist.com/article/mg12517102.600-science-encounter-with-saturn-confirms-relativity-theory.html Encounter with Saturn confirms relativity theory]&amp;lt;/ref&amp;gt;.  A satellite called [[Gravity Probe B]] was put in orbit about the Earth to examine the effects of frame dragging and geodetic warping of space&amp;lt;ref&amp;gt;[http://www.nasa.gov/mission_pages/gpb/index.html NASA Gravity Probe B mission page]&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;[http://einstein.stanford.edu/ Gravity Probe B project page]&amp;lt;/ref&amp;gt;, but the results were inconclusive.  Note, however, that Newtonian mechanics also predicts deflection of light by gravity, and in the initial theory of relativity it predicted the same amount of deflection, but only if we treat light as capable of being accelerated and decelerated like ordinary matter, which is contrary to all measurements and observations to date.&amp;lt;ref&amp;gt;http://www.mathpages.com/rr/s6-03/6-03.htm&amp;lt;/ref&amp;gt; Adjustments to the theory of relativity resulted in a prediction of a greater deflection of light than that predicated by Newtonian mechanics, though it is debatable how much deflection Newtonian mechanics should predict.  &lt;br /&gt;
&lt;br /&gt;
None of the NASA spacecraft incorporates predictions of relativity into their own timing mechanisms, as Newtonian mechanics is adequate even for probes sent deep into space so long as they do not undergo accelerations near the speed of light or enter any massive gravity wells.&amp;lt;ref&amp;gt;There is no reported reliance on relativity by any space probe.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A decade of observation of the [[pulsar]] pair [[PSR 1913 16|PSR B1913+16]] detected a decline in its orbital period, which was attributed to a loss in energy by the system.  It is impossible to measure the masses of the pulsars, their accelerations relative to the observers, or other fundamental parameters.  Professors Joseph Taylor and Russell Hulse, who discovered the binary pulsar, found that physical values could be assigned to the pulsars to make the observed decline in orbital period consistent with the Theory of General Relativity, and for this they were awarded the 1993 [[Nobel Prize]] for Physics, which is the only award ever given by the Nobel committee for the Theory of Relativity.&amp;lt;ref&amp;gt;http://nobelprize.org/nobel_prizes/physics/laureates/1993/press.html&amp;lt;/ref&amp;gt; In 2004, Professor Taylor utilized a correction to the derivative of the orbital period to fit subsequent data better to the theory.  At most, assumptions can be made and altered to fit the data to the theory, rather than the data confirming the theory. This is the typical scientific method, wherein a hypothesis is created, tested, adjusted, and further tested.&lt;br /&gt;
&lt;br /&gt;
The [[perihelion]] of Mercury's [[orbit]] [[precession|precesses]] at a measurable rate, but even after accounting for gravitational perturbations caused all other planets in the [[solar system]], Newton's theory (assuming a precise inverse-square relationship for distance) predicts a rate of precession that differs from the measured rate by approximately 43 [[arcsecond]]s per century.  General relativity was developed in part to provide an estimate for this rate of precession that better matches observations.&amp;lt;ref&amp;gt;http://physics.ucr.edu/~wudka/Physics7/Notes_www/node98.html#SECTION032121000000000000000&amp;lt;/ref&amp;gt; &amp;lt;ref&amp;gt; http://www.alberteinstein.info/gallery/pdf/CP6Doc30_English_pp146-200.pdf&amp;lt;/ref&amp;gt; &amp;lt;ref&amp;gt; http://farside.ph.utexas.edu/teaching/336k/lectures/node117.html&amp;lt;/ref&amp;gt;  Newton's theory can also explain this perihelion by making tiny adjustments to parameters in the gravitational equation.&lt;br /&gt;
&lt;br /&gt;
General relativity predicts twice as much bending in light as it passes near massive objects than Newton's theory might predict.&amp;lt;ref&amp;gt;http://www.mathpages.com/rr/s6-03/6-03.htm&amp;lt;/ref&amp;gt; This phenomenon is known as [[gravitational lens|gravitational lensing]]. A large number of instances of gravitational lensing have been observed, and it is now a standard astronomical tool.&amp;lt;ref&amp;gt; http://imagine.gsfc.nasa.gov/docs/features/news/grav_lens.html&amp;lt;/ref&amp;gt; &amp;lt;ref&amp;gt; http://astro.berkeley.edu/~jcohn/lens.html&amp;lt;/ref&amp;gt; &amp;lt;ref&amp;gt; http://www.iam.ubc.ca/~newbury/lenses/glgallery.html&amp;lt;/ref&amp;gt;  Note, however, that the extent of bending of light predicted by Newton's theory is open to debate, and depends on assumptions about the nature of light for gravitational purposes.&amp;lt;ref&amp;gt;http://cosmictimes.gsfc.nasa.gov/1919/guide/gravity_bends_starlight.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In 1972, scientists flew extremely accurate clocks (&amp;quot;atomic clocks&amp;quot;) around the world in both directions on commercial airlines, and claimed to observe relativistic time dilation; the eastbound clock gained 273 ns and the westbound clock lost 59 ns, matching the predictions of general relativity to within experimental accuracy.&amp;lt;ref&amp;gt;[http://www.answers.com/topic/hafele-keating-experiment Hafele-Keating Experiment]&amp;lt;/ref&amp;gt;  However, the inventor of the atomic clock, Louis Essen, declared that the experiment was inaccurate.&amp;lt;ref&amp;gt;Louis Essen, Electron. Wireless World 94 (1988) 238.&amp;lt;/ref&amp;gt;  Dr A. G. Kelly examined the raw data from the experiment and declared it inconclusive.&amp;lt;ref&amp;gt;A. G. Kelly,Reliability of Relativistic Effect Tests on Airborne Clocks, Monograph No.3 Feb.1996, The Institution of Engineers of Ireland, ISBN 1-898012-22-9&amp;lt;/ref&amp;gt;  The Nobel Committee chose not to honor this experiment for the significance that was claimed.&lt;br /&gt;
&lt;br /&gt;
Despite [[censorship]] of dissent about relativity, evidence contrary to the theory is discussed outside of [[liberal]] universities.&amp;lt;ref&amp;gt;http://scitizen.com/screens/blogPage/viewBlog/sw_viewBlog.php?idTheme=8&amp;amp;idContribution=922&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Experimental Verification of Relativity==&lt;br /&gt;
&lt;br /&gt;
The different effects predicted by special relativity, compared to classical formulations, are extremely tiny.  Most relativistic effects are negligible at the speeds of ordinary phenomena observed by humans.  The effects only become significant when the speeds involved are a significant fraction of the speed of light, which is &amp;lt;math&amp;gt;3 \times 10^8&amp;lt;/math&amp;gt; meters per second&amp;amp;mdash;such speeds are called ''relativistic''.  (However, it's worth noting that ordinary magnetism can be considered an effect of relativity, dictated by the need for electrostatic theory to be correct under relativity.  The speed of light in fact appears in the formulas ([[Maxwell's Equations]]) governing electricity and magnetism, though these equations were developed long before relativity was proposed.)&lt;br /&gt;
&lt;br /&gt;
Because the effects of relativity are so tiny, scientists have been devising sophisticated and sensitive tests ever since the theory was formulated in 1905.&lt;br /&gt;
&lt;br /&gt;
*At the end of Einstein's original 1905 paper [http://www.fourmilab.ch/etexts/einstein/E_mc2/www/ &amp;quot;Does the Inertia of a Body Depend its Energy Content?&amp;quot;], he speculates on the possibility that the equation &amp;lt;math&amp;gt;E = m c^2&amp;lt;/math&amp;gt;, which would normally be very hard to verify, could be verified with the extremely high energies of the newly-discovered phenomenon of radioactivity.&amp;lt;ref&amp;gt;This equation is not related to [[quantum mechanics]].&amp;lt;/ref&amp;gt;  In the 1910's, with the invention of the mass spectrometer, it became possible to measure masses of nuclei accurately.  This led to the clearing up of the mystery of atomic masses not being exact integers,and strongly suggested the existence of a &amp;quot;mass defect&amp;quot; (or &amp;quot;packing fraction&amp;quot;) consistent with the mass-energy equivalence.  In the 1930's, experiments with known nuclear reactions showed a very accurate correlation between the masses of the nuclei involved and the energy released.&lt;br /&gt;
&lt;br /&gt;
*Another prediction of special relativity was time dilation in rapidly moving objects.  This effect was most famously verified in the anomalously slow decay of relativistic cosmic muons&amp;lt;ref&amp;gt;Some have suggested that other explanations are possible for this effect.  We are trying to track this down.&amp;lt;/ref&amp;gt;.  Time dilation has since been verified many times, and is routinely taken into account in all high-energy nuclear physics experiments, as in Hadron collision experiments&amp;lt;ref&amp;gt;Experiments specifically designed to check dilation are rarely conducted any more.&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Predictions of general relativity turned out to be more obscure and difficult to test.  The two most famous predictions were the bending of light in a gravitational field and the precession of the perihelia of orbiting planets.&lt;br /&gt;
&lt;br /&gt;
*The first of these was famously tested during a total eclipse in 1919.  That test was somewhat muddled by an incorrect initial calculation, by several people including Einstein himself, of what the effect would be, and some &amp;quot;cherry picking&amp;quot; of the data to be used &amp;lt;ref&amp;gt;''Einstein's Luck'', John Waller, Oxford University Press, ISBN 0-19-860719-9&amp;lt;/ref&amp;gt;.  The data selection could be considered &amp;quot;manipulation&amp;quot; or &amp;quot;fudging&amp;quot;, by a person (Arthur Eddington) who had a personal stake in the outcome.  His analysis techniques would not pass muster today.&lt;br /&gt;
&lt;br /&gt;
:It should be noted that pre-relativistic (Newtonian) physics may also predict a bending, of half the observed value, depending on whether one uses the 17&amp;lt;sup&amp;gt;th&amp;lt;/sup&amp;gt; century &amp;quot;corpuscular&amp;quot; formulation or the 19&amp;lt;sup&amp;gt;th&amp;lt;/sup&amp;gt; century &amp;quot;wave&amp;quot; formulation.&lt;br /&gt;
&lt;br /&gt;
:Nevertheless, it has been verified with ever-increasing precision in subsequent eclipses, and in the observations of quasar 3C273.&lt;br /&gt;
&lt;br /&gt;
*The second &amp;quot;classical&amp;quot; test of general relativity was the advance of the perihelion of the orbit of Mercury.  There are many complex effects contributing to this, including gravitational perturbations from other planets and the effect of the oblateness of the Sun.  These are hard to calculate accurately, but, by 1900 it was known quite accurately that there was an &amp;quot;anomalous&amp;quot; precession, that is, a precession beyond all other known effects, of 43 arc seconds per century.  This is a very tiny effect, but astronomical measurements were sufficiently accurate by that time to show it clearly.&lt;br /&gt;
&lt;br /&gt;
:This created quite a problem&amp;amp;mdash;physicists by then were accustomed to having their theories check out very accurately.  One proposal that was made, by Simon Newcomb and Asaph Hall, was that the exponent of the radius in the gravitational formula wasn't exactly 2.  He showed that, by choosing an exponent of &amp;lt;math&amp;gt;2+\delta&amp;lt;/math&amp;gt;, the precession, as a fraction of a full orbit per planet's year, is &amp;lt;math&amp;gt;\delta/2&amp;lt;/math&amp;gt;.  By setting &amp;lt;math&amp;gt;\delta&amp;lt;/math&amp;gt; to .000000157, that is, an exponent of 2.000000157, Newcomb was able to get a precession of .000000078 revolutions per Mercury year, or 43 arcseconds per Earth year.  The primary resistance to this approach came from mathematicians unable to do the integration without an exponent of precisely 2, and they insisted, incorrectly, that was impossible for the exponent to be slightly different from 2.  Due to this desire for mathematical elegance rather than objective observation-based science, Newcomb's approach was not pursued. Furthermore as can be seen from the table below the measured values of the anomalous precessions of other planets agree well with the predictions of general relativity but poorly with those predicted by Newcomb and Hall.&lt;br /&gt;
&lt;br /&gt;
:While Newcomb's theory, and general relativity, don't lead to closed-form solutions, both theories can be solved numerically to as much precision as one desires.&lt;br /&gt;
&lt;br /&gt;
:Increasingly precise measurements of the precession demonstrate that it conflicts with General Relativity, despite claims of relativists for decades that it predicted the precession accurately in the amount of &amp;lt;math&amp;gt;3{}v^2/c^2&amp;lt;/math&amp;gt; revolutions per planet's &amp;quot;year&amp;quot;, where &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; is the planet's average orbital speed.&amp;lt;ref&amp;gt;That is a simple approximation, designed to relate the precession to the planet's speed relative to the speed of light.  A more accurate approximation is &amp;lt;math&amp;gt;\frac{3GM}{c^2 a(1-e^2)}&amp;lt;/math&amp;gt;, where a is the semi-major axis and e is the eccentricity.&amp;lt;/ref&amp;gt;  The conflict is greater than the margin of error, and many relativists avoid the discrepancy rather than address it.&lt;br /&gt;
&lt;br /&gt;
:The following table show some approximate parameters for the planets.  Note that Mercury has the smallest orbit, the fastest speed, and the highest gravitational pull.  Precession of planets other than Mercury is extremely hard to measure, but measurements of the actual anomalous precessions are in good agreement .&amp;lt;ref&amp;gt;http://www.mathpages.com/rr/s6-02/6-02.htm&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Planet&lt;br /&gt;
!Period, seconds x 10&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;&lt;br /&gt;
!Semimajor axis, meters x 10&amp;lt;sup&amp;gt;9&amp;lt;/sup&amp;gt;&lt;br /&gt;
!Speed, meters/second x 10&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
!Gravitational force, Newtons per kilogram&lt;br /&gt;
!Anomalous precession, arcseconds per (Earth) century, pure Newtonian mechanics&lt;br /&gt;
!Anomalous precession, Newtonian with exponent of 2.000000157&lt;br /&gt;
!Anomalous precession, general relativity&lt;br /&gt;
!Measured anomalous precession (estimated uncertainty)&amp;lt;ref&amp;gt;http://www.mathpages.com/rr/s6-02/6-02.htm&amp;lt;/ref&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Mercury&lt;br /&gt;
|7.57&lt;br /&gt;
|58.9&lt;br /&gt;
|48&lt;br /&gt;
|.039&lt;br /&gt;
|0&lt;br /&gt;
|43&lt;br /&gt;
|43&lt;br /&gt;
|43.5(5)&lt;br /&gt;
|-&lt;br /&gt;
|Venus&lt;br /&gt;
|19.6&lt;br /&gt;
|108&lt;br /&gt;
|35&lt;br /&gt;
|.011&lt;br /&gt;
|0&lt;br /&gt;
|16.6&lt;br /&gt;
|9&lt;br /&gt;
|8(5)&lt;br /&gt;
|-&lt;br /&gt;
|Earth&lt;br /&gt;
|31.6&lt;br /&gt;
|150&lt;br /&gt;
|30&lt;br /&gt;
|.006&lt;br /&gt;
|0&lt;br /&gt;
|10.3&lt;br /&gt;
|4&lt;br /&gt;
|5(1)&lt;br /&gt;
|-&lt;br /&gt;
|Mars&lt;br /&gt;
|59.3&lt;br /&gt;
|227.9&lt;br /&gt;
|24&lt;br /&gt;
|.0025&lt;br /&gt;
|0&lt;br /&gt;
|5.5&lt;br /&gt;
|1.4&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Jupiter&lt;br /&gt;
|374&lt;br /&gt;
|778.4&lt;br /&gt;
|13&lt;br /&gt;
|.0002&lt;br /&gt;
|0&lt;br /&gt;
|0.87&lt;br /&gt;
|0.07&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Saturn&lt;br /&gt;
|929&lt;br /&gt;
|1426&lt;br /&gt;
|9.7&lt;br /&gt;
|.00006&lt;br /&gt;
|0&lt;br /&gt;
|0.35&lt;br /&gt;
|0.014&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Uranus&lt;br /&gt;
|2651&lt;br /&gt;
|2870&lt;br /&gt;
|6.8&lt;br /&gt;
|.000016&lt;br /&gt;
|0&lt;br /&gt;
|0.12&lt;br /&gt;
|0.002&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Neptune&lt;br /&gt;
|5200&lt;br /&gt;
|4498&lt;br /&gt;
|5.5&lt;br /&gt;
|.000007&lt;br /&gt;
|0&lt;br /&gt;
|0.063&lt;br /&gt;
|0.0008&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Image:Cassini-science-289.jpg|right|thumb|The Shapiro effect: A spacecraft signal dipping into a gravity well around the [[Sun]] is delayed slightly.]]&lt;br /&gt;
As the 20&amp;lt;sup&amp;gt;th&amp;lt;/sup&amp;gt; century progressed, more tests of general relativity were proposed.&lt;br /&gt;
&lt;br /&gt;
*One was the ''Shapiro effect'', involving time delay in radio signals passing through the gravity well of the Sun or a planet.  Various spacecraft have confirmed this.&lt;br /&gt;
&lt;br /&gt;
*Another is ''gravitational time dilation''.  This is an effect separate from the time dilation of special relativity.  It was tested by the Pound-Rebka experiment in 1959.&lt;br /&gt;
&lt;br /&gt;
*Later in the 20&amp;lt;sup&amp;gt;th&amp;lt;/sup&amp;gt; century, even more subtle phenomena were tested.  One was the phenomenon of ''gravitational radiation'', or &amp;quot;gravity waves&amp;quot;.  These waves are incredibly difficult to observe, and have never been observed.  But extremely dense binary pulsars radiate gravitational waves with sufficient energy loss that, even though we can't detect the waves from Earth, we can see the effect of the energy loss from the radiation.  The extreme precision of the timing of pulses from pulsars makes it possible to observe their energy loss with great accuracy.  Observations by Hulse and Taylor of the pulsar pair known as B1913+16 confirmed the energy loss consistent with the predicted radiation.&lt;br /&gt;
&lt;br /&gt;
*Two other effects, ''geodetic precession'' (also known as &amp;quot;de Sitter precession&amp;quot;), and ''frame dragging'' (also known as the &amp;quot;Lense-Thirring effect&amp;quot;) were tested by the &amp;quot;Gravity Probe B&amp;quot; satellite early in the 21&amp;lt;sup&amp;gt;st&amp;lt;/sup&amp;gt; century&amp;lt;ref&amp;gt;http://prl.aps.org/accepted/L/ea070Y8dQ491d22a28828c95f660a57ac82e7d8c0&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;http://www.digitaljournal.com/article/306430&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;http://www.nap.edu/html/gpb/summary.html&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;http://www.sciencenews.org/view/generic/id/73870/title/Gravity_Probe_B_finally_pays_off_&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;http://www.nasa.gov/mission_pages/gpb/&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;http://einstein.stanford.edu/&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;http://spectrum.ieee.org/aerospace/space-flight/the-gravity-probe-b-bailout&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;http://www.engadget.com/2011/05/06/nasa-concludes-gravity-probe-b-space-time-experiment-proves-e/&amp;lt;/ref&amp;gt;.  The precision required to observe this was phenomenal.  The results were announced on May 4, 2011.&lt;br /&gt;
&lt;br /&gt;
{{clear}}&amp;lt;!-- make the Shapiro picture not obliterate the next section heading --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Predicted consequences of the Theories==&lt;br /&gt;
===Time dilation===&lt;br /&gt;
&amp;lt;!-- NOTE [[Time dilation]] redirects to this section, so the section name should not be changed without amending that redirect. --&amp;gt;&lt;br /&gt;
[[Image:Light cone.png|right|thumb|Light-cone diagram]]&lt;br /&gt;
One important consequence of SR's postulates is that an observer in one reference frame will observe a clock in another frame to be &amp;quot;ticking&amp;quot; more slowly than in the observer's own frame. This can be proven mathematically using basic geometry, if the postulates are physically true without exception.&lt;br /&gt;
&lt;br /&gt;
The length of an event &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, as seen by a (relative) stationary observer observing an event is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; t = \frac{t_{0}} {\sqrt{1 - \frac{v^{2}}{c^{2}}}}&amp;lt;/math&amp;gt;    &lt;br /&gt;
&lt;br /&gt;
Where &lt;br /&gt;
:&amp;lt;math&amp;gt;t_0&amp;lt;/math&amp;gt; is the &amp;quot;proper time&amp;quot; or the length of the event in the observed frame of reference.&lt;br /&gt;
:&amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; is the relative velocity between the reference frames.&lt;br /&gt;
:&amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt; is the speed of light (3x10&amp;lt;sup&amp;gt;8&amp;lt;/sup&amp;gt; ms&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
Evidence for time dilation was discovered by studying [[muon decay]]. [[Muons]] are [[subatomic]] [[particles]] with a very short [[halflife]] (1.53 microseconds at rest) and a very fast speed (0.994c). By putting muon detectors at the top (D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;) and bottom (D&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;) of a mountain with a separation of 1900m, scientists could measure accurately the proportion of muons reaching the second detector in comparison to the first. The proportion found was different to the proportion that was calculated without taking into account relativistic effects.&lt;br /&gt;
&lt;br /&gt;
Using the equation for [[exponential decay]], they could use this proportion to calculate the time taken for the muons to decay, relative to the muon. Then, using the time dilation equation they could then work out the dilated time. The dilated time showed a good correlation with the time it took the muons to reach the second sensor, thereby supporting the existence of time dilation.&lt;br /&gt;
&lt;br /&gt;
The time taken for a muon to travel from D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; to D&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; as measured by a stationary observer is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; t = \frac{s}{v} = \frac{1900}{0.994\times(3\times10^{8})} = 6.37\mu\textrm{s}  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The fraction of muons arriving at D&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; in comparison to D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; was 0.732. (Given by &amp;lt;math&amp;gt; \frac{N}{N_0} = 0.732 &amp;lt;/math&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Since (from the equation for exponential decay) &amp;lt;math&amp;gt; \frac{N}{N_{0}} =  e^{-\lambda t_{0}} &amp;lt;/math&amp;gt; then&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; t_{0} = \frac {ln(0.732)}{ln (0.2)} \times 1.53\times 10^{-6} = 0.689\mu\textrm{s}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This gives the time for the proportion of decay to occur for an observer who is stationary, relative to the muon.&lt;br /&gt;
&lt;br /&gt;
Putting this into the time dilation equation gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; t = \frac{t_{0}}{\sqrt{1 - \frac{v^{2}}{c^{2}}}} = \frac{0.689 \times{10^{-6}}}{\sqrt{1 - \frac{0.994^{2}}{1^{2}}}} = 6.3\times 10^{-6}\textrm{s}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is in good agreement with the value calculated above, thereby providing evidence to support time dilation.&lt;br /&gt;
&lt;br /&gt;
====Time Dilation and Creation Science====&lt;br /&gt;
&lt;br /&gt;
{{main|Starlight problem#Humphreys.27_model}}&lt;br /&gt;
&lt;br /&gt;
Creation scientists such as physicists Dr. [[Russell Humphreys]] and Dr. [[John Hartnett]] have used relativistic time dilation to explain how the earth can be only 6,000 years old even though cosmological data (background radiation, supernovae, etc.) set a much older age for the universe.&lt;br /&gt;
&lt;br /&gt;
===Length contraction===&lt;br /&gt;
When two inertial reference frames move past each other in a straight line with constant relative velocity, an observer in one reference frame would observe a metre rule in the other frame to be shorter.&lt;br /&gt;
&lt;br /&gt;
The length, &amp;lt;math&amp;gt;l&amp;lt;/math&amp;gt;, of an object as seen by a (relative) stationary observer is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; l = l_{0} \sqrt{1- \frac{v^{2}}{c^{2}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &lt;br /&gt;
:&amp;lt;math&amp;gt;l_0&amp;lt;/math&amp;gt; is the &amp;quot;proper length&amp;quot; or the length of the object in the observed frame of reference.&lt;br /&gt;
:&amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; is the relative velocity between the reference frames.&lt;br /&gt;
:&amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt; is the speed of light (3x10&amp;lt;sup&amp;gt;8&amp;lt;/sup&amp;gt; ms&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
===Mass increase===&lt;br /&gt;
&lt;br /&gt;
For decades the theory of relativity taught that as a body moves with increasing velocity its [[mass]] also increases.&amp;lt;ref&amp;gt;For example, this was taught as recently as in the 1991 edition of the Encyclopedia Britannica.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Under this view, the mass, &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt;, of an object as detected by a (relative) stationary observer is given by:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; m = \frac{m_{0}} {\sqrt{1 - \frac{v^{2}}{c^{2}}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &lt;br /&gt;
:&amp;lt;math&amp;gt;m_0&amp;lt;/math&amp;gt; is the &amp;quot;rest mass&amp;quot; or the mass of the object when it is at rest.&lt;br /&gt;
:&amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; is the relative velocity of the object.&lt;br /&gt;
:&amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt; is the speed of light (3x10&amp;lt;sup&amp;gt;8&amp;lt;/sup&amp;gt; ms&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
Since speed is relative, it follows that two observers in different inertial reference frames may disagree on the mass and kinetic energy of a body. Since all inertial reference frames are treated on an equal footing, it follows that mass and energy are interchangeable.&lt;br /&gt;
&lt;br /&gt;
In recent years most physicists have shifted away from Einstein's original reliance on relativistic mass and his suggestion that mass increases{{Citation needed|date=January 2012}}.  Instead, most physicists today teach that &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{d}{d\tau} p&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;p&amp;lt;/math&amp;gt; is the momentum defined by &amp;lt;math&amp;gt;\gamma m v&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is the standard Lorentz factor, and &amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt; is the proper time. Force F defined this way is a vector and thus can handle the directional aspect of the relativistic effects better than the concept of relativistic mass can.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The abandonment by physicists of the concept of relativistic mass, however, has the consequence of undermining the traditional claim under relativity that&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;m - m_0 = \frac{E}{c^2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
also popularly known as&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;E = m c^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now a concept of the 4-momentum &amp;lt;math&amp;gt;p&amp;lt;/math&amp;gt; of a particle is taught, such that the square of the magnitude of &amp;lt;math&amp;gt;p&amp;lt;/math&amp;gt; satisfies:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;||p||^2 = -p_x^2-p_y^2-p_z^2+E^2 = m_0^2c^4&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
in any inertial reference frame. The magnitude of the 4-momentum, in any inertial frame, equals the rest mass &amp;lt;math&amp;gt;m_0&amp;lt;/math&amp;gt; of the particle (in units where &amp;lt;math&amp;gt;c=1&amp;lt;/math&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
== Paradoxes ==&lt;br /&gt;
&lt;br /&gt;
The predictions of the theory of relativity throw up a number of apparent paradoxes and anomalies relating to the effects of time dilatation and length contraction. Whilst these paradoxes are consistent with the theory, they are contrary to everyday human experience and therefore can seem like impossibilities.&lt;br /&gt;
&lt;br /&gt;
=== The Twin Paradox ===&lt;br /&gt;
&lt;br /&gt;
The twin paradox is usually stated as a thought experiment involving two twins, one of whom is sent on a long journey in a spacecraft travelling at close to the speed of light, whilst the other remains on Earth. Time dilatation means that the travelling twin, on his return to Earth, is younger that the twin who has remained at home. However because neither twin is in a special position - each being in an inertial frame of reference - the reverse must also be true, and so the twin remaining on Earth must be younger. Hence each twin is younger than the other - a paradox.&lt;br /&gt;
&lt;br /&gt;
The problem can be resolved in two ways. One is to examine the effects of General Relativity: to come back to Earth, the travelling twin must undergo acceleration in order to reverse his course, causing temporal effects which make him permanently the younger. Alternatively, it can be explained entirely using Special Relativity and noting that the twins are not in symmetrical situations: the one on earth has remained in a single inertial frame of reference, whilst the travelling twin has travelled in two&amp;lt;ref&amp;gt;http://mentock.home.mindspring.com/twins.htm&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== The Ehrenfest Paradox ===&lt;br /&gt;
&lt;br /&gt;
The Ehrenfest Paradox considers a rigid wheel or disc rotating a bout its axis at high speed (somewhat like a bicycle wheel spinning freely on its axle). The rim of the wheel travels at close to the speed of light and therefore undergoes length contraction, whereas the radius (the spokes, for the bicycle wheel) does not. Hence the circumference is no longer equal to 2&amp;lt;big&amp;gt;&amp;lt;math&amp;gt;\pi&amp;lt;/math&amp;gt;&amp;lt;/big&amp;gt;r, which is paradoxical.&lt;br /&gt;
&lt;br /&gt;
The apparent paradox was finally resolved in 1975 by the Norwegian scientist [[Øyvind Grøn]]&amp;lt;ref&amp;gt;http://www.physicsforums.com/showthread.php?t=224955&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Variable Speed of Light ==&lt;br /&gt;
&lt;br /&gt;
The Theory of Relativity implies that physical constants like c, the speed of light in a vacuum, have remained constant.  But at least one study suggests that physical constants, and possibly even the speed of light, have changed as the universe has aged.&amp;lt;ref&amp;gt;James Glanz and Dennis Overbye, &amp;quot;Cosmic Laws Like Speed of Light Might Be Changing, a Study Finds,&amp;quot; August 15, 2001.[http://www.nytimes.com/2001/08/15/science/15PHYS.html?ex=1185076800&amp;amp;en=d6467b6e3e346796&amp;amp;ei=5070]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;For the first time, scientists have experimentally demonstrated that sound pulses can travel at velocities faster than the speed of light, c. William Robertson's team from Middle Tennessee State University also showed that the group velocity of sound waves can become infinite, and even negative. ...  Although such results may at first appear to violate special relativity (Einstein's law that no material object can exceed the speed of light), the actual significance of these experiments is a little different. These types of superluminal phenomena, Robertson et al. explain, violate neither causality nor special relativity, nor do they enable information to travel faster than c. In fact, theoretical work had predicted that the superluminal speed of the group velocity of sound waves should exist.  'The key to understanding this seeming paradox is that no wave energy exceeded the speed of light,' said Robertson.&amp;quot;&amp;lt;ref&amp;gt;http://www.physorg.com/news88249076.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;A team of researchers from the Ecole Polytechnique Fédérale de Lausanne (EPFL) has successfully demonstrated, for the first time, that it is possible to control the speed of light – both slowing it down and speeding it up – in an optical fiber, using off-the-shelf instrumentation in normal environmental conditions. Their results, to be published in the August 22 issue of Applied Physics Letters, could have implications that range from optical [[computing]] to the fiber-optic telecommunications industry.&amp;quot;&amp;lt;ref&amp;gt;http://www.scienceblog.com/light.html&amp;lt;/ref&amp;gt; Both slowing down and speeding up of light within a substance other than a vacuum is made possible, because the light travels through the material, and that material affects the speed of light, i.e. a photon hits an electron, which then exits and emits a slightly lower energy photon out in the direction that the original photon was traveling, thus maintaining conservation of momentum. No matter how transparent an object may appear, it radically impacts the speed of the light traveling through it, as demonstrated by the refractive production of a rainbow by a crystal, which Newton himself discovered.&lt;br /&gt;
&lt;br /&gt;
This apparent change in speed can be explained, however, by noting that the constant c refers to the speed of light in a vacuum, ie, when it is unimpeded. The speed of light when traveling through physical media is, in fact, variable.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;A pair of German physicists claim to have broken the speed of light - an achievement that would undermine our entire understanding of space and time. ...    Dr Nimtz told New Scientist magazine: 'For the time being, this is the only violation of special relativity that I know of.'&amp;quot;&amp;lt;ref&amp;gt;http://www.telegraph.co.uk/earth/main.jhtml?xml=/earth/2007/08/16/scispeed116.xml&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Pending research==&lt;br /&gt;
&lt;br /&gt;
Today some physicists are working on hypothesizing how general relativity might have related to the other three forces of nature during the first fraction of a second of the [[Big Bang]]. Two of the more commonly studied attempts are [[string theory]] and [[loop quantum gravity]], but they have failed to produce any evidence that science mandates a science must have, and both typically take large amounts of work to even conform to what scientists believe.  Critics increasingly point out that string theory and loop quantum gravity are largely untestable and unfalsifiable, and thus potentially unscientific under the principles of science advanced by [[Karl Popper]].&amp;lt;ref&amp;gt;See, for example, ''Not Even Wrong'', by Peter Woit&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Relativity continues to be tested and some physics professors remain skeptical of the theory, such as University of Maryland physics professor Carroll Alley, who served as the principle physicist on the Apollo lunar project.&amp;lt;ref&amp;gt;http://science.nasa.gov/headlines/y2004/21jul_llr.htm&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Political aspects of relativity ==&lt;br /&gt;
&lt;br /&gt;
Some [[liberal]] politicians have extrapolated the theory of relativity to metaphorically justify their own political agendas. For example, [[Democratic]] [[President of the United States of America|President]] [[Barack Obama]] helped publish an article by liberal law professor [[Laurence Tribe]] to apply the relativistic concept of &amp;quot;curvature of space&amp;quot; to promote a broad legal right to [[abortion]].&amp;lt;ref&amp;gt;Tribe, acknowledging help by Obama, argued that the [[Constitution]] should be interpreted to establish a right to federally funded [[abortion]] and that, more generally, ''[[Roe v. Wade]]'' does not go far enough.  They insisted that a relativistic &amp;quot;curvature of space&amp;quot; could achieve this result by expanding application of the [[Constitution]] based on its impact on personal choice.  &amp;quot;The ''[[Roe v. Wade]]'' opinion ignored the way in which laws regulating pregnant women may shape the entire pattern of relationships among men, women, and children. It conceptualized abortion not in terms of the intensely public question of the subordination of women to men through the exploitation of pregnancy, but in terms of the purportedly private question of how women might make intimately personal decisions about their bodies and their lives. That vision described a part of the truth, but only what might be called the Newtonian part. ... [A] change in the surrounding legal setting can constitute state action that most threatens the sphere of personal choice. And it is a 'curved space' perspective on how law operates that leads one to focus less on the visible lines of legal force and more on how those lines are bent and directed by the law's geometry.&amp;quot;  Laurence H. Tribe, The Curvature of Constitutional Space: What Lawyers Can Learn from Modern Physics, 103 Harv. L. Rev. 1, 16-17 (1989).&amp;lt;/ref&amp;gt;  As of June 2008, over 170 law review articles have cited this [[liberal]] application of the theory of relativity to legal arguments.&amp;lt;ref&amp;gt;Search conducted by [[User:Aschlafly]] in the LEXIS database &amp;quot;US Law Reviews and Journals, Combined,&amp;quot; conducted June 1, 2008.&amp;lt;/ref&amp;gt;  Applications of the theory of relativity to change morality have also been common.&amp;lt;ref&amp;gt;&amp;quot;Mistakenly, in the minds of many, the theory of relativity became relativism.&amp;quot;[http://www.worldnetdaily.com/news/article.asp?ARTICLE_ID=38081]&amp;lt;/ref&amp;gt;   Moreover, there is an unmistakable effort to censor or ostracize criticism of relativity.&amp;lt;ref&amp;gt;Although the [[Examples of Bias in Wikipedia|liberally biased Wikipedia]] contains lengthy criticisms of the subjects of many entries, and even though publications like ''The Economist'' recognize the lack of scientific satisfaction in the theory (see, e.g., &amp;quot;Weighing the Universe,&amp;quot; The Economist (Jan. 25, 2007)), Wikipedia's entry on [http://en.wikipedia.org/wiki/Theory_of_Relativity Theory of Relativity] omits one word of criticism.&amp;lt;/ref&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
Physicist [[Robert Dicke]] of Princeton University was a prominent critic&amp;lt;ref&amp;gt;http://www.time.com/time/magazine/article/0,9171,943324,00.html&amp;lt;/ref&amp;gt; of general relativity, and Dicke's alternative &amp;quot;has enjoyed a renaissance in connection with theories of higher dimensional space-time.&amp;quot;&amp;lt;ref&amp;gt;&amp;quot;Initially a popular alternative to General Relativity, the Brans-Dicke theory lost favor as it became clear that omega must be very large-an artificial requirement in some views. Nevertheless, the theory has remained a paradigm for the introduction of scalar fields into gravitational theory, and as such has enjoyed a renaissance in connection with theories of higher dimensional space-time.&amp;quot;[http://nedwww.ipac.caltech.edu/level5/Glossary/Essay_bekenstein.html]  &amp;lt;/ref&amp;gt;  Despite being one of the most accomplished physicists in the 20th century, Dicke was repeatedly passed over for a [[Nobel Prize]], and in at least one case Dicke was insulted by the award being granted to others for contributions more properly credited to Dicke.&lt;br /&gt;
&lt;br /&gt;
There has been little recognition by the Nobel Prize committee of either theory of relativity, and particularly scant recognition of the Theory of General Relativity. Although the 1993 Nobel prize in physics was awarded Hulse and Taylor for finding the first evidence of gravitational waves in the orbital decay of the binary pulsar PSR1913+16 &amp;lt;ref&amp;gt;Weisberg, Joel M.; Taylor, Joseph H. (2003), &amp;quot;The Relativistic Binary Pulsar B1913+16&amp;quot;&amp;quot;, in Bailes, M.; Nice, D. J.; Thorsett, S. E., Proceedings of &amp;quot;Radio Pulsars,&amp;quot; Chania, Crete, August, 2002, ASP Conference Series&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Government Support for Relativistic research===&lt;br /&gt;
The Theory of Relativity enjoys a disproportionate share of [[federal funding]] of physics research today.&amp;lt;ref&amp;gt;The Democratic Congress insisted on the $250 million LIGO project despite substantial criticism by scientists that it was wasting scarce research dollars.  John Travis, &amp;quot;LIGO: a $ 250 million gamble; Laser Interferometer Gravitational-Wave Observatory; includes related article,&amp;quot; ''Science'' p. 612 (Apr. 30, 1993).  &amp;quot;Adding to the acrimony is LIGO's $ 250 million price tag, which some hold responsible for NSF's recent funding woes.&amp;quot;  ''Id.''&amp;lt;/ref&amp;gt;  In at least one case that research has been unsuccessful.  The $365 million dollar [[LIGO]] project has failed to detect the gravity waves predicted by relativity.&amp;lt;ref&amp;gt;http://www.npr.org/programs/atc/features/2002/sept/gravitywaves/index.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Relativity}}&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
{{reflist|2}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Physics]]&lt;br /&gt;
[[Category:Science]]&lt;br /&gt;
&lt;br /&gt;
==External Links ==&lt;br /&gt;
*[http://ia331314.us.archive.org/2/items/theeinsteintheor11335gut/11335-h/11335-h.htm The Einstein Theory of Relativity, by H.A. Lorentz.]&lt;br /&gt;
*[http://www.relativitycalculator.com Relativity Calculator  - Learn Special Relativity Mathematics ]  The mathematics of special relativity presented in as simple and comprehensive manner possible within philosophical and historical contexts.&lt;/div&gt;</summary>
		<author><name>RolandPlankton</name></author>
	</entry>
	<entry>
		<id>https://www.conservapedia.com/index.php?title=Chomsky_hierarchy&amp;diff=980820</id>
		<title>Chomsky hierarchy</title>
		<link rel="alternate" type="text/html" href="https://www.conservapedia.com/index.php?title=Chomsky_hierarchy&amp;diff=980820"/>
		<updated>2012-05-11T18:16:50Z</updated>

		<summary type="html">&lt;p&gt;RolandPlankton: /* Example */ adjust spacing&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The '''Chomsky hierarchy''', sometimes known as the '''Chomsky-Schützenberger hierarchy''', is a hierarchy of formal grammatical systems for describing various classes of languages; the hierarchy can apply to both human and computer languages. This hierarchy was first published in 1956 by [[Noam Chomsky|Chomsky]].&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite journal &lt;br /&gt;
| title = Three models for the description of language &lt;br /&gt;
| year = 1956 &lt;br /&gt;
| last = Chomsky &lt;br /&gt;
| first = Noam &lt;br /&gt;
| journal = IRE Transactions on Information Theory &lt;br /&gt;
| volume = 2 &lt;br /&gt;
| pages = 113–124 &lt;br /&gt;
| url = http://www.chomsky.info/articles/195609--.pdf &lt;br /&gt;
| accessdate = 2012-04-08&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
These grammatical systems were referred to by Chomsky as ''transformational grammars''.  Other linguists have since developed a variety of similar grammars; together these are known as ''generative grammars''. &lt;br /&gt;
&lt;br /&gt;
The basic idea of a '''generative grammar''' is to provide a set of rules which are capable of generating all possible grammatical sentences in some language; the rules must constrain the generation so that only grammatical sentences are generated. The rules can also be used in reverse to parse a sentence and check if it is grammatical.&lt;br /&gt;
&lt;br /&gt;
In the late 1950's, [[John Backus]] and Peter Naur developed a notation for describing [[programming language]]s. This notation is known as [[Backus Naur Form]] (or BNF) and turns out to be equivalent to Chomsky's grammar number two (context-free grammar), although it was developed independently of Chomsky's work. Backus-Naur Form was first used in the Algol 60 Report to specify the syntax of [[Algol 60]], and has since been used for specifying the syntax of other programming languages. &lt;br /&gt;
&lt;br /&gt;
==Example of a very simple generative grammar==&lt;br /&gt;
This very simple example can handle only a tiny subset of English and should not be taken seriously as a guide to English grammar or vocabulary. It is based on an example by David Crystal&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite book &lt;br /&gt;
| last = Crystal &lt;br /&gt;
| first = David  &lt;br /&gt;
| title = The Cambridge Encyclopedia of Language &lt;br /&gt;
| publisher = Cambridge University Press &lt;br /&gt;
| year = 1987 &lt;br /&gt;
| isbn = 0-521-42443-7&lt;br /&gt;
| pages = page 97&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; and is a slight extension of an example on slide 9 of this lecture.&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.cs.princeton.edu/~rywang/99f126/slides/16th.pdf&lt;br /&gt;
| title = Lecture notes: Formal Languages&lt;br /&gt;
| accessdate = 2012-04-07}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase''         # A ''Sentence'' consists of a ''NounPhrase'' followed by a ''VerbPhrase''&lt;br /&gt;
 ''NounPhrase'' -&amp;gt;  ''Determiner'' ''Noun''               # A ''NounPhrase'' consists of a ''Determiner'' followed by a ''Noun''&lt;br /&gt;
 ''VerbPhrase'' -&amp;gt;  ''Verb'' ''NounPhrase''               # A ''VerbPhrase'' consists of a ''Verb'' followed by a ''NounPhrase''&lt;br /&gt;
 ''Determiner'' -&amp;gt;  '''a''', '''the'''                        # A ''Determiner''  is one of: '''a''' or '''the'''&lt;br /&gt;
 ''Noun''       -&amp;gt;  '''boy''', '''girl''', '''dog'''                # A ''Noun'' is one of: '''boy''' or '''girl''' or '''dog'''  &lt;br /&gt;
 ''Verb''       -&amp;gt;  '''chased''', '''heard''', '''saw'''            # A ''Verb'' is one of: '''chased''' or '''heard''' or '''saw'''&lt;br /&gt;
&lt;br /&gt;
Notation used above: &lt;br /&gt;
:The symbol &amp;quot;-&amp;gt;&amp;quot; means &amp;quot;can be replaced by&amp;quot;.  &lt;br /&gt;
:When there are several items on the right hand side separated by commas, just one of these items can be selected. &lt;br /&gt;
:The comments preceded by &amp;quot;#&amp;quot; are not part of the generative grammar, but hopefully will help folks understand the example a little better.&lt;br /&gt;
&lt;br /&gt;
By making appropriate substitutions we can generate such sentences as:&lt;br /&gt;
:The dog chased a girl.&lt;br /&gt;
:The girl heard the dog.&lt;br /&gt;
:The boy saw a girl.&lt;br /&gt;
&lt;br /&gt;
The stages in the generation of these examples are as follows:&lt;br /&gt;
:''Sentence''&lt;br /&gt;
:-&amp;gt; ''NounPhrase'' ''VerbPhrase''&lt;br /&gt;
:-&amp;gt; ''Determiner'' ''Noun'' ''Verb'' ''NounPhrase''&lt;br /&gt;
:-&amp;gt; ''Determiner'' ''Noun'' ''Verb'' ''Determiner'' ''Noun''&lt;br /&gt;
&lt;br /&gt;
By appropriate selection of words to substitute for ''Determiner'', ''Noun'', and ''Verb'' we can produce the 3 example sentences above.&lt;br /&gt;
&lt;br /&gt;
The simple grammar defines a few words which can be substituted for ''Determiner'', ''Noun'', and ''Verb''. There are two possibilities for ''Determiner'', three for ''Noun'', and three for ''Verb'', with both ''Determiner'' and ''Noun'' appearing twice in the expansion. Hence the total number of grammatical sentences which can be generated by this simple grammar is 108 (= 2 * 3 * 3 * 2 * 3). In this particular case the possible words have been carefully chosen so that all of these 108 sentences also actually mean something.&lt;br /&gt;
&lt;br /&gt;
Note that the use of ''italics'' and '''boldface''' in this example is merely a convenient way of indicating the difference between items which can be expanded further (e.g. concepts such as ''NounPhrase'') and items which can not be expanded further (e.g. words such as '''girl'''). In the linguistic literature, items which can be expanded further are referred to as 'non-terminal' items, while items which can't be expanded further are known as 'terminal' items.&lt;br /&gt;
&lt;br /&gt;
The 'comma' notation for alternatives is a form of shorthand. In some formulations this would be shown as several separate rules, so that:&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''a''', '''the''' &lt;br /&gt;
could be shown as two rules:&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''a'''&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''the''' &lt;br /&gt;
&lt;br /&gt;
==Caution==&lt;br /&gt;
While a generative grammar may produce sentences which are grammatically correct, there is no certainty that such sentences will actually mean anything. The classic example of such a meaningless sentence is from Chomsky's book&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite book &lt;br /&gt;
| last = Chomsky &lt;br /&gt;
| first = Noam &lt;br /&gt;
| title = Syntactic Structures &lt;br /&gt;
| year = 1957 &lt;br /&gt;
| publisher = Mouton &lt;br /&gt;
| location = The Hague/Paris &lt;br /&gt;
| pages = page 15 &lt;br /&gt;
| isbn = 3-11-017279-8&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; with the grammatically correct sentence:&lt;br /&gt;
&lt;br /&gt;
:&amp;quot;Colorless green ideas sleep furiously.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
:This example illustrates the difference between grammar/syntax and meaning/semantics.&lt;br /&gt;
&lt;br /&gt;
Another problem when analysing a sentence is that many English words have multiple meanings, so that there may be more than one way to interpret a sentence. A simple example is the sentence: &lt;br /&gt;
:&amp;quot;Time flies.&amp;quot; &lt;br /&gt;
:Is this an instruction to check how fast flies are flying, or an indication that time appears to be passing quickly? &lt;br /&gt;
:A varied and entertaining selection of such ambiguities has been compiled by Jeff Gray.&amp;lt;ref&amp;gt;{{Cite web &lt;br /&gt;
| title = Collection of Ambiguous or Inconsistent/Incomplete Statements  &lt;br /&gt;
| url = http://www.gray-area.org/Research/Ambig/ &lt;br /&gt;
| author = Jeff Gray&lt;br /&gt;
| accessdate = 2012-04-10&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Formal grammar==&lt;br /&gt;
'''Note''': this section and subsequent sections are, by necessity, slightly more technical/formal than the earlier parts of this article, though specialist notation and abbreviations have been largely avoided. Make sure that you understand the 'Simple example' above before proceeding further, since references will be made to that example to help explain the technicalities, and variations on that example will be used to illustrate new ideas. &lt;br /&gt;
&lt;br /&gt;
A formal generative grammar has four components (as described in slide 19 of this lecture&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://adammikeal.org/courses/compute/Chomsky%20Presentation.pdf&lt;br /&gt;
| title = The Chomsky Hierarchy&lt;br /&gt;
| accessdate = 2012-04-06&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
):&lt;br /&gt;
# a finite number of non-terminal concepts (e.g. ''VerbPhrase'' in the example, or anything else in ''italics''),&lt;br /&gt;
# a finite number of terminal items (e.g. '''girl''' in the example, or anything else in '''bold-face''').&lt;br /&gt;
# a finite set of rules for transforming non-terminal items (e.g. the example has 6 rules).&lt;br /&gt;
# a single starting point (e.g. ''Sentence'' in the example).&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
:Terminal items are those which can not be transformed into anything else.&lt;br /&gt;
:A list of all the terminal items is effectively the vocabulary from which sentences are built.&lt;br /&gt;
:Non-terminal items are those which can be transformed into something else.&lt;br /&gt;
:Linguists have developed various classes of grammars by using constraints to govern what sort of rules can be used for any particular grammar.&lt;br /&gt;
&lt;br /&gt;
===Changing the rules===&lt;br /&gt;
An relatively small change to even a single rule can make a large change in the language which can be generated. For example, change the first rule in the simple example to read:&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''NounPhrase'' ''VerbPhrase'' '''and''' ''NounPhrase'' ''VerbPhrase''&lt;br /&gt;
This means that a ''Sentence'' is either a ''NounPhrase'' followed by a ''VerbPhrase'' or a ''NounPhrase'' followed by a ''VerbPhrase'' followed by '''and''' followed by a ''NounPhrase'' followed by a ''VerbPhrase''. In addition to the shorter sentences already discussed, this could also generate a sentence such as: &amp;quot;A dog saw a girl and the dog chased the girl&amp;quot;. The total number of grammatically-correct sentences which can be generated by this modified grammar is now 11,772 (108 + 108*108), though some of these may not be very meaingful.&lt;br /&gt;
&lt;br /&gt;
===Towards infinity===&lt;br /&gt;
A significantly different rule change can have an astounding effect. Consider changing the first rule to read:&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''NounPhrase'' ''VerbPhrase'' '''and''' ''Sentence''&lt;br /&gt;
This can generate a potentially infinite number of sentences (any number of these five-word sentences linked by '''and'''). This is an example of what is known as a [[Recursion|recursive]] definition, whereby a ''Sentence'' is partially defined in terms of itself. In such a recursive rule there must be at least one transformation option which does not involve ''Sentence'', otherwise the transformation could never stop.&lt;br /&gt;
&lt;br /&gt;
The above change is known as right-recursive; a left-recursive formulation is also possible, and can in this example generate exactly the same sentences. As shown below  under 'Context-free grammar', there are situations where the choice of left- or right-recursive formulations can change the meaning. &lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''Sentence'' '''and''' ''NounPhrase'' ''VerbPhrase'' &lt;br /&gt;
&lt;br /&gt;
The distinction between left- and right-recursive grammars becomes important when trying to parse/analyse a sentence; some types of parser work best with left-recursive grammars, while other types work best with right-recursive grammars. This distinction is particularly relevant in connection with [[compiler|compiling or translating]] a program written in some high-level [[programming language]] so that it can be used on a [[computer]].&lt;br /&gt;
&lt;br /&gt;
==Chomsky hierarchy==&lt;br /&gt;
By imposing different constraints&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.cs.uaf.edu/2011/spring/cs331/lectures/cs331_20110124_grammar.html&lt;br /&gt;
| title = Lecture notes: Languages &amp;amp; Grammars&lt;br /&gt;
| accessdate = 2012-04-07&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; &lt;br /&gt;
as to what sort of transformation rules could be used, Chomsky was able to define four strictly nested transformational grammars, which he numbered from 0 to 3. As the grammar number increases, the generated language becomes simpler. As the grammar number decreases, parsing a sentence in that language becomes more difficult.&lt;br /&gt;
Other linguists have described formal grammars which fit in between the various Chomsky levels. &lt;br /&gt;
&lt;br /&gt;
The following table provides a summary, which is then explained further in the subsequent subsections.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!| Chomsky&amp;lt;br&amp;gt;number || linguistic name || Rule constraints || Recogniser+ || Notes &lt;br /&gt;
|-&lt;br /&gt;
| 0 || recursively enumerable || [anything] -&amp;gt; [anything] || Turing machine || most human languages &lt;br /&gt;
|-&lt;br /&gt;
| 1 || context-sensitive || X ''A'' Y -&amp;gt; X [anything] Y || linear bounded automaton || X and Y provide the context in which ''A'' can be transformed &lt;br /&gt;
|-&lt;br /&gt;
| 2 || context-free || ''A'' -&amp;gt; [anything] || non-deterministic push-down automaton || syntax analysis for most programming languages &lt;br /&gt;
|-&lt;br /&gt;
| 3 || regular || ''A'' -&amp;gt; [nothing]&amp;lt;br&amp;gt;''A'' -&amp;gt; '''xyz'''&amp;lt;br&amp;gt;''A'' -&amp;gt; '''xyz''' ''B'' || finite automaton&amp;lt;br&amp;gt;or finite state machine || lexical analysis (combining characters into words/tokens)  &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''+''' The '''recogniser''' column indicates the type of mathematical or computer science theoretical model needed to recognise that a sentence belongs to a language, essentially by applying the transformation rules in reverse to work backwards from the actual words in order to finish up with a ''sentence'' (in programming languages the starting concept is usually a ''program''). A finite automaton uses only a small fixed amount of memory, operates in time proportional to the length of the input, and always reaches a decision, while a Turing machine may use an infinite amount of memory and time and may fail to reach a decision (may never stop).&lt;br /&gt;
&lt;br /&gt;
In the linguistic literature, [nothing] is often represented by the symbol '''ε'''.&lt;br /&gt;
&lt;br /&gt;
The descriptions of the various Chomsky levels which follow are presented in reverse order, so as to work up from a simple case to a rather complicated case.&lt;br /&gt;
&lt;br /&gt;
===Level 3: regular grammar===&lt;br /&gt;
The transformation rules for regular grammars are required to be very simple. &lt;br /&gt;
*Only a single non-terminal item can appear on the left-hand side of a rule.&lt;br /&gt;
*The right-hand side of any rule must be one of:&lt;br /&gt;
**[nothing].&lt;br /&gt;
**a terminal item.&lt;br /&gt;
**a terminal item followed by a non-terminal item.&lt;br /&gt;
Note that instead of a terminal item we could have a non-terminal item whose transformation rule immediately resolves to a single terminal item, or to one of several terminal items.&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
Informally we can define a 'word' as a sequence of one or more ''Letter''s. The following regular grammar provides a more formal definition; for simplicity it is restricted to lower-case letters.&lt;br /&gt;
&lt;br /&gt;
 ''Word''     -&amp;gt; ''Letter'' ''PartWord''&lt;br /&gt;
 ''PartWord'' -&amp;gt; [nothing]&lt;br /&gt;
 ''PartWord'' -&amp;gt; ''Letter'' ''PartWord''&lt;br /&gt;
 ''Letter''   -&amp;gt; '''a''', '''b''', ... '''z'''&lt;br /&gt;
&lt;br /&gt;
Note that ''PartWord'' is recursively defined, with the recursion stopping if it is transformed into [nothing].&lt;br /&gt;
&lt;br /&gt;
For one-letter words we expand as: &lt;br /&gt;
:''Word'' -&amp;gt; ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' [nothing] -&amp;gt; ''Letter''&lt;br /&gt;
&lt;br /&gt;
For two-letter words we expand as: &lt;br /&gt;
:''Word'' -&amp;gt; ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' ''Letter'' [nothing] -&amp;gt;  ''Letter'' ''Letter''&lt;br /&gt;
&lt;br /&gt;
Obviously, words of any length can be constructed, though they may well not actually be words from any language. &lt;br /&gt;
&lt;br /&gt;
====Discussion====&lt;br /&gt;
Trying to devise transformation rules to produce words which are more English-like is much more difficult - how do you insist on at least one vowel or on no more than 5 consecutive consonants (e.g. as in 'strengths').&lt;br /&gt;
&lt;br /&gt;
Further examples in [[Regular grammar]] show how numbers can be defined via a regular grammar, and also show how a hyphenated word could be defined.&lt;br /&gt;
&lt;br /&gt;
One of the limitations of a regular grammar is that it can't cope with nested matching brackets, so that it is impossible to write a regular grammar to describe an expression such as '''2 * (3+4)''' where that grammar is expected to allow brackets nested to any depth. A context-free grammar is needed for this, as described in the next section.&lt;br /&gt;
&lt;br /&gt;
Regular grammars or equivalent are widely used by [[compiler]]s in the lexical analysis of programming languages.&lt;br /&gt;
&lt;br /&gt;
===Level 2: context-free grammar===&lt;br /&gt;
The transformation rules for context-free grammars don't appear that much different from those for regular grammars. &lt;br /&gt;
*Only a single non-terminal item can appear on the left-hand side of a rule.&lt;br /&gt;
*The right-hand side of any rule must be one of:&lt;br /&gt;
**[nothing].&lt;br /&gt;
**any combination of terminal items and non-terminal items.&lt;br /&gt;
&lt;br /&gt;
The key difference is that in a regular grammar, any non-empty rule must effectively start with terminal item so that every rule transformation makes some immediate progress, while in a context-free grammar a rule could start with a non-terminal item which itself could be subject to arbitrary further transformations.&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
The following example shows how context-free grammars can cope with arithmetic expressions involving possibly nested brackets. Also an expression such as &amp;quot;2 + 3 * 4&amp;quot; could be interpreted as either &amp;quot;(2 + 3) * 4&amp;quot; = 20 or as &amp;quot;2 + (3 * 4)&amp;quot; = 14. The latter interpretation is that which is normally used - multiplication &amp;quot;*&amp;quot; is said to have a higher priority than addition &amp;quot;+&amp;quot; - so the grammar must incorporate this priority concept. Furthermore, consecutive operators of the same priority are normally applied from left to right, so that &amp;quot;8 - 2 + 3&amp;quot; is interpreted as &amp;quot;(8 - 2) + 3&amp;quot; = 9, rather than as &amp;quot;8 - (2 + 3)&amp;quot; = 3.  This ordering must also be built in to the grammar.&lt;br /&gt;
&lt;br /&gt;
To avoid distracting side-issues, this example only deals with numbers which consist solely of a single digit. The example is a simplified version of the definition of an arithmetic expression given in the Revised Algol 60 Report (Section 3.3.1).&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.masswerk.at/algol60/report.htm&lt;br /&gt;
| title = Revised Report on the Algorithmic Language Algol 60&lt;br /&gt;
| accessdate = 2012-04-22&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ''Expression'' -&amp;gt; ''Term''                        # an ''Expression'' is either a ''Term''&lt;br /&gt;
 ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''    #   or an ''Expression'' followed by '''+''' or '''-''' followed by a ''Term''&lt;br /&gt;
                                           #&lt;br /&gt;
 ''Term''       -&amp;gt; ''Primary''                     # a ''Term'' is either a ''Primary''&lt;br /&gt;
 ''Term''       -&amp;gt; ''Term'' ''MulDivOp'' ''Primary''       #   or a ''Term'' followed by '''*''' or '''/''' followed by a ''Primary''&lt;br /&gt;
                                           #&lt;br /&gt;
 ''Primary''    -&amp;gt; ''Number''                      # a ''Primary'' is either a ''Number''&lt;br /&gt;
 ''Primary''    -&amp;gt; '''(''' ''Expression'' ''')'''              #   or an ''Expression'' enclosed in brackets&lt;br /&gt;
                                           #&lt;br /&gt;
 ''MulDivOp''   -&amp;gt; '''*'''. '''/'''                        # multiplication and division have the same priority&lt;br /&gt;
 ''AddSubOp''   -&amp;gt; '''+'''. '''-'''                        # addition and subtraction have the same priority&lt;br /&gt;
 ''Number''     -&amp;gt; '''0''', '''1''', ... '''9'''                 # this simple-minded definition of a ''Number'' is enough for this example&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
* Both ''Expression'' and ''Term'' are each defined via a left-recursive rule; this ensures that operators of the same priority are applied from left to right.&lt;br /&gt;
* The distinction between ''Expression'' and ''Term'' ensures that multiplication/division are applied before addition/subtraction.&lt;br /&gt;
* ''Expression'' is indirectly recursive via ''Term'' and ''Primary'' to allow bracketed sub-expressions to any depth.&lt;br /&gt;
&lt;br /&gt;
Example 1: generate 2 + 3 * 4&lt;br /&gt;
&lt;br /&gt;
  ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Term'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Primary'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' ''Term''                                 # '''+''' can not be applied until ''Term'' has been evaluated&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' ''Term'' ''MulDivOp'' ''Primary''&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' ''Primary'' ''MulDipOp'' ''Primary''&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' '''3''' '''*''' '''4'''&lt;br /&gt;
&lt;br /&gt;
Example 2: generate 2 * 3 + 4&lt;br /&gt;
&lt;br /&gt;
  ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Term'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Term'' ''MulDivOp'' ''Primary'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Primary'' ''MulDivOp'' ''Primary'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; '''2''' '''*''' '''3''' ''AddSubOp'' ''Term''                      # ''Term'' to left of ''AddSubOp'' is evaluated first&lt;br /&gt;
             -&amp;gt; '''2''' '''*''' '''3''' ''AddSubOp'' ''Primary''  &lt;br /&gt;
             -&amp;gt; '''2''' '''*''' '''3''' '''+''' '''4'''&lt;br /&gt;
&lt;br /&gt;
====Discussion====&lt;br /&gt;
Context-free grammars (or equivalent definitions using Backus-Naur-Form) are widely used both to define the syntax of programming languages and to (semi-automatically) generate parsers for these languages.&lt;br /&gt;
&lt;br /&gt;
A limitation/feature of both regular grammars and context-free grammars is that the left-hand side of any rule is always a single non-terminal item, so any transformation is applied regardless of the context in which that non-terminal item appears.  A simple example which depends on context is the use of singular and plural nouns and verbs in English.  We say: '''the man runs''' or '''the men run''', but neither of '''the man run''' nor '''the men runs'''.  Which form of verb to use depends on the noun, i.e. there is a context dependency.&lt;br /&gt;
&lt;br /&gt;
===Level 1: context-sensitive grammar===&lt;br /&gt;
For context-sensitive grammars the left-hand side of a rule may indicate the context in which that rule applies, so that the same non-terminal item may be transformed in different ways depending on the context in which it appears.&lt;br /&gt;
&lt;br /&gt;
There is only one transformation rule for context-sensitive grammars:&lt;br /&gt;
*X [non-terminal] Y -&amp;gt; X [anything] Y&lt;br /&gt;
&lt;br /&gt;
where X and Y determine the context in which the [non-terminal] is transformed. Note that X and Y may each be terminals or non-terminals or [nothing]. When both X and Y are nothing there is no context and this reduces to a Level 2 or Level 3 grammar.&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
Taylor has provided several examples&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.divms.uiowa.edu/~fleck/taylor.pdf&lt;br /&gt;
| title = Context-sensitive Examples&lt;br /&gt;
| author = Taylor&lt;br /&gt;
| accessdate = 2012-04-26&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
and the following, inspired by his third example, is an extension of the original simple example above to handle singulars and plurals:&lt;br /&gt;
&lt;br /&gt;
 ''Sentence''                -&amp;gt;  ''NounPhrase'' ''VerbPhrase''            # simple sentence structure&lt;br /&gt;
 ''NounPhrase''              -&amp;gt;  ''Determiner'' ''Noun''                  # simple phrase structure&lt;br /&gt;
 ''VerbPhrase''              -&amp;gt;  ''Verb'' ''NounPhrase''                  # simple phrase structure&lt;br /&gt;
                                                              #&lt;br /&gt;
 ''Noun''                    -&amp;gt;  ''SingularNoun'', ''PluralNoun''         # nouns can be singular or plural &lt;br /&gt;
                                                              #&lt;br /&gt;
 ''Determiner'' ''SingularNoun'' -&amp;gt;  ''SingularDeterminer'' ''SingularNoun''  # context-sensitive:&lt;br /&gt;
 ''Determiner'' ''PluralNoun''   -&amp;gt;  ''PluralDeterminer'' ''PluralNoun''      #    determiner must agree with noun&lt;br /&gt;
                                                              #&lt;br /&gt;
 ''SingularNoun'' ''Verb''       -&amp;gt;  ''SingularNoun'' ''SingularVerb''        # context-sensitive: &lt;br /&gt;
 ''PluralNoun'' ''Verb''         -&amp;gt;  ''PluralNoun'' ''PluralVerb''            #    verb must agree with noun&lt;br /&gt;
                                                              #&lt;br /&gt;
 ''SingularDeterminer''      -&amp;gt;  '''a''', '''the'''                           # singular determiners&lt;br /&gt;
 ''PluralDeterminer''        -&amp;gt;  '''the'''                              # plural determiners&lt;br /&gt;
                                                              #&lt;br /&gt;
 ''SingularNoun''            -&amp;gt;  '''boy''', '''sheep''', '''dog'''                  # singular nouns&lt;br /&gt;
 ''PluralNoun''              -&amp;gt;  '''boys''', '''sheep''', '''dogs'''                # plural nouns&lt;br /&gt;
                                                              #&lt;br /&gt;
 ''SingularVerb''            -&amp;gt;  '''chases''', '''hears''', '''sees'''              # singular verbs&lt;br /&gt;
 ''PluralVerb''              -&amp;gt;  '''chase''', '''hear''', '''see'''                 # plural verbs&lt;br /&gt;
&lt;br /&gt;
The above grammar can generate sentences such as: '''a boy chases a dog''', '''the boys chase a dog''', etc. Because some words have the same form in both singular and plural, it can also generate meaningful (and grammatically-correct) sentences such as: '''the sheep sees the dog''', '''the sheep see the dog'''.&lt;br /&gt;
&lt;br /&gt;
But the above grammar can NOT generate sentences such as: '''a boys chases the sheep''', since this would violate the context-sensitive rules.&lt;br /&gt;
&lt;br /&gt;
====Discussion====&lt;br /&gt;
It is in fact possible to handle singular/plural issues by using only a Level 2 context-free grammar, but the above rules expressed as a Level 1 context-sensitive grammar are a closer match to ordinary concepts of English grammar (e.g. nouns and verbs must agree in number i.e. singular/plural).&lt;br /&gt;
&lt;br /&gt;
===Level 0: recursively enumerable grammar===&lt;br /&gt;
A recursively enumerable grammar has absolutely no restriction on what sort of transformation rules can be applied; hence it is also known as an unrestricted grammar. Rules take the general form:&lt;br /&gt;
*[anything] -&amp;gt; [anything]&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
The following rules can generate all symbols of the form: abc, aabbcc, aaabbbccc, etc., where there are equal numbers of a's, b's and c's. This example is taken from a lecture.&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.cs.utexas.edu/~cline/ear/Slides/Turing/TuringSlides3.doc&lt;br /&gt;
| title = Grammars, Recursively Enumerable Languages, and Turing Machines&lt;br /&gt;
| accessdate = 2012-05-10&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ''S''   -&amp;gt; '''a''' ''B'' ''S'' '''c'''&lt;br /&gt;
 ''S''   -&amp;gt; '''a''' ''B'' '''c'''&lt;br /&gt;
 ''B'' '''a''' -&amp;gt; '''a''' ''B''&lt;br /&gt;
 ''B'' '''c''' -&amp;gt; '''b''' '''c'''&lt;br /&gt;
 ''B'' '''b''' -&amp;gt; '''b''' '''b'''&lt;br /&gt;
&lt;br /&gt;
The derivations of the first three items in this infinite sequence are:&lt;br /&gt;
&lt;br /&gt;
# ''S'' -&amp;gt; '''a'''''B'''''c''' -&amp;gt; '''abc'''&lt;br /&gt;
# ''S'' -&amp;gt; '''a'''''BS'''''c''' -&amp;gt; '''a'''''B'''''a'''''B'''''cc''' -&amp;gt; '''aa'''''B B'''''cc''' -&amp;gt; '''aa'''''B'''''bcc''' -&amp;gt; '''aabbcc'''&lt;br /&gt;
# ''S'' -&amp;gt; '''a'''''BS'''''c''' -&amp;gt; '''a'''''B'''''a'''''BS'''''cc''' -&amp;gt; '''a'''''B'''''a'''''B'''''a'''''B'''''ccc''' -&amp;gt; '''aa'''''BB'''''a'''''B'''''ccc''' -&amp;gt; '''aa'''''B'''''a'''''BB'''''ccc''' -&amp;gt; '''aaa'''''BBB'''''ccc''' -&amp;gt; '''aaa'''''BB'''''bccc''' -&amp;gt; '''aaa'''''B'''''bbccc''' -&amp;gt; '''aaabbbccc'''&lt;br /&gt;
&lt;br /&gt;
===Beyond Level 0===&lt;br /&gt;
These lecture notes&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.google.co.uk/url?sa=t&amp;amp;rct=j&amp;amp;q=recursively+enumerable+languages+examples&amp;amp;source=web&amp;amp;cd=4&amp;amp;ved=0CF4QFjAD&amp;amp;url=http%3A%2F%2Fwww.cs.colostate.edu%2F~massey%2FTeaching%2Fcs301%2FRestrictedAccess%2FSlides%2F301lecture23.pdf&amp;amp;ei=6qelT4KMA6SA0AXIu7CQBA&amp;amp;usg=AFQjCNG3fc1mD7g5f-14vfDPdvyX2uScDg&lt;br /&gt;
| title = Recursive and Recursively Enumerable Languages&lt;br /&gt;
| accessdate = 2012-05-05&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
show that languages exist which can not be described by any set of rules. As is common with logical proofs of this nature, the proof doesn't actually produce or demonstrate such a language.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[category:linguistics]]&lt;br /&gt;
[[Category:Computer Science]]&lt;/div&gt;</summary>
		<author><name>RolandPlankton</name></author>
	</entry>
	<entry>
		<id>https://www.conservapedia.com/index.php?title=Chomsky_hierarchy&amp;diff=980816</id>
		<title>Chomsky hierarchy</title>
		<link rel="alternate" type="text/html" href="https://www.conservapedia.com/index.php?title=Chomsky_hierarchy&amp;diff=980816"/>
		<updated>2012-05-11T18:12:55Z</updated>

		<summary type="html">&lt;p&gt;RolandPlankton: /* Formal grammar */ rephrase&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The '''Chomsky hierarchy''', sometimes known as the '''Chomsky-Schützenberger hierarchy''', is a hierarchy of formal grammatical systems for describing various classes of languages; the hierarchy can apply to both human and computer languages. This hierarchy was first published in 1956 by [[Noam Chomsky|Chomsky]].&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite journal &lt;br /&gt;
| title = Three models for the description of language &lt;br /&gt;
| year = 1956 &lt;br /&gt;
| last = Chomsky &lt;br /&gt;
| first = Noam &lt;br /&gt;
| journal = IRE Transactions on Information Theory &lt;br /&gt;
| volume = 2 &lt;br /&gt;
| pages = 113–124 &lt;br /&gt;
| url = http://www.chomsky.info/articles/195609--.pdf &lt;br /&gt;
| accessdate = 2012-04-08&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
These grammatical systems were referred to by Chomsky as ''transformational grammars''.  Other linguists have since developed a variety of similar grammars; together these are known as ''generative grammars''. &lt;br /&gt;
&lt;br /&gt;
The basic idea of a '''generative grammar''' is to provide a set of rules which are capable of generating all possible grammatical sentences in some language; the rules must constrain the generation so that only grammatical sentences are generated. The rules can also be used in reverse to parse a sentence and check if it is grammatical.&lt;br /&gt;
&lt;br /&gt;
In the late 1950's, [[John Backus]] and Peter Naur developed a notation for describing [[programming language]]s. This notation is known as [[Backus Naur Form]] (or BNF) and turns out to be equivalent to Chomsky's grammar number two (context-free grammar), although it was developed independently of Chomsky's work. Backus-Naur Form was first used in the Algol 60 Report to specify the syntax of [[Algol 60]], and has since been used for specifying the syntax of other programming languages. &lt;br /&gt;
&lt;br /&gt;
==Example of a very simple generative grammar==&lt;br /&gt;
This very simple example can handle only a tiny subset of English and should not be taken seriously as a guide to English grammar or vocabulary. It is based on an example by David Crystal&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite book &lt;br /&gt;
| last = Crystal &lt;br /&gt;
| first = David  &lt;br /&gt;
| title = The Cambridge Encyclopedia of Language &lt;br /&gt;
| publisher = Cambridge University Press &lt;br /&gt;
| year = 1987 &lt;br /&gt;
| isbn = 0-521-42443-7&lt;br /&gt;
| pages = page 97&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; and is a slight extension of an example on slide 9 of this lecture.&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.cs.princeton.edu/~rywang/99f126/slides/16th.pdf&lt;br /&gt;
| title = Lecture notes: Formal Languages&lt;br /&gt;
| accessdate = 2012-04-07}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase''         # A ''Sentence'' consists of a ''NounPhrase'' followed by a ''VerbPhrase''&lt;br /&gt;
 ''NounPhrase'' -&amp;gt;  ''Determiner'' ''Noun''               # A ''NounPhrase'' consists of a ''Determiner'' followed by a ''Noun''&lt;br /&gt;
 ''VerbPhrase'' -&amp;gt;  ''Verb'' ''NounPhrase''               # A ''VerbPhrase'' consists of a ''Verb'' followed by a ''NounPhrase''&lt;br /&gt;
 ''Determiner'' -&amp;gt;  '''a''', '''the'''                        # A ''Determiner''  is one of: '''a''' or '''the'''&lt;br /&gt;
 ''Noun''       -&amp;gt;  '''boy''', '''girl''', '''dog'''                # A ''Noun'' is one of: '''boy''' or '''girl''' or '''dog'''  &lt;br /&gt;
 ''Verb''       -&amp;gt;  '''chased''', '''heard''', '''saw'''            # A ''Verb'' is one of: '''chased''' or '''heard''' or '''saw'''&lt;br /&gt;
&lt;br /&gt;
Notation used above: &lt;br /&gt;
:The symbol &amp;quot;-&amp;gt;&amp;quot; means &amp;quot;can be replaced by&amp;quot;.  &lt;br /&gt;
:When there are several items on the right hand side separated by commas, just one of these items can be selected. &lt;br /&gt;
:The comments preceded by &amp;quot;#&amp;quot; are not part of the generative grammar, but hopefully will help folks understand the example a little better.&lt;br /&gt;
&lt;br /&gt;
By making appropriate substitutions we can generate such sentences as:&lt;br /&gt;
:The dog chased a girl.&lt;br /&gt;
:The girl heard the dog.&lt;br /&gt;
:The boy saw a girl.&lt;br /&gt;
&lt;br /&gt;
The stages in the generation of these examples are as follows:&lt;br /&gt;
:''Sentence''&lt;br /&gt;
:-&amp;gt; ''NounPhrase'' ''VerbPhrase''&lt;br /&gt;
:-&amp;gt; ''Determiner'' ''Noun'' ''Verb'' ''NounPhrase''&lt;br /&gt;
:-&amp;gt; ''Determiner'' ''Noun'' ''Verb'' ''Determiner'' ''Noun''&lt;br /&gt;
&lt;br /&gt;
By appropriate selection of words to substitute for ''Determiner'', ''Noun'', and ''Verb'' we can produce the 3 example sentences above.&lt;br /&gt;
&lt;br /&gt;
The simple grammar defines a few words which can be substituted for ''Determiner'', ''Noun'', and ''Verb''. There are two possibilities for ''Determiner'', three for ''Noun'', and three for ''Verb'', with both ''Determiner'' and ''Noun'' appearing twice in the expansion. Hence the total number of grammatical sentences which can be generated by this simple grammar is 108 (= 2 * 3 * 3 * 2 * 3). In this particular case the possible words have been carefully chosen so that all of these 108 sentences also actually mean something.&lt;br /&gt;
&lt;br /&gt;
Note that the use of ''italics'' and '''boldface''' in this example is merely a convenient way of indicating the difference between items which can be expanded further (e.g. concepts such as ''NounPhrase'') and items which can not be expanded further (e.g. words such as '''girl'''). In the linguistic literature, items which can be expanded further are referred to as 'non-terminal' items, while items which can't be expanded further are known as 'terminal' items.&lt;br /&gt;
&lt;br /&gt;
The 'comma' notation for alternatives is a form of shorthand. In some formulations this would be shown as several separate rules, so that:&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''a''', '''the''' &lt;br /&gt;
could be shown as two rules:&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''a'''&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''the''' &lt;br /&gt;
&lt;br /&gt;
==Caution==&lt;br /&gt;
While a generative grammar may produce sentences which are grammatically correct, there is no certainty that such sentences will actually mean anything. The classic example of such a meaningless sentence is from Chomsky's book&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite book &lt;br /&gt;
| last = Chomsky &lt;br /&gt;
| first = Noam &lt;br /&gt;
| title = Syntactic Structures &lt;br /&gt;
| year = 1957 &lt;br /&gt;
| publisher = Mouton &lt;br /&gt;
| location = The Hague/Paris &lt;br /&gt;
| pages = page 15 &lt;br /&gt;
| isbn = 3-11-017279-8&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; with the grammatically correct sentence:&lt;br /&gt;
&lt;br /&gt;
:&amp;quot;Colorless green ideas sleep furiously.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
:This example illustrates the difference between grammar/syntax and meaning/semantics.&lt;br /&gt;
&lt;br /&gt;
Another problem when analysing a sentence is that many English words have multiple meanings, so that there may be more than one way to interpret a sentence. A simple example is the sentence: &lt;br /&gt;
:&amp;quot;Time flies.&amp;quot; &lt;br /&gt;
:Is this an instruction to check how fast flies are flying, or an indication that time appears to be passing quickly? &lt;br /&gt;
:A varied and entertaining selection of such ambiguities has been compiled by Jeff Gray.&amp;lt;ref&amp;gt;{{Cite web &lt;br /&gt;
| title = Collection of Ambiguous or Inconsistent/Incomplete Statements  &lt;br /&gt;
| url = http://www.gray-area.org/Research/Ambig/ &lt;br /&gt;
| author = Jeff Gray&lt;br /&gt;
| accessdate = 2012-04-10&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Formal grammar==&lt;br /&gt;
'''Note''': this section and subsequent sections are, by necessity, slightly more technical/formal than the earlier parts of this article, though specialist notation and abbreviations have been largely avoided. Make sure that you understand the 'Simple example' above before proceeding further, since references will be made to that example to help explain the technicalities, and variations on that example will be used to illustrate new ideas. &lt;br /&gt;
&lt;br /&gt;
A formal generative grammar has four components (as described in slide 19 of this lecture&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://adammikeal.org/courses/compute/Chomsky%20Presentation.pdf&lt;br /&gt;
| title = The Chomsky Hierarchy&lt;br /&gt;
| accessdate = 2012-04-06&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
):&lt;br /&gt;
# a finite number of non-terminal concepts (e.g. ''VerbPhrase'' in the example, or anything else in ''italics''),&lt;br /&gt;
# a finite number of terminal items (e.g. '''girl''' in the example, or anything else in '''bold-face''').&lt;br /&gt;
# a finite set of rules for transforming non-terminal items (e.g. the example has 6 rules).&lt;br /&gt;
# a single starting point (e.g. ''Sentence'' in the example).&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
:Terminal items are those which can not be transformed into anything else.&lt;br /&gt;
:A list of all the terminal items is effectively the vocabulary from which sentences are built.&lt;br /&gt;
:Non-terminal items are those which can be transformed into something else.&lt;br /&gt;
:Linguists have developed various classes of grammars by using constraints to govern what sort of rules can be used for any particular grammar.&lt;br /&gt;
&lt;br /&gt;
===Changing the rules===&lt;br /&gt;
An relatively small change to even a single rule can make a large change in the language which can be generated. For example, change the first rule in the simple example to read:&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''NounPhrase'' ''VerbPhrase'' '''and''' ''NounPhrase'' ''VerbPhrase''&lt;br /&gt;
This means that a ''Sentence'' is either a ''NounPhrase'' followed by a ''VerbPhrase'' or a ''NounPhrase'' followed by a ''VerbPhrase'' followed by '''and''' followed by a ''NounPhrase'' followed by a ''VerbPhrase''. In addition to the shorter sentences already discussed, this could also generate a sentence such as: &amp;quot;A dog saw a girl and the dog chased the girl&amp;quot;. The total number of grammatically-correct sentences which can be generated by this modified grammar is now 11,772 (108 + 108*108), though some of these may not be very meaingful.&lt;br /&gt;
&lt;br /&gt;
===Towards infinity===&lt;br /&gt;
A significantly different rule change can have an astounding effect. Consider changing the first rule to read:&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''NounPhrase'' ''VerbPhrase'' '''and''' ''Sentence''&lt;br /&gt;
This can generate a potentially infinite number of sentences (any number of these five-word sentences linked by '''and'''). This is an example of what is known as a [[Recursion|recursive]] definition, whereby a ''Sentence'' is partially defined in terms of itself. In such a recursive rule there must be at least one transformation option which does not involve ''Sentence'', otherwise the transformation could never stop.&lt;br /&gt;
&lt;br /&gt;
The above change is known as right-recursive; a left-recursive formulation is also possible, and can in this example generate exactly the same sentences. As shown below  under 'Context-free grammar', there are situations where the choice of left- or right-recursive formulations can change the meaning. &lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''Sentence'' '''and''' ''NounPhrase'' ''VerbPhrase'' &lt;br /&gt;
&lt;br /&gt;
The distinction between left- and right-recursive grammars becomes important when trying to parse/analyse a sentence; some types of parser work best with left-recursive grammars, while other types work best with right-recursive grammars. This distinction is particularly relevant in connection with [[compiler|compiling or translating]] a program written in some high-level [[programming language]] so that it can be used on a [[computer]].&lt;br /&gt;
&lt;br /&gt;
==Chomsky hierarchy==&lt;br /&gt;
By imposing different constraints&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.cs.uaf.edu/2011/spring/cs331/lectures/cs331_20110124_grammar.html&lt;br /&gt;
| title = Lecture notes: Languages &amp;amp; Grammars&lt;br /&gt;
| accessdate = 2012-04-07&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; &lt;br /&gt;
as to what sort of transformation rules could be used, Chomsky was able to define four strictly nested transformational grammars, which he numbered from 0 to 3. As the grammar number increases, the generated language becomes simpler. As the grammar number decreases, parsing a sentence in that language becomes more difficult.&lt;br /&gt;
Other linguists have described formal grammars which fit in between the various Chomsky levels. &lt;br /&gt;
&lt;br /&gt;
The following table provides a summary, which is then explained further in the subsequent subsections.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!| Chomsky&amp;lt;br&amp;gt;number || linguistic name || Rule constraints || Recogniser+ || Notes &lt;br /&gt;
|-&lt;br /&gt;
| 0 || recursively enumerable || [anything] -&amp;gt; [anything] || Turing machine || most human languages &lt;br /&gt;
|-&lt;br /&gt;
| 1 || context-sensitive || X ''A'' Y -&amp;gt; X [anything] Y || linear bounded automaton || X and Y provide the context in which ''A'' can be transformed &lt;br /&gt;
|-&lt;br /&gt;
| 2 || context-free || ''A'' -&amp;gt; [anything] || non-deterministic push-down automaton || syntax analysis for most programming languages &lt;br /&gt;
|-&lt;br /&gt;
| 3 || regular || ''A'' -&amp;gt; [nothing]&amp;lt;br&amp;gt;''A'' -&amp;gt; '''xyz'''&amp;lt;br&amp;gt;''A'' -&amp;gt; '''xyz''' ''B'' || finite automaton&amp;lt;br&amp;gt;or finite state machine || lexical analysis (combining characters into words/tokens)  &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''+''' The '''recogniser''' column indicates the type of mathematical or computer science theoretical model needed to recognise that a sentence belongs to a language, essentially by applying the transformation rules in reverse to work backwards from the actual words in order to finish up with a ''sentence'' (in programming languages the starting concept is usually a ''program''). A finite automaton uses only a small fixed amount of memory, operates in time proportional to the length of the input, and always reaches a decision, while a Turing machine may use an infinite amount of memory and time and may fail to reach a decision (may never stop).&lt;br /&gt;
&lt;br /&gt;
In the linguistic literature, [nothing] is often represented by the symbol '''ε'''.&lt;br /&gt;
&lt;br /&gt;
The descriptions of the various Chomsky levels which follow are presented in reverse order, so as to work up from a simple case to a rather complicated case.&lt;br /&gt;
&lt;br /&gt;
===Level 3: regular grammar===&lt;br /&gt;
The transformation rules for regular grammars are required to be very simple. &lt;br /&gt;
*Only a single non-terminal item can appear on the left-hand side of a rule.&lt;br /&gt;
*The right-hand side of any rule must be one of:&lt;br /&gt;
**[nothing].&lt;br /&gt;
**a terminal item.&lt;br /&gt;
**a terminal item followed by a non-terminal item.&lt;br /&gt;
Note that instead of a terminal item we could have a non-terminal item whose transformation rule immediately resolves to a single terminal item, or to one of several terminal items.&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
Informally we can define a 'word' as a sequence of one or more ''Letter''s. The following regular grammar provides a more formal definition; for simplicity it is restricted to lower-case letters.&lt;br /&gt;
&lt;br /&gt;
 ''Word''     -&amp;gt; ''Letter'' ''PartWord''&lt;br /&gt;
 ''PartWord'' -&amp;gt; [nothing]&lt;br /&gt;
 ''PartWord'' -&amp;gt; ''Letter'' ''PartWord''&lt;br /&gt;
 ''Letter''   -&amp;gt; '''a''', '''b''', ... '''z'''&lt;br /&gt;
&lt;br /&gt;
Note that ''PartWord'' is recursively defined, with the recursion stopping if it is transformed into [nothing].&lt;br /&gt;
&lt;br /&gt;
For one-letter words we expand as: &lt;br /&gt;
:''Word'' -&amp;gt; ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' [nothing] -&amp;gt; ''Letter''&lt;br /&gt;
&lt;br /&gt;
For two-letter words we expand as: &lt;br /&gt;
:''Word'' -&amp;gt; ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' ''Letter'' [nothing] -&amp;gt;  ''Letter'' ''Letter''&lt;br /&gt;
&lt;br /&gt;
Obviously, words of any length can be constructed, though they may well not actually be words from any language. &lt;br /&gt;
&lt;br /&gt;
====Discussion====&lt;br /&gt;
Trying to devise transformation rules to produce words which are more English-like is much more difficult - how do you insist on at least one vowel or on no more than 5 consecutive consonants (e.g. as in 'strengths').&lt;br /&gt;
&lt;br /&gt;
Further examples in [[Regular grammar]] show how numbers can be defined via a regular grammar, and also show how a hyphenated word could be defined.&lt;br /&gt;
&lt;br /&gt;
One of the limitations of a regular grammar is that it can't cope with nested matching brackets, so that it is impossible to write a regular grammar to describe an expression such as '''2 * (3+4)''' where that grammar is expected to allow brackets nested to any depth. A context-free grammar is needed for this, as described in the next section.&lt;br /&gt;
&lt;br /&gt;
Regular grammars or equivalent are widely used by [[compiler]]s in the lexical analysis of programming languages.&lt;br /&gt;
&lt;br /&gt;
===Level 2: context-free grammar===&lt;br /&gt;
The transformation rules for context-free grammars don't appear that much different from those for regular grammars. &lt;br /&gt;
*Only a single non-terminal item can appear on the left-hand side of a rule.&lt;br /&gt;
*The right-hand side of any rule must be one of:&lt;br /&gt;
**[nothing].&lt;br /&gt;
**any combination of terminal items and non-terminal items.&lt;br /&gt;
&lt;br /&gt;
The key difference is that in a regular grammar, any non-empty rule must effectively start with terminal item so that every rule transformation makes some immediate progress, while in a context-free grammar a rule could start with a non-terminal item which itself could be subject to arbitrary further transformations.&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
The following example shows how context-free grammars can cope with arithmetic expressions involving possibly nested brackets. Also an expression such as &amp;quot;2 + 3 * 4&amp;quot; could be interpreted as either &amp;quot;(2 + 3) * 4&amp;quot; = 20 or as &amp;quot;2 + (3 * 4)&amp;quot; = 14. The latter interpretation is that which is normally used - multiplication &amp;quot;*&amp;quot; is said to have a higher priority than addition &amp;quot;+&amp;quot; - so the grammar must incorporate this priority concept. Furthermore, consecutive operators of the same priority are normally applied from left to right, so that &amp;quot;8 - 2 + 3&amp;quot; is interpreted as &amp;quot;(8 - 2) + 3&amp;quot; = 9, rather than as &amp;quot;8 - (2 + 3)&amp;quot; = 3.  This ordering must also be built in to the grammar.&lt;br /&gt;
&lt;br /&gt;
To avoid distracting side-issues, this example only deals with numbers which consist solely of a single digit. The example is a simplified version of the definition of an arithmetic expression given in the Revised Algol 60 Report (Section 3.3.1).&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.masswerk.at/algol60/report.htm&lt;br /&gt;
| title = Revised Report on the Algorithmic Language Algol 60&lt;br /&gt;
| accessdate = 2012-04-22&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ''Expression'' -&amp;gt; ''Term''                        # an ''Expression'' is either a ''Term''&lt;br /&gt;
 ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''    #   or an ''Expression'' followed by '''+''' or '''-''' followed by a ''Term''&lt;br /&gt;
 ''Term''       -&amp;gt; ''Primary''                     # a ''Term'' is either a ''Primary''&lt;br /&gt;
 ''Term''       -&amp;gt; ''Term'' ''MulDivOp'' ''Primary''       #   or a ''Term'' followed by '''*''' or '''/''' followed by a ''Primary''&lt;br /&gt;
                                           #&lt;br /&gt;
 ''Primary''    -&amp;gt; ''Number''                      # a ''Primary'' is either a ''Number''&lt;br /&gt;
 ''Primary''    -&amp;gt; '''(''' ''Expression'' ''')'''              #   or an ''Expression'' enclosed in brackets&lt;br /&gt;
                                           #&lt;br /&gt;
 ''MulDivOp''   -&amp;gt; '''*'''. '''/'''                        # multiplication and division have the same priority&lt;br /&gt;
 ''AddSubOp''   -&amp;gt; '''+'''. '''-'''                        # addition and subtraction have the same priority&lt;br /&gt;
 ''Number''     -&amp;gt; '''0''', '''1''', ... '''9'''                 # this simple-minded definition of a ''Number'' is enough for this example&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
* Both ''Expression'' and ''Term'' are each defined via a left-recursive rule; this ensures that operators of the same priority are applied from left to right.&lt;br /&gt;
* The distinction between ''Expression'' and ''Term'' ensures that multiplication/division are applied before addition/subtraction.&lt;br /&gt;
* ''Expression'' is indirectly recursive via ''Term'' and ''Primary'' to allow bracketed sub-expressions to any depth.&lt;br /&gt;
&lt;br /&gt;
Example 1: generate 2 + 3 * 4&lt;br /&gt;
&lt;br /&gt;
  ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Term'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Primary'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' ''Term''                                 # '''+''' can not be applied until ''Term'' has been evaluated&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' ''Term'' ''MulDivOp'' ''Primary''&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' ''Primary'' ''MulDipOp'' ''Primary''&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' '''3''' '''*''' '''4'''&lt;br /&gt;
&lt;br /&gt;
Example 2: generate 2 * 3 + 4&lt;br /&gt;
&lt;br /&gt;
  ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Term'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Term'' ''MulDivOp'' ''Primary'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Primary'' ''MulDivOp'' ''Primary'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; '''2''' '''*''' '''3''' ''AddSubOp'' ''Term''                      # ''Term'' to left of ''AddSubOp'' is evaluated first&lt;br /&gt;
             -&amp;gt; '''2''' '''*''' '''3''' ''AddSubOp'' ''Primary''  &lt;br /&gt;
             -&amp;gt; '''2''' '''*''' '''3''' '''+''' '''4'''&lt;br /&gt;
&lt;br /&gt;
====Discussion====&lt;br /&gt;
Context-free grammars (or equivalent definitions using Backus-Naur-Form) are widely used both to define the syntax of programming languages and to (semi-automatically) generate parsers for these languages.&lt;br /&gt;
&lt;br /&gt;
A limitation/feature of both regular grammars and context-free grammars is that the left-hand side of any rule is always a single non-terminal item, so any transformation is applied regardless of the context in which that non-terminal item appears.  A simple example which depends on context is the use of singular and plural nouns and verbs in English.  We say: '''the man runs''' or '''the men run''', but neither of '''the man run''' nor '''the men runs'''.  Which form of verb to use depends on the noun, i.e. there is a context dependency.&lt;br /&gt;
&lt;br /&gt;
===Level 1: context-sensitive grammar===&lt;br /&gt;
For context-sensitive grammars the left-hand side of a rule may indicate the context in which that rule applies, so that the same non-terminal item may be transformed in different ways depending on the context in which it appears.&lt;br /&gt;
&lt;br /&gt;
There is only one transformation rule for context-sensitive grammars:&lt;br /&gt;
*X [non-terminal] Y -&amp;gt; X [anything] Y&lt;br /&gt;
&lt;br /&gt;
where X and Y determine the context in which the [non-terminal] is transformed. Note that X and Y may each be terminals or non-terminals or [nothing]. When both X and Y are nothing there is no context and this reduces to a Level 2 or Level 3 grammar.&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
Taylor has provided several examples&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.divms.uiowa.edu/~fleck/taylor.pdf&lt;br /&gt;
| title = Context-sensitive Examples&lt;br /&gt;
| author = Taylor&lt;br /&gt;
| accessdate = 2012-04-26&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
and the following, inspired by his third example, is an extension of the original simple example above to handle singulars and plurals:&lt;br /&gt;
&lt;br /&gt;
 ''Sentence''                -&amp;gt;  ''NounPhrase'' ''VerbPhrase''            # simple sentence structure&lt;br /&gt;
 ''NounPhrase''              -&amp;gt;  ''Determiner'' ''Noun''                  # simple phrase structure&lt;br /&gt;
 ''VerbPhrase''              -&amp;gt;  ''Verb'' ''NounPhrase''                  # simple phrase structure&lt;br /&gt;
                                                              #&lt;br /&gt;
 ''Noun''                    -&amp;gt;  ''SingularNoun'', ''PluralNoun''         # nouns can be singular or plural &lt;br /&gt;
                                                              #&lt;br /&gt;
 ''Determiner'' ''SingularNoun'' -&amp;gt;  ''SingularDeterminer'' ''SingularNoun''  # context-sensitive:&lt;br /&gt;
 ''Determiner'' ''PluralNoun''   -&amp;gt;  ''PluralDeterminer'' ''PluralNoun''      #    determiner must agree with noun&lt;br /&gt;
                                                              #&lt;br /&gt;
 ''SingularNoun'' ''Verb''       -&amp;gt;  ''SingularNoun'' ''SingularVerb''        # context-sensitive: &lt;br /&gt;
 ''PluralNoun'' ''Verb''         -&amp;gt;  ''PluralNoun'' ''PluralVerb''            #    verb must agree with noun&lt;br /&gt;
                                                              #&lt;br /&gt;
 ''SingularDeterminer''      -&amp;gt;  '''a''', '''the'''                           # singular determiners&lt;br /&gt;
 ''PluralDeterminer''        -&amp;gt;  '''the'''                              # plural determiners&lt;br /&gt;
                                                              #&lt;br /&gt;
 ''SingularNoun''            -&amp;gt;  '''boy''', '''sheep''', '''dog'''                  # singular nouns&lt;br /&gt;
 ''PluralNoun''              -&amp;gt;  '''boys''', '''sheep''', '''dogs'''                # plural nouns&lt;br /&gt;
                                                              #&lt;br /&gt;
 ''SingularVerb''            -&amp;gt;  '''chases''', '''hears''', '''sees'''              # singular verbs&lt;br /&gt;
 ''PluralVerb''              -&amp;gt;  '''chase''', '''hear''', '''see'''                 # plural verbs&lt;br /&gt;
&lt;br /&gt;
The above grammar can generate sentences such as: '''a boy chases a dog''', '''the boys chase a dog''', etc. Because some words have the same form in both singular and plural, it can also generate meaningful (and grammatically-correct) sentences such as: '''the sheep sees the dog''', '''the sheep see the dog'''.&lt;br /&gt;
&lt;br /&gt;
But the above grammar can NOT generate sentences such as: '''a boys chases the sheep''', since this would violate the context-sensitive rules.&lt;br /&gt;
&lt;br /&gt;
====Discussion====&lt;br /&gt;
It is in fact possible to handle singular/plural issues by using only a Level 2 context-free grammar, but the above rules expressed as a Level 1 context-sensitive grammar are a closer match to ordinary concepts of English grammar (e.g. nouns and verbs must agree in number i.e. singular/plural).&lt;br /&gt;
&lt;br /&gt;
===Level 0: recursively enumerable grammar===&lt;br /&gt;
A recursively enumerable grammar has absolutely no restriction on what sort of transformation rules can be applied; hence it is also known as an unrestricted grammar. Rules take the general form:&lt;br /&gt;
*[anything] -&amp;gt; [anything]&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
The following rules can generate all symbols of the form: abc, aabbcc, aaabbbccc, etc., where there are equal numbers of a's, b's and c's. This example is taken from a lecture.&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.cs.utexas.edu/~cline/ear/Slides/Turing/TuringSlides3.doc&lt;br /&gt;
| title = Grammars, Recursively Enumerable Languages, and Turing Machines&lt;br /&gt;
| accessdate = 2012-05-10&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ''S''   -&amp;gt; '''a''' ''B'' ''S'' '''c'''&lt;br /&gt;
 ''S''   -&amp;gt; '''a''' ''B'' '''c'''&lt;br /&gt;
 ''B'' '''a''' -&amp;gt; '''a''' ''B''&lt;br /&gt;
 ''B'' '''c''' -&amp;gt; '''b''' '''c'''&lt;br /&gt;
 ''B'' '''b''' -&amp;gt; '''b''' '''b'''&lt;br /&gt;
&lt;br /&gt;
The derivations of the first three items in this infinite sequence are:&lt;br /&gt;
&lt;br /&gt;
# ''S'' -&amp;gt; '''a'''''B'''''c''' -&amp;gt; '''abc'''&lt;br /&gt;
# ''S'' -&amp;gt; '''a'''''BS'''''c''' -&amp;gt; '''a'''''B'''''a'''''B'''''cc''' -&amp;gt; '''aa'''''B B'''''cc''' -&amp;gt; '''aa'''''B'''''bcc''' -&amp;gt; '''aabbcc'''&lt;br /&gt;
# ''S'' -&amp;gt; '''a'''''BS'''''c''' -&amp;gt; '''a'''''B'''''a'''''BS'''''cc''' -&amp;gt; '''a'''''B'''''a'''''B'''''a'''''B'''''ccc''' -&amp;gt; '''aa'''''BB'''''a'''''B'''''ccc''' -&amp;gt; '''aa'''''B'''''a'''''BB'''''ccc''' -&amp;gt; '''aaa'''''BBB'''''ccc''' -&amp;gt; '''aaa'''''BB'''''bccc''' -&amp;gt; '''aaa'''''B'''''bbccc''' -&amp;gt; '''aaabbbccc'''&lt;br /&gt;
&lt;br /&gt;
===Beyond Level 0===&lt;br /&gt;
These lecture notes&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.google.co.uk/url?sa=t&amp;amp;rct=j&amp;amp;q=recursively+enumerable+languages+examples&amp;amp;source=web&amp;amp;cd=4&amp;amp;ved=0CF4QFjAD&amp;amp;url=http%3A%2F%2Fwww.cs.colostate.edu%2F~massey%2FTeaching%2Fcs301%2FRestrictedAccess%2FSlides%2F301lecture23.pdf&amp;amp;ei=6qelT4KMA6SA0AXIu7CQBA&amp;amp;usg=AFQjCNG3fc1mD7g5f-14vfDPdvyX2uScDg&lt;br /&gt;
| title = Recursive and Recursively Enumerable Languages&lt;br /&gt;
| accessdate = 2012-05-05&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
show that languages exist which can not be described by any set of rules. As is common with logical proofs of this nature, the proof doesn't actually produce or demonstrate such a language.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[category:linguistics]]&lt;br /&gt;
[[Category:Computer Science]]&lt;/div&gt;</summary>
		<author><name>RolandPlankton</name></author>
	</entry>
	<entry>
		<id>https://www.conservapedia.com/index.php?title=User_talk:DamianJohn&amp;diff=980701</id>
		<title>User talk:DamianJohn</title>
		<link rel="alternate" type="text/html" href="https://www.conservapedia.com/index.php?title=User_talk:DamianJohn&amp;diff=980701"/>
		<updated>2012-05-10T19:15:37Z</updated>

		<summary type="html">&lt;p&gt;RolandPlankton: /* Context-free grammar */ new section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Hi Damian, you joined conservapedia before me however let me welcome you!&lt;br /&gt;
The reason I post here is to let you know, as you created the page, that I made some changes to the Destiny Church page.&lt;br /&gt;
Just a heads up! God bless.[[User:JJacob|JJacob]] 22:14, 5 July 2008 (EDT)&lt;br /&gt;
&lt;br /&gt;
:Got your message. A few people argue with some of my edits too, although I do try to go by what the better historians have to say.&lt;br /&gt;
:Best wishes.[[User:Pluto|Pluto]] 19:39, 16 July 2008 (EDT)&lt;br /&gt;
&lt;br /&gt;
== World history guide ==&lt;br /&gt;
&lt;br /&gt;
The basics are just about done, huh?--[[User:JamesWilson|JamesWilson]] 18:18, 20 August 2011 (EDT)&lt;br /&gt;
:Yeah we have done pretty well.  I'm gonna keep adding to the more advanced stuff when I get spare time.  It is hard to get into a sentence or two basic information and something interesting as well.  I have learnt a few things (eg I thought the Huns were from Germany - apparently not).  --[[User:DamianJohn|DamianJohn]] 22:53, 20 August 2011 (EDT)&lt;br /&gt;
::Yeah. I'll help you with that soon.--[[User:JamesWilson|JamesWilson]] 22:54, 20 August 2011 (EDT)&lt;br /&gt;
== Tonight ==&lt;br /&gt;
: Final of the Tri-Nations. Kiwi in Oz makes me nervous [[User:Aortuso|Aortuso]] 22:40, 26 August 2011 (EDT)&lt;br /&gt;
::Yes indeed.  I think we should be too strong but you never know with those wily Aussies.  Hosea Gear unlucky to miss out but still a pretty good team.  --[[User:DamianJohn|DamianJohn]] 23:11, 26 August 2011 (EDT)&lt;br /&gt;
&lt;br /&gt;
== Extra privileges granted ==&lt;br /&gt;
&lt;br /&gt;
Congratulations, the additional privileges of blocking and rolling back have been added to your account!--[[User:Aschlafly|Andy Schlafly]] 16:11, 14 January 2012 (EST)&lt;br /&gt;
&lt;br /&gt;
==Courtesy and decorum==&lt;br /&gt;
&lt;br /&gt;
Please do not pick fights with other contributors. After you've made your point, move on. Rob Smith is an old friend. --[[User:Ed Poor|Ed Poor]] &amp;lt;sup&amp;gt;[[User talk:Ed Poor|Talk]]&amp;lt;/sup&amp;gt; 22:15, 2 February 2012 (EST)&lt;br /&gt;
:I am sorry Ed that you feel I have picked a fight with Rob.  I do not think that is a fair appraisal of the situation.  Rob and I have had a love/hate relationship for perhaps as long as you have, and he is well aware that his continual insulting of me and my country was inappropriate behaviour for THIS site.  The matter has been dealt with and I am not entirely sure why you have chosen to fan the flames more.  In any case I shall assume that you act in good faith and will let the matter drop; confused as I am by your input.  --[[User:DamianJohn|DamianJohn]] 00:22, 3 February 2012 (EST)&lt;br /&gt;
&lt;br /&gt;
== April 2012 ==&lt;br /&gt;
&lt;br /&gt;
Thank you for your contributions here at Conservapedia. May I ask, what inspired [http://www.conservapedia.com/index.php?title=ESPN&amp;amp;diff=971238&amp;amp;oldid=732525 this]? [[User:DMorris|DMorris]] 01:12, 9 April 2012 (EDT)&lt;br /&gt;
:Yes of course.  It was this [http://www.conservapedia.com/index.php?title=Template%3AMainpageleft&amp;amp;action=historysubmit&amp;amp;diff=971165&amp;amp;oldid=970924 edit by Andy Schlafly].  There was some doubt raised subsequently about the correct interpretation of that posting, and although I personally was sceptical about Andy's claim, I thought it was appropriate that the views of the site leader and owner be reflected with the articles.  We are, as I'm sure you appreciate, here merely at the leisure of the site owner.  Our role is to facilitate the articulation of those views, whether we personally agree with them or not.  --[[User:DamianJohn|DamianJohn]] 17:26, 9 April 2012 (EDT)&lt;br /&gt;
&lt;br /&gt;
== Well-deserved promotion ==&lt;br /&gt;
&lt;br /&gt;
Congratulations - your account has been promoted!--[[User:Aschlafly|Andy Schlafly]] 18:28, 9 April 2012 (EDT)&lt;br /&gt;
&lt;br /&gt;
== Context-free grammar ==&lt;br /&gt;
&lt;br /&gt;
Hi Damian,&lt;br /&gt;
You commented recently that [[Context-free grammar]] was currently a &amp;quot;a list of gobbledygook&amp;quot; (I agree with your comments).&lt;br /&gt;
&lt;br /&gt;
I just about finished working on [[Chomsky hierarchy]], which involves the same sort of things as [[Context-free grammar]].  Could I ask you to have a look at [[Chomsky hierarchy]] and let me know if it is perhaps a little more accessible to the average reader (any constructive comments are welcome). If you are happy with my style and level of writing, then I intend to turn my hand to rewriting [[Context-free grammar]] in a similar vein. [[User:RolandPlankton|RolandPlankton]] 15:15, 10 May 2012 (EDT)&lt;/div&gt;</summary>
		<author><name>RolandPlankton</name></author>
	</entry>
	<entry>
		<id>https://www.conservapedia.com/index.php?title=User_talk:RolandPlankton&amp;diff=980700</id>
		<title>User talk:RolandPlankton</title>
		<link rel="alternate" type="text/html" href="https://www.conservapedia.com/index.php?title=User_talk:RolandPlankton&amp;diff=980700"/>
		<updated>2012-05-10T19:07:43Z</updated>

		<summary type="html">&lt;p&gt;RolandPlankton: Chomsky hierarchy more or less finished, move on to Context-free grammar and Backus-Naur Form&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{welcome|sig=[[User:Joaquín Martínez|Joaquín Martínez]] 19:52, 21 March 2012 (EDT)}}&lt;br /&gt;
&lt;br /&gt;
==Rugby World Cup==&lt;br /&gt;
&lt;br /&gt;
Do you doubt the truth of the phrase you wanted cited? Its not a sentiment I share, and its bloody hard to find a cite for that sort of thing, but I don't think the sentiment is untrue for a casual fan.  I know from talking to non-rugby people that the low number of tries and the general style of play turns a lot of people off.  It doesn't turn me off, nor perhaps you, but I think it undisputable that it turns many off.  --[[User:DamianJohn|DamianJohn]] 17:30, 12 February 2012 (EST)&lt;br /&gt;
:Hi Damian, In [Rugby World Cup], the phrase &amp;quot;the sudden death nature of the later stages tend to produce dour rugby that is often unattractive to casual fans&amp;quot; may or may not be true, but it looks rather like opinion and contains vague words &amp;quot;tend to produce&amp;quot;, and hence needs to be attributed to someone. If no attribution can be found then the phrase should be deleted. I believe that this approach is in accordance with the Conservapedia Commandments and the Manual of Style. [[User:RolandPlankton|RolandPlankton]] 13:23, 13 February 2012 (EST)&lt;br /&gt;
::Well, perhaps, but there is also points 10 and 13 in the [http://www.conservapedia.com/Conservapedia:How_Conservapedia_Differs_from_Wikipedia differences with Wikipedia] page to consider which is appropriate here.  Remember also that on this website, personal conversations are a sufficient source [http://www.conservapedia.com/Essay:25_Worst_Court_Decisions#cite_note-8 for observations].  I do hear what you are saying, but I think that the claim being made is so obviously true, that the referencing standards of this website do not require a cite.  --[[User:DamianJohn|DamianJohn]] 13:32, 13 February 2012 (EST)&lt;br /&gt;
:::As someone who has a scientific background, I'm rather unhappy with the phrase 'obviously true', since there have been plenty of examples over the last 1000 years or so when what is 'obviously true' turns out to be false.  Another question: what is 'dour rugby'?  Unless you can provide an attribution I would suggest toning the comment down a little to read at the end: &amp;quot;turns some people off.&amp;quot; [[User:RolandPlankton|RolandPlankton]] 14:37, 13 February 2012 (EST)&lt;br /&gt;
&lt;br /&gt;
Pause in discussion please. I'm off on pilgrimage to the Holy Land for nearly 2 weeks. [[User:RolandPlankton|RolandPlankton]] 14:01, 14 February 2012 (EST)&lt;br /&gt;
:I wouldn't worry about it too much.  I don't think the rugby world cup article is high on the list of priorities for anyone here.  --[[User:DamianJohn|DamianJohn]] 17:08, 14 February 2012 (EST)&lt;br /&gt;
::I have added a citation for your reading pleasure.  Ps How is [http://en.wikipedia.org/wiki/Millennium_Stadium Cardiff Arms Park] these days?Or was it [http://en.wikipedia.org/wiki/Ellis_Park_Stadium Ellis Park], or even [http://en.wikipedia.org/wiki/Eden_Park Eden Park] you went to?  --[[User:DamianJohn|DamianJohn]] 00:45, 29 February 2012 (EST)&lt;br /&gt;
:::Fine re citation. For the 3 places you mention, the only one I've been to is Eden Park. [[User:RolandPlankton|RolandPlankton]] 17:56, 29 February 2012 (EST)&lt;br /&gt;
&lt;br /&gt;
==Articles worked on==&lt;br /&gt;
This list excludes trivial changes such as spelling, grammar, fixing references, and very minor tidying up.&lt;br /&gt;
&lt;br /&gt;
===Major changes made===&lt;br /&gt;
*[[Chomsky hierarchy]] (created)&lt;br /&gt;
*[[Compilation]]&lt;br /&gt;
*[[Compiler]] &lt;br /&gt;
*[[Pi]] Still need to tidy up the section on Pi and the Bible.&lt;br /&gt;
*[[Programming language]] &lt;br /&gt;
&lt;br /&gt;
===Minor changes made===&lt;br /&gt;
*[[Generative grammar]] (created as redirect to [[Chomsky hierarchy]])&lt;br /&gt;
&lt;br /&gt;
===Extensive discussion===&lt;br /&gt;
*[[Talk:Theory of relativity]] discussions re GPS and relativity&lt;br /&gt;
&lt;br /&gt;
==Articles currently being worked on==&lt;br /&gt;
*[[Backus-Naur Form]]&lt;br /&gt;
*[[BNF]] redirect to [[Backus-Naur Form]]&lt;br /&gt;
*[[Context-free grammar]] Add less formal introduction and explain more clearly with examples. Make BNF a separate article.&lt;br /&gt;
&lt;br /&gt;
==Articles to work on==&lt;br /&gt;
===Meaning===&lt;br /&gt;
*[[Grammar]]&lt;br /&gt;
*[[Recursion]]&lt;br /&gt;
*[[Regular grammar]]&lt;br /&gt;
*[[Semantics]]&lt;br /&gt;
*[[Syntax]] currently a redirect to [[grammar]]; could we separate out 'syntax' as relating to computer languages, and 'grammar' as relating to human languages&lt;br /&gt;
&lt;br /&gt;
===Assorted===&lt;br /&gt;
*[[Anglican Communion]]&lt;br /&gt;
*[[Assembly line]]&lt;br /&gt;
*[[Bicycle]]&lt;br /&gt;
*[[Camping]]&lt;br /&gt;
*[[Castle]]&lt;br /&gt;
*[[Church of England]]&lt;br /&gt;
*[[Fantasy]]&lt;br /&gt;
*[[Philosophy of science]]&lt;br /&gt;
*[[Rail transport modelling]]&lt;br /&gt;
*[[Science fiction]]&lt;br /&gt;
*[[Tent]]&lt;br /&gt;
*[[The Hobbit]]&lt;br /&gt;
*[[The Lord of the Rings]]&lt;br /&gt;
*[[Tower of London]]&lt;br /&gt;
&lt;br /&gt;
===Biased===&lt;br /&gt;
Need to sort out myth from fact, possibly controversial.&lt;br /&gt;
*[[Evolution]]&lt;br /&gt;
*[[Intelligent design]]&lt;br /&gt;
*[[Pseudoscience]] &lt;br /&gt;
*[[Theory of relativity]]&lt;br /&gt;
*[[Wikipedia copyright]]&lt;br /&gt;
&lt;br /&gt;
===Computer-related===&lt;br /&gt;
*[[Algol 60]]&lt;br /&gt;
*[[Assembly language]]&lt;br /&gt;
*[[BASIC (programming language)]] &lt;br /&gt;
*[[C (programming language)]]&lt;br /&gt;
*[[Cobol]]&lt;br /&gt;
*[[Code maintenance]] could well be merged into [[Computer programming]]&lt;br /&gt;
*[[Computer]] distinguish hardware/software&lt;br /&gt;
*[[Computer program]] merge with [[Computer Program]], latter should be a redirect&lt;br /&gt;
*[[Computer programming]] currently a redirect to [[Computer Programming]], need to swap these over&lt;br /&gt;
*[[Computer science]]&lt;br /&gt;
*[[Computer software]] &lt;br /&gt;
*[[Fortran]]&lt;br /&gt;
*[[Hardware]] could be redirect to [[Computer]]&lt;br /&gt;
*[[Internet]]&lt;br /&gt;
*[[Interpreter (computing)]] &lt;br /&gt;
*[[Machine code]] could be part of [[Programming language]]&lt;br /&gt;
*[[Operating system]]&lt;br /&gt;
*[[Pascal (programming language)]] &lt;br /&gt;
*[[Pseudocode]]&lt;br /&gt;
*[[Software]] should be redirect to [[Computer software]]&lt;br /&gt;
*[[Source code]] could be merged into [[Programming language]]&lt;br /&gt;
*[[World Wide Web]]&lt;br /&gt;
&lt;br /&gt;
== Block ==&lt;br /&gt;
It seems that you were blocked in February... please be careful. --[[User:Joaquín Martínez|Joaquín Martínez]] 19:55, 21 March 2012 (EDT)&lt;br /&gt;
&lt;br /&gt;
: See: 14:23, 4 February 2012, Taj deleted &amp;quot;User:RolandPlankton&amp;quot; ‎ (Vandalism / parody). --[[User:JMR10|Joaquín Martínez]] 09:51, 22 March 2012 (EDT)&lt;br /&gt;
&lt;br /&gt;
::I believe that 4 February 2012 was when I first registered on Conservapedia. My user name was chosen in accordance with CP Guideline: &amp;quot;As a sign of good faith and accountability it is recommended that editors select a user name based on a permutation of their real name.&amp;quot;. Certainly my son was instantly able to recognise my user name as referring to me. [[User:RolandPlankton|RolandPlankton]] 10:02, 22 March 2012 (EDT)&lt;br /&gt;
&lt;br /&gt;
:::Hi, I just wanted to let you know that I answered your question on my talk page - I hope it clears up the misunderstanding. :-) Thanks, [[User:Taj|Taj]] 15:32, 22 March 2012 (EDT)&lt;br /&gt;
&lt;br /&gt;
:::Following is a copy of the answer referred to by Taj:&lt;br /&gt;
:::::Hello, thanks for the question, I looked into it. Please refer to this log: [http://www.conservapedia.com/index.php?title=Special%3ALog&amp;amp;type=delete&amp;amp;user=Taj&amp;amp;page=&amp;amp;year=&amp;amp;month=-1 Deletion Log] for explanation. It appears that on Feb 4, 2012, your User page and talk page were caught in a wave of vandalization along with several other users pages, and since you were a new user, and I, a new admin, apparently I deleted the page as opposed to reverting the offending edits. This had the effect of removing the edits in their entirety, so you were then able to recreate your own User page yourself. The action didn't substantially affect your page, however, I would probably choose to simply revert the edits if I were faced with this same situation today, with a little more experience as an Admin. I hope this clears up the matter, and apologize for any confusion created by this. Thank you for your continued contributions to Conservapedia! Blessings, [[User:Taj|Taj]] 12:50, 22 March 2012 (EDT). Copy made by [[User:RolandPlankton|RolandPlankton]] 16:03, 24 March 2012 (EDT)&lt;br /&gt;
&lt;br /&gt;
:::::: Godspeed! --[[User:Joaquín Martínez|Joaquín Martínez]] 16:41, 24 March 2012 (EDT)&lt;br /&gt;
&lt;br /&gt;
== Compiler ==&lt;br /&gt;
&lt;br /&gt;
I could fix no. 10 and 11; no. 12 has a wrong url. (Not Found). --[[User:Joaquín Martínez|Joaquín Martínez]] 13:19, 5 April 2012 (EDT)&lt;br /&gt;
&lt;br /&gt;
:Joaquin, thanks for your help. Following your example I've managed to correctly locate and sort out the remaining reference. [[User:RolandPlankton|RolandPlankton]] 14:32, 5 April 2012 (EDT)&lt;/div&gt;</summary>
		<author><name>RolandPlankton</name></author>
	</entry>
	<entry>
		<id>https://www.conservapedia.com/index.php?title=Chomsky_hierarchy&amp;diff=980589</id>
		<title>Chomsky hierarchy</title>
		<link rel="alternate" type="text/html" href="https://www.conservapedia.com/index.php?title=Chomsky_hierarchy&amp;diff=980589"/>
		<updated>2012-05-09T23:39:52Z</updated>

		<summary type="html">&lt;p&gt;RolandPlankton: /* Level 0: recursively enumerable grammar */ add example&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The '''Chomsky hierarchy''', sometimes known as the '''Chomsky-Schützenberger hierarchy''', is a hierarchy of formal grammatical systems for describing various classes of languages; the hierarchy can apply to both human and computer languages. This hierarchy was first published in 1956 by [[Noam Chomsky|Chomsky]].&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite journal &lt;br /&gt;
| title = Three models for the description of language &lt;br /&gt;
| year = 1956 &lt;br /&gt;
| last = Chomsky &lt;br /&gt;
| first = Noam &lt;br /&gt;
| journal = IRE Transactions on Information Theory &lt;br /&gt;
| volume = 2 &lt;br /&gt;
| pages = 113–124 &lt;br /&gt;
| url = http://www.chomsky.info/articles/195609--.pdf &lt;br /&gt;
| accessdate = 2012-04-08&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
These grammatical systems were referred to by Chomsky as ''transformational grammars''.  Other linguists have since developed a variety of similar grammars; together these are known as ''generative grammars''. &lt;br /&gt;
&lt;br /&gt;
The basic idea of a '''generative grammar''' is to provide a set of rules which are capable of generating all possible grammatical sentences in some language; the rules must constrain the generation so that only grammatical sentences are generated. The rules can also be used in reverse to parse a sentence and check if it is grammatical.&lt;br /&gt;
&lt;br /&gt;
In the late 1950's, [[John Backus]] and Peter Naur developed a notation for describing [[programming language]]s. This notation is known as [[Backus Naur Form]] (or BNF) and turns out to be equivalent to Chomsky's grammar number two (context-free grammar), although it was developed independently of Chomsky's work. Backus-Naur Form was first used in the Algol 60 Report to specify the syntax of [[Algol 60]], and has since been used for specifying the syntax of other programming languages. &lt;br /&gt;
&lt;br /&gt;
==Example of a very simple generative grammar==&lt;br /&gt;
This very simple example can handle only a tiny subset of English and should not be taken seriously as a guide to English grammar or vocabulary. It is based on an example by David Crystal&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite book &lt;br /&gt;
| last = Crystal &lt;br /&gt;
| first = David  &lt;br /&gt;
| title = The Cambridge Encyclopedia of Language &lt;br /&gt;
| publisher = Cambridge University Press &lt;br /&gt;
| year = 1987 &lt;br /&gt;
| isbn = 0-521-42443-7&lt;br /&gt;
| pages = page 97&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; and is a slight extension of an example on slide 9 of this lecture.&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.cs.princeton.edu/~rywang/99f126/slides/16th.pdf&lt;br /&gt;
| title = Lecture notes: Formal Languages&lt;br /&gt;
| accessdate = 2012-04-07}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase''         # A ''Sentence'' consists of a ''NounPhrase'' followed by a ''VerbPhrase''&lt;br /&gt;
 ''NounPhrase'' -&amp;gt;  ''Determiner'' ''Noun''               # A ''NounPhrase'' consists of a ''Determiner'' followed by a ''Noun''&lt;br /&gt;
 ''VerbPhrase'' -&amp;gt;  ''Verb'' ''NounPhrase''               # A ''VerbPhrase'' consists of a ''Verb'' followed by a ''NounPhrase''&lt;br /&gt;
 ''Determiner'' -&amp;gt;  '''a''', '''the'''                        # A ''Determiner''  is one of: '''a''' or '''the'''&lt;br /&gt;
 ''Noun''       -&amp;gt;  '''boy''', '''girl''', '''dog'''                # A ''Noun'' is one of: '''boy''' or '''girl''' or '''dog'''  &lt;br /&gt;
 ''Verb''       -&amp;gt;  '''chased''', '''heard''', '''saw'''            # A ''Verb'' is one of: '''chased''' or '''heard''' or '''saw'''&lt;br /&gt;
&lt;br /&gt;
Notation used above: &lt;br /&gt;
:The symbol &amp;quot;-&amp;gt;&amp;quot; means &amp;quot;can be replaced by&amp;quot;.  &lt;br /&gt;
:When there are several items on the right hand side separated by commas, just one of these items can be selected. &lt;br /&gt;
:The comments preceded by &amp;quot;#&amp;quot; are not part of the generative grammar, but hopefully will help folks understand the example a little better.&lt;br /&gt;
&lt;br /&gt;
By making appropriate substitutions we can generate such sentences as:&lt;br /&gt;
:The dog chased a girl.&lt;br /&gt;
:The girl heard the dog.&lt;br /&gt;
:The boy saw a girl.&lt;br /&gt;
&lt;br /&gt;
The stages in the generation of these examples are as follows:&lt;br /&gt;
:''Sentence''&lt;br /&gt;
:-&amp;gt; ''NounPhrase'' ''VerbPhrase''&lt;br /&gt;
:-&amp;gt; ''Determiner'' ''Noun'' ''Verb'' ''NounPhrase''&lt;br /&gt;
:-&amp;gt; ''Determiner'' ''Noun'' ''Verb'' ''Determiner'' ''Noun''&lt;br /&gt;
&lt;br /&gt;
By appropriate selection of words to substitute for ''Determiner'', ''Noun'', and ''Verb'' we can produce the 3 example sentences above.&lt;br /&gt;
&lt;br /&gt;
The simple grammar defines a few words which can be substituted for ''Determiner'', ''Noun'', and ''Verb''. There are two possibilities for ''Determiner'', three for ''Noun'', and three for ''Verb'', with both ''Determiner'' and ''Noun'' appearing twice in the expansion. Hence the total number of grammatical sentences which can be generated by this simple grammar is 108 (= 2 * 3 * 3 * 2 * 3). In this particular case the possible words have been carefully chosen so that all of these 108 sentences also actually mean something.&lt;br /&gt;
&lt;br /&gt;
Note that the use of ''italics'' and '''boldface''' in this example is merely a convenient way of indicating the difference between items which can be expanded further (e.g. concepts such as ''NounPhrase'') and items which can not be expanded further (e.g. words such as '''girl'''). In the linguistic literature, items which can be expanded further are referred to as 'non-terminal' items, while items which can't be expanded further are known as 'terminal' items.&lt;br /&gt;
&lt;br /&gt;
The 'comma' notation for alternatives is a form of shorthand. In some formulations this would be shown as several separate rules, so that:&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''a''', '''the''' &lt;br /&gt;
could be shown as two rules:&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''a'''&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''the''' &lt;br /&gt;
&lt;br /&gt;
==Caution==&lt;br /&gt;
While a generative grammar may produce sentences which are grammatically correct, there is no certainty that such sentences will actually mean anything. The classic example of such a meaningless sentence is from Chomsky's book&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite book &lt;br /&gt;
| last = Chomsky &lt;br /&gt;
| first = Noam &lt;br /&gt;
| title = Syntactic Structures &lt;br /&gt;
| year = 1957 &lt;br /&gt;
| publisher = Mouton &lt;br /&gt;
| location = The Hague/Paris &lt;br /&gt;
| pages = page 15 &lt;br /&gt;
| isbn = 3-11-017279-8&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; with the grammatically correct sentence:&lt;br /&gt;
&lt;br /&gt;
:&amp;quot;Colorless green ideas sleep furiously.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
:This example illustrates the difference between grammar/syntax and meaning/semantics.&lt;br /&gt;
&lt;br /&gt;
Another problem when analysing a sentence is that many English words have multiple meanings, so that there may be more than one way to interpret a sentence. A simple example is the sentence: &lt;br /&gt;
:&amp;quot;Time flies.&amp;quot; &lt;br /&gt;
:Is this an instruction to check how fast flies are flying, or an indication that time appears to be passing quickly? &lt;br /&gt;
:A varied and entertaining selection of such ambiguities has been compiled by Jeff Gray.&amp;lt;ref&amp;gt;{{Cite web &lt;br /&gt;
| title = Collection of Ambiguous or Inconsistent/Incomplete Statements  &lt;br /&gt;
| url = http://www.gray-area.org/Research/Ambig/ &lt;br /&gt;
| author = Jeff Gray&lt;br /&gt;
| accessdate = 2012-04-10&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Formal grammar==&lt;br /&gt;
'''Note''': this section and subsequent sections are, by necessity, slightly more technical/formal than the earlier parts of this article, though specialist notation and abbreviations have been largely avoided. Make sure that you understand the 'Simple example' above before proceeding further, since references will be made to that example to help explain the technicalities, and variations on that example will be used to illustrate new ideas. &lt;br /&gt;
&lt;br /&gt;
A formal generative grammar has four components (see slide 19 of this lecture&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://adammikeal.org/courses/compute/Chomsky%20Presentation.pdf&lt;br /&gt;
| title = The Chomsky Hierarchy&lt;br /&gt;
| accessdate = 2012-04-06&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
):&lt;br /&gt;
# a finite number of non-terminal concepts (e.g. ''VerbPhrase'' in the example, or anything else in ''italics''),&lt;br /&gt;
# a finite number of terminal items (e.g. '''girl''' in the example, or anything else in '''bold-face''').&lt;br /&gt;
# a finite set of rules for transforming non-terminal items (e.g. the example has 6 rules).&lt;br /&gt;
# a single starting point (e.g. ''Sentence'' in the example).&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
:Terminal items are those which can not be transformed into anything else.&lt;br /&gt;
:A list of all the terminal items is effectively the vocabulary from which sentences are built.&lt;br /&gt;
:Non-terminal items are those which can be transformed into something else.&lt;br /&gt;
:Linguists have developed various classes of grammars by using constraints to govern what sort of rules can be used for any particular grammar.&lt;br /&gt;
&lt;br /&gt;
===Changing the rules===&lt;br /&gt;
An relatively small change to even a single rule can make a large change in the language which can be generated. For example, change the first rule in the simple example to read:&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''NounPhrase'' ''VerbPhrase'' '''and''' ''NounPhrase'' ''VerbPhrase''&lt;br /&gt;
This means that a ''Sentence'' is either a ''NounPhrase'' followed by a ''VerbPhrase'' or a ''NounPhrase'' followed by a ''VerbPhrase'' followed by '''and''' followed by a ''NounPhrase'' followed by a ''VerbPhrase''. In addition to the shorter sentences already discussed, this could also generate a sentence such as: &amp;quot;A dog saw a girl and the dog chased the girl&amp;quot;. The total number of grammatically-correct sentences which can be generated by this modified grammar is now 11,772 (108 + 108*108), though some of these may not be very meaingful.&lt;br /&gt;
&lt;br /&gt;
===Towards infinity===&lt;br /&gt;
A significantly different rule change can have an astounding effect. Consider changing the first rule to read:&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''NounPhrase'' ''VerbPhrase'' '''and''' ''Sentence''&lt;br /&gt;
This can generate a potentially infinite number of sentences (any number of these five-word sentences linked by '''and'''). This is an example of what is known as a [[Recursion|recursive]] definition, whereby a ''Sentence'' is partially defined in terms of itself. In such a recursive rule there must be at least one transformation option which does not involve ''Sentence'', otherwise the transformation could never stop.&lt;br /&gt;
&lt;br /&gt;
The above change is known as right-recursive; a left-recursive formulation is also possible, and can in this example generate exactly the same sentences. As shown below  under 'Context-free grammar', there are situations where the choice of left- or right-recursive formulations can change the meaning. &lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''Sentence'' '''and''' ''NounPhrase'' ''VerbPhrase'' &lt;br /&gt;
&lt;br /&gt;
The distinction between left- and right-recursive grammars becomes important when trying to parse/analyse a sentence; some types of parser work best with left-recursive grammars, while other types work best with right-recursive grammars. This distinction is particularly relevant in connection with [[compiler|compiling or translating]] a program written in some high-level [[programming language]] so that it can be used on a [[computer]].&lt;br /&gt;
&lt;br /&gt;
==Chomsky hierarchy==&lt;br /&gt;
By imposing different constraints&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.cs.uaf.edu/2011/spring/cs331/lectures/cs331_20110124_grammar.html&lt;br /&gt;
| title = Lecture notes: Languages &amp;amp; Grammars&lt;br /&gt;
| accessdate = 2012-04-07&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; &lt;br /&gt;
as to what sort of transformation rules could be used, Chomsky was able to define four strictly nested transformational grammars, which he numbered from 0 to 3. As the grammar number increases, the generated language becomes simpler. As the grammar number decreases, parsing a sentence in that language becomes more difficult.&lt;br /&gt;
Other linguists have described formal grammars which fit in between the various Chomsky levels. &lt;br /&gt;
&lt;br /&gt;
The following table provides a summary, which is then explained further in the subsequent subsections.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!| Chomsky&amp;lt;br&amp;gt;number || linguistic name || Rule constraints || Recogniser+ || Notes &lt;br /&gt;
|-&lt;br /&gt;
| 0 || recursively enumerable || [anything] -&amp;gt; [anything] || Turing machine || most human languages &lt;br /&gt;
|-&lt;br /&gt;
| 1 || context-sensitive || X ''A'' Y -&amp;gt; X [anything] Y || linear bounded automaton || X and Y provide the context in which ''A'' can be transformed &lt;br /&gt;
|-&lt;br /&gt;
| 2 || context-free || ''A'' -&amp;gt; [anything] || non-deterministic push-down automaton || syntax analysis for most programming languages &lt;br /&gt;
|-&lt;br /&gt;
| 3 || regular || ''A'' -&amp;gt; [nothing]&amp;lt;br&amp;gt;''A'' -&amp;gt; '''xyz'''&amp;lt;br&amp;gt;''A'' -&amp;gt; '''xyz''' ''B'' || finite automaton&amp;lt;br&amp;gt;or finite state machine || lexical analysis (combining characters into words/tokens)  &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''+''' The '''recogniser''' column indicates the type of mathematical or computer science theoretical model needed to recognise that a sentence belongs to a language, essentially by applying the transformation rules in reverse to work backwards from the actual words in order to finish up with a ''sentence'' (in programming languages the starting concept is usually a ''program''). A finite automaton uses only a small fixed amount of memory, operates in time proportional to the length of the input, and always reaches a decision, while a Turing machine may use an infinite amount of memory and time and may fail to reach a decision (may never stop).&lt;br /&gt;
&lt;br /&gt;
In the linguistic literature, [nothing] is often represented by the symbol '''ε'''.&lt;br /&gt;
&lt;br /&gt;
The descriptions of the various Chomsky levels which follow are presented in reverse order, so as to work up from a simple case to a rather complicated case.&lt;br /&gt;
&lt;br /&gt;
===Level 3: regular grammar===&lt;br /&gt;
The transformation rules for regular grammars are required to be very simple. &lt;br /&gt;
*Only a single non-terminal item can appear on the left-hand side of a rule.&lt;br /&gt;
*The right-hand side of any rule must be one of:&lt;br /&gt;
**[nothing].&lt;br /&gt;
**a terminal item.&lt;br /&gt;
**a terminal item followed by a non-terminal item.&lt;br /&gt;
Note that instead of a terminal item we could have a non-terminal item whose transformation rule immediately resolves to a single terminal item, or to one of several terminal items.&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
Informally we can define a 'word' as a sequence of one or more ''Letter''s. The following regular grammar provides a more formal definition; for simplicity it is restricted to lower-case letters.&lt;br /&gt;
&lt;br /&gt;
 ''Word''     -&amp;gt; ''Letter'' ''PartWord''&lt;br /&gt;
 ''PartWord'' -&amp;gt; [nothing]&lt;br /&gt;
 ''PartWord'' -&amp;gt; ''Letter'' ''PartWord''&lt;br /&gt;
 ''Letter''   -&amp;gt; '''a''', '''b''', ... '''z'''&lt;br /&gt;
&lt;br /&gt;
Note that ''PartWord'' is recursively defined, with the recursion stopping if it is transformed into [nothing].&lt;br /&gt;
&lt;br /&gt;
For one-letter words we expand as: &lt;br /&gt;
:''Word'' -&amp;gt; ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' [nothing] -&amp;gt; ''Letter''&lt;br /&gt;
&lt;br /&gt;
For two-letter words we expand as: &lt;br /&gt;
:''Word'' -&amp;gt; ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' ''Letter'' [nothing] -&amp;gt;  ''Letter'' ''Letter''&lt;br /&gt;
&lt;br /&gt;
Obviously, words of any length can be constructed, though they may well not actually be words from any language. &lt;br /&gt;
&lt;br /&gt;
====Discussion====&lt;br /&gt;
Trying to devise transformation rules to produce words which are more English-like is much more difficult - how do you insist on at least one vowel or on no more than 5 consecutive consonants (e.g. as in 'strengths').&lt;br /&gt;
&lt;br /&gt;
Further examples in [[Regular grammar]] show how numbers can be defined via a regular grammar, and also show how a hyphenated word could be defined.&lt;br /&gt;
&lt;br /&gt;
One of the limitations of a regular grammar is that it can't cope with nested matching brackets, so that it is impossible to write a regular grammar to describe an expression such as '''2 * (3+4)''' where that grammar is expected to allow brackets nested to any depth. A context-free grammar is needed for this, as described in the next section.&lt;br /&gt;
&lt;br /&gt;
Regular grammars or equivalent are widely used by [[compiler]]s in the lexical analysis of programming languages.&lt;br /&gt;
&lt;br /&gt;
===Level 2: context-free grammar===&lt;br /&gt;
The transformation rules for context-free grammars don't appear that much different from those for regular grammars. &lt;br /&gt;
*Only a single non-terminal item can appear on the left-hand side of a rule.&lt;br /&gt;
*The right-hand side of any rule must be one of:&lt;br /&gt;
**[nothing].&lt;br /&gt;
**any combination of terminal items and non-terminal items.&lt;br /&gt;
&lt;br /&gt;
The key difference is that in a regular grammar, any non-empty rule must effectively start with terminal item so that every rule transformation makes some immediate progress, while in a context-free grammar a rule could start with a non-terminal item which itself could be subject to arbitrary further transformations.&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
The following example shows how context-free grammars can cope with arithmetic expressions involving possibly nested brackets. Also an expression such as &amp;quot;2 + 3 * 4&amp;quot; could be interpreted as either &amp;quot;(2 + 3) * 4&amp;quot; = 20 or as &amp;quot;2 + (3 * 4)&amp;quot; = 14. The latter interpretation is that which is normally used - multiplication &amp;quot;*&amp;quot; is said to have a higher priority than addition &amp;quot;+&amp;quot; - so the grammar must incorporate this priority concept. Furthermore, consecutive operators of the same priority are normally applied from left to right, so that &amp;quot;8 - 2 + 3&amp;quot; is interpreted as &amp;quot;(8 - 2) + 3&amp;quot; = 9, rather than as &amp;quot;8 - (2 + 3)&amp;quot; = 3.  This ordering must also be built in to the grammar.&lt;br /&gt;
&lt;br /&gt;
To avoid distracting side-issues, this example only deals with numbers which consist solely of a single digit. The example is a simplified version of the definition of an arithmetic expression given in the Revised Algol 60 Report (Section 3.3.1).&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.masswerk.at/algol60/report.htm&lt;br /&gt;
| title = Revised Report on the Algorithmic Language Algol 60&lt;br /&gt;
| accessdate = 2012-04-22&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ''Expression'' -&amp;gt; ''Term''                        # an ''Expression'' is either a ''Term''&lt;br /&gt;
 ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''    #   or an ''Expression'' followed by '''+''' or '''-''' followed by a ''Term''&lt;br /&gt;
 ''Term''       -&amp;gt; ''Primary''                     # a ''Term'' is either a ''Primary''&lt;br /&gt;
 ''Term''       -&amp;gt; ''Term'' ''MulDivOp'' ''Primary''       #   or a ''Term'' followed by '''*''' or '''/''' followed by a ''Primary''&lt;br /&gt;
                                           #&lt;br /&gt;
 ''Primary''    -&amp;gt; ''Number''                      # a ''Primary'' is either a ''Number''&lt;br /&gt;
 ''Primary''    -&amp;gt; '''(''' ''Expression'' ''')'''              #   or an ''Expression'' enclosed in brackets&lt;br /&gt;
                                           #&lt;br /&gt;
 ''MulDivOp''   -&amp;gt; '''*'''. '''/'''                        # multiplication and division have the same priority&lt;br /&gt;
 ''AddSubOp''   -&amp;gt; '''+'''. '''-'''                        # addition and subtraction have the same priority&lt;br /&gt;
 ''Number''     -&amp;gt; '''0''', '''1''', ... '''9'''                 # this simple-minded definition of a ''Number'' is enough for this example&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
* Both ''Expression'' and ''Term'' are each defined via a left-recursive rule; this ensures that operators of the same priority are applied from left to right.&lt;br /&gt;
* The distinction between ''Expression'' and ''Term'' ensures that multiplication/division are applied before addition/subtraction.&lt;br /&gt;
* ''Expression'' is indirectly recursive via ''Term'' and ''Primary'' to allow bracketed sub-expressions to any depth.&lt;br /&gt;
&lt;br /&gt;
Example 1: generate 2 + 3 * 4&lt;br /&gt;
&lt;br /&gt;
  ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Term'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Primary'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' ''Term''                                 # '''+''' can not be applied until ''Term'' has been evaluated&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' ''Term'' ''MulDivOp'' ''Primary''&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' ''Primary'' ''MulDipOp'' ''Primary''&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' '''3''' '''*''' '''4'''&lt;br /&gt;
&lt;br /&gt;
Example 2: generate 2 * 3 + 4&lt;br /&gt;
&lt;br /&gt;
  ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Term'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Term'' ''MulDivOp'' ''Primary'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Primary'' ''MulDivOp'' ''Primary'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; '''2''' '''*''' '''3''' ''AddSubOp'' ''Term''                      # ''Term'' to left of ''AddSubOp'' is evaluated first&lt;br /&gt;
             -&amp;gt; '''2''' '''*''' '''3''' ''AddSubOp'' ''Primary''  &lt;br /&gt;
             -&amp;gt; '''2''' '''*''' '''3''' '''+''' '''4'''&lt;br /&gt;
&lt;br /&gt;
====Discussion====&lt;br /&gt;
Context-free grammars (or equivalent definitions using Backus-Naur-Form) are widely used both to define the syntax of programming languages and to (semi-automatically) generate parsers for these languages.&lt;br /&gt;
&lt;br /&gt;
A limitation/feature of both regular grammars and context-free grammars is that the left-hand side of any rule is always a single non-terminal item, so any transformation is applied regardless of the context in which that non-terminal item appears.  A simple example which depends on context is the use of singular and plural nouns and verbs in English.  We say: '''the man runs''' or '''the men run''', but neither of '''the man run''' nor '''the men runs'''.  Which form of verb to use depends on the noun, i.e. there is a context dependency.&lt;br /&gt;
&lt;br /&gt;
===Level 1: context-sensitive grammar===&lt;br /&gt;
For context-sensitive grammars the left-hand side of a rule may indicate the context in which that rule applies, so that the same non-terminal item may be transformed in different ways depending on the context in which it appears.&lt;br /&gt;
&lt;br /&gt;
There is only one transformation rule for context-sensitive grammars:&lt;br /&gt;
*X [non-terminal] Y -&amp;gt; X [anything] Y&lt;br /&gt;
&lt;br /&gt;
where X and Y determine the context in which the [non-terminal] is transformed. Note that X and Y may each be terminals or non-terminals or [nothing]. When both X and Y are nothing there is no context and this reduces to a Level 2 or Level 3 grammar.&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
Taylor has provided several examples&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.divms.uiowa.edu/~fleck/taylor.pdf&lt;br /&gt;
| title = Context-sensitive Examples&lt;br /&gt;
| author = Taylor&lt;br /&gt;
| accessdate = 2012-04-26&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
and the following, inspired by his third example, is an extension of the original simple example above to handle singulars and plurals:&lt;br /&gt;
&lt;br /&gt;
 ''Sentence''                -&amp;gt;  ''NounPhrase'' ''VerbPhrase''            # simple sentence structure&lt;br /&gt;
 ''NounPhrase''              -&amp;gt;  ''Determiner'' ''Noun''                  # simple phrase structure&lt;br /&gt;
 ''VerbPhrase''              -&amp;gt;  ''Verb'' ''NounPhrase''                  # simple phrase structure&lt;br /&gt;
                                                              #&lt;br /&gt;
 ''Noun''                    -&amp;gt;  ''SingularNoun'', ''PluralNoun''         # nouns can be singular or plural &lt;br /&gt;
                                                              #&lt;br /&gt;
 ''Determiner'' ''SingularNoun'' -&amp;gt;  ''SingularDeterminer'' ''SingularNoun''  # context-sensitive:&lt;br /&gt;
 ''Determiner'' ''PluralNoun''   -&amp;gt;  ''PluralDeterminer'' ''PluralNoun''      #    determiner must agree with noun&lt;br /&gt;
                                                              #&lt;br /&gt;
 ''SingularNoun'' ''Verb''       -&amp;gt;  ''SingularNoun'' ''SingularVerb''        # context-sensitive: &lt;br /&gt;
 ''PluralNoun'' ''Verb''         -&amp;gt;  ''PluralNoun'' ''PluralVerb''            #    verb must agree with noun&lt;br /&gt;
                                                              #&lt;br /&gt;
 ''SingularDeterminer''      -&amp;gt;  '''a''', '''the'''                           # singular determiners&lt;br /&gt;
 ''PluralDeterminer''        -&amp;gt;  '''the'''                              # plural determiners&lt;br /&gt;
                                                              #&lt;br /&gt;
 ''SingularNoun''            -&amp;gt;  '''boy''', '''sheep''', '''dog'''                  # singular nouns&lt;br /&gt;
 ''PluralNoun''              -&amp;gt;  '''boys''', '''sheep''', '''dogs'''                # plural nouns&lt;br /&gt;
                                                              #&lt;br /&gt;
 ''SingularVerb''            -&amp;gt;  '''chases''', '''hears''', '''sees'''              # singular verbs&lt;br /&gt;
 ''PluralVerb''              -&amp;gt;  '''chase''', '''hear''', '''see'''                 # plural verbs&lt;br /&gt;
&lt;br /&gt;
The above grammar can generate sentences such as: '''a boy chases a dog''', '''the boys chase a dog''', etc. Because some words have the same form in both singular and plural, it can also generate meaningful (and grammatically-correct) sentences such as: '''the sheep sees the dog''', '''the sheep see the dog'''.&lt;br /&gt;
&lt;br /&gt;
But the above grammar can NOT generate sentences such as: '''a boys chases the sheep''', since this would violate the context-sensitive rules.&lt;br /&gt;
&lt;br /&gt;
====Discussion====&lt;br /&gt;
It is in fact possible to handle singular/plural issues by using only a Level 2 context-free grammar, but the above rules expressed as a Level 1 context-sensitive grammar are a closer match to ordinary concepts of English grammar (e.g. nouns and verbs must agree in number i.e. singular/plural).&lt;br /&gt;
&lt;br /&gt;
===Level 0: recursively enumerable grammar===&lt;br /&gt;
A recursively enumerable grammar has absolutely no restriction on what sort of transformation rules can be applied; hence it is also known as an unrestricted grammar. Rules take the general form:&lt;br /&gt;
*[anything] -&amp;gt; [anything]&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
The following rules can generate all symbols of the form: abc, aabbcc, aaabbbccc, etc., where there are equal numbers of a's, b's and c's. This example is taken from a lecture.&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.cs.utexas.edu/~cline/ear/Slides/Turing/TuringSlides3.doc&lt;br /&gt;
| title = Grammars, Recursively Enumerable Languages, and Turing Machines&lt;br /&gt;
| accessdate = 2012-05-10&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ''S''   -&amp;gt; '''a''' ''B'' ''S'' '''c'''&lt;br /&gt;
 ''S''   -&amp;gt; '''a''' ''B'' '''c'''&lt;br /&gt;
 ''B'' '''a''' -&amp;gt; '''a''' ''B''&lt;br /&gt;
 ''B'' '''c''' -&amp;gt; '''b''' '''c'''&lt;br /&gt;
 ''B'' '''b''' -&amp;gt; '''b''' '''b'''&lt;br /&gt;
&lt;br /&gt;
The derivations of the first three items in this infinite sequence are:&lt;br /&gt;
&lt;br /&gt;
# ''S'' -&amp;gt; '''a'''''B'''''c''' -&amp;gt; '''abc'''&lt;br /&gt;
# ''S'' -&amp;gt; '''a'''''BS'''''c''' -&amp;gt; '''a'''''B'''''a'''''B'''''cc''' -&amp;gt; '''aa'''''B B'''''cc''' -&amp;gt; '''aa'''''B'''''bcc''' -&amp;gt; '''aabbcc'''&lt;br /&gt;
# ''S'' -&amp;gt; '''a'''''BS'''''c''' -&amp;gt; '''a'''''B'''''a'''''BS'''''cc''' -&amp;gt; '''a'''''B'''''a'''''B'''''a'''''B'''''ccc''' -&amp;gt; '''aa'''''BB'''''a'''''B'''''ccc''' -&amp;gt; '''aa'''''B'''''a'''''BB'''''ccc''' -&amp;gt; '''aaa'''''BBB'''''ccc''' -&amp;gt; '''aaa'''''BB'''''bccc''' -&amp;gt; '''aaa'''''B'''''bbccc''' -&amp;gt; '''aaabbbccc'''&lt;br /&gt;
&lt;br /&gt;
===Beyond Level 0===&lt;br /&gt;
These lecture notes&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.google.co.uk/url?sa=t&amp;amp;rct=j&amp;amp;q=recursively+enumerable+languages+examples&amp;amp;source=web&amp;amp;cd=4&amp;amp;ved=0CF4QFjAD&amp;amp;url=http%3A%2F%2Fwww.cs.colostate.edu%2F~massey%2FTeaching%2Fcs301%2FRestrictedAccess%2FSlides%2F301lecture23.pdf&amp;amp;ei=6qelT4KMA6SA0AXIu7CQBA&amp;amp;usg=AFQjCNG3fc1mD7g5f-14vfDPdvyX2uScDg&lt;br /&gt;
| title = Recursive and Recursively Enumerable Languages&lt;br /&gt;
| accessdate = 2012-05-05&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
show that languages exist which can not be described by any set of rules. As is common with logical proofs of this nature, the proof doesn't actually produce or demonstrate such a language.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[category:linguistics]]&lt;br /&gt;
[[Category:Computer Science]]&lt;/div&gt;</summary>
		<author><name>RolandPlankton</name></author>
	</entry>
	<entry>
		<id>https://www.conservapedia.com/index.php?title=Chomsky_hierarchy&amp;diff=980307</id>
		<title>Chomsky hierarchy</title>
		<link rel="alternate" type="text/html" href="https://www.conservapedia.com/index.php?title=Chomsky_hierarchy&amp;diff=980307"/>
		<updated>2012-05-08T17:52:18Z</updated>

		<summary type="html">&lt;p&gt;RolandPlankton: /* Chomsky hierarchy */ make notation consistent. note re 'beyond level 0'&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The '''Chomsky hierarchy''', sometimes known as the '''Chomsky-Schützenberger hierarchy''', is a hierarchy of formal grammatical systems for describing various classes of languages; the hierarchy can apply to both human and computer languages. This hierarchy was first published in 1956 by [[Noam Chomsky|Chomsky]].&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite journal &lt;br /&gt;
| title = Three models for the description of language &lt;br /&gt;
| year = 1956 &lt;br /&gt;
| last = Chomsky &lt;br /&gt;
| first = Noam &lt;br /&gt;
| journal = IRE Transactions on Information Theory &lt;br /&gt;
| volume = 2 &lt;br /&gt;
| pages = 113–124 &lt;br /&gt;
| url = http://www.chomsky.info/articles/195609--.pdf &lt;br /&gt;
| accessdate = 2012-04-08&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
These grammatical systems were referred to by Chomsky as ''transformational grammars''.  Other linguists have since developed a variety of similar grammars; together these are known as ''generative grammars''. &lt;br /&gt;
&lt;br /&gt;
The basic idea of a '''generative grammar''' is to provide a set of rules which are capable of generating all possible grammatical sentences in some language; the rules must constrain the generation so that only grammatical sentences are generated. The rules can also be used in reverse to parse a sentence and check if it is grammatical.&lt;br /&gt;
&lt;br /&gt;
In the late 1950's, [[John Backus]] and Peter Naur developed a notation for describing [[programming language]]s. This notation is known as [[Backus Naur Form]] (or BNF) and turns out to be equivalent to Chomsky's grammar number two (context-free grammar), although it was developed independently of Chomsky's work. Backus-Naur Form was first used in the Algol 60 Report to specify the syntax of [[Algol 60]], and has since been used for specifying the syntax of other programming languages. &lt;br /&gt;
&lt;br /&gt;
==Example of a very simple generative grammar==&lt;br /&gt;
This very simple example can handle only a tiny subset of English and should not be taken seriously as a guide to English grammar or vocabulary. It is based on an example by David Crystal&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite book &lt;br /&gt;
| last = Crystal &lt;br /&gt;
| first = David  &lt;br /&gt;
| title = The Cambridge Encyclopedia of Language &lt;br /&gt;
| publisher = Cambridge University Press &lt;br /&gt;
| year = 1987 &lt;br /&gt;
| isbn = 0-521-42443-7&lt;br /&gt;
| pages = page 97&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; and is a slight extension of an example on slide 9 of this lecture.&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.cs.princeton.edu/~rywang/99f126/slides/16th.pdf&lt;br /&gt;
| title = Lecture notes: Formal Languages&lt;br /&gt;
| accessdate = 2012-04-07}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase''         # A ''Sentence'' consists of a ''NounPhrase'' followed by a ''VerbPhrase''&lt;br /&gt;
 ''NounPhrase'' -&amp;gt;  ''Determiner'' ''Noun''               # A ''NounPhrase'' consists of a ''Determiner'' followed by a ''Noun''&lt;br /&gt;
 ''VerbPhrase'' -&amp;gt;  ''Verb'' ''NounPhrase''               # A ''VerbPhrase'' consists of a ''Verb'' followed by a ''NounPhrase''&lt;br /&gt;
 ''Determiner'' -&amp;gt;  '''a''', '''the'''                        # A ''Determiner''  is one of: '''a''' or '''the'''&lt;br /&gt;
 ''Noun''       -&amp;gt;  '''boy''', '''girl''', '''dog'''                # A ''Noun'' is one of: '''boy''' or '''girl''' or '''dog'''  &lt;br /&gt;
 ''Verb''       -&amp;gt;  '''chased''', '''heard''', '''saw'''            # A ''Verb'' is one of: '''chased''' or '''heard''' or '''saw'''&lt;br /&gt;
&lt;br /&gt;
Notation used above: &lt;br /&gt;
:The symbol &amp;quot;-&amp;gt;&amp;quot; means &amp;quot;can be replaced by&amp;quot;.  &lt;br /&gt;
:When there are several items on the right hand side separated by commas, just one of these items can be selected. &lt;br /&gt;
:The comments preceded by &amp;quot;#&amp;quot; are not part of the generative grammar, but hopefully will help folks understand the example a little better.&lt;br /&gt;
&lt;br /&gt;
By making appropriate substitutions we can generate such sentences as:&lt;br /&gt;
:The dog chased a girl.&lt;br /&gt;
:The girl heard the dog.&lt;br /&gt;
:The boy saw a girl.&lt;br /&gt;
&lt;br /&gt;
The stages in the generation of these examples are as follows:&lt;br /&gt;
:''Sentence''&lt;br /&gt;
:-&amp;gt; ''NounPhrase'' ''VerbPhrase''&lt;br /&gt;
:-&amp;gt; ''Determiner'' ''Noun'' ''Verb'' ''NounPhrase''&lt;br /&gt;
:-&amp;gt; ''Determiner'' ''Noun'' ''Verb'' ''Determiner'' ''Noun''&lt;br /&gt;
&lt;br /&gt;
By appropriate selection of words to substitute for ''Determiner'', ''Noun'', and ''Verb'' we can produce the 3 example sentences above.&lt;br /&gt;
&lt;br /&gt;
The simple grammar defines a few words which can be substituted for ''Determiner'', ''Noun'', and ''Verb''. There are two possibilities for ''Determiner'', three for ''Noun'', and three for ''Verb'', with both ''Determiner'' and ''Noun'' appearing twice in the expansion. Hence the total number of grammatical sentences which can be generated by this simple grammar is 108 (= 2 * 3 * 3 * 2 * 3). In this particular case the possible words have been carefully chosen so that all of these 108 sentences also actually mean something.&lt;br /&gt;
&lt;br /&gt;
Note that the use of ''italics'' and '''boldface''' in this example is merely a convenient way of indicating the difference between items which can be expanded further (e.g. concepts such as ''NounPhrase'') and items which can not be expanded further (e.g. words such as '''girl'''). In the linguistic literature, items which can be expanded further are referred to as 'non-terminal' items, while items which can't be expanded further are known as 'terminal' items.&lt;br /&gt;
&lt;br /&gt;
The 'comma' notation for alternatives is a form of shorthand. In some formulations this would be shown as several separate rules, so that:&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''a''', '''the''' &lt;br /&gt;
could be shown as two rules:&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''a'''&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''the''' &lt;br /&gt;
&lt;br /&gt;
==Caution==&lt;br /&gt;
While a generative grammar may produce sentences which are grammatically correct, there is no certainty that such sentences will actually mean anything. The classic example of such a meaningless sentence is from Chomsky's book&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite book &lt;br /&gt;
| last = Chomsky &lt;br /&gt;
| first = Noam &lt;br /&gt;
| title = Syntactic Structures &lt;br /&gt;
| year = 1957 &lt;br /&gt;
| publisher = Mouton &lt;br /&gt;
| location = The Hague/Paris &lt;br /&gt;
| pages = page 15 &lt;br /&gt;
| isbn = 3-11-017279-8&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; with the grammatically correct sentence:&lt;br /&gt;
&lt;br /&gt;
:&amp;quot;Colorless green ideas sleep furiously.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
:This example illustrates the difference between grammar/syntax and meaning/semantics.&lt;br /&gt;
&lt;br /&gt;
Another problem when analysing a sentence is that many English words have multiple meanings, so that there may be more than one way to interpret a sentence. A simple example is the sentence: &lt;br /&gt;
:&amp;quot;Time flies.&amp;quot; &lt;br /&gt;
:Is this an instruction to check how fast flies are flying, or an indication that time appears to be passing quickly? &lt;br /&gt;
:A varied and entertaining selection of such ambiguities has been compiled by Jeff Gray.&amp;lt;ref&amp;gt;{{Cite web &lt;br /&gt;
| title = Collection of Ambiguous or Inconsistent/Incomplete Statements  &lt;br /&gt;
| url = http://www.gray-area.org/Research/Ambig/ &lt;br /&gt;
| author = Jeff Gray&lt;br /&gt;
| accessdate = 2012-04-10&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Formal grammar==&lt;br /&gt;
'''Note''': this section and subsequent sections are, by necessity, slightly more technical/formal than the earlier parts of this article, though specialist notation and abbreviations have been largely avoided. Make sure that you understand the 'Simple example' above before proceeding further, since references will be made to that example to help explain the technicalities, and variations on that example will be used to illustrate new ideas. &lt;br /&gt;
&lt;br /&gt;
A formal generative grammar has four components (see slide 19 of this lecture&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://adammikeal.org/courses/compute/Chomsky%20Presentation.pdf&lt;br /&gt;
| title = The Chomsky Hierarchy&lt;br /&gt;
| accessdate = 2012-04-06&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
):&lt;br /&gt;
# a finite number of non-terminal concepts (e.g. ''VerbPhrase'' in the example, or anything else in ''italics''),&lt;br /&gt;
# a finite number of terminal items (e.g. '''girl''' in the example, or anything else in '''bold-face''').&lt;br /&gt;
# a finite set of rules for transforming non-terminal items (e.g. the example has 6 rules).&lt;br /&gt;
# a single starting point (e.g. ''Sentence'' in the example).&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
:Terminal items are those which can not be transformed into anything else.&lt;br /&gt;
:A list of all the terminal items is effectively the vocabulary from which sentences are built.&lt;br /&gt;
:Non-terminal items are those which can be transformed into something else.&lt;br /&gt;
:Linguists have developed various classes of grammars by using constraints to govern what sort of rules can be used for any particular grammar.&lt;br /&gt;
&lt;br /&gt;
===Changing the rules===&lt;br /&gt;
An relatively small change to even a single rule can make a large change in the language which can be generated. For example, change the first rule in the simple example to read:&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''NounPhrase'' ''VerbPhrase'' '''and''' ''NounPhrase'' ''VerbPhrase''&lt;br /&gt;
This means that a ''Sentence'' is either a ''NounPhrase'' followed by a ''VerbPhrase'' or a ''NounPhrase'' followed by a ''VerbPhrase'' followed by '''and''' followed by a ''NounPhrase'' followed by a ''VerbPhrase''. In addition to the shorter sentences already discussed, this could also generate a sentence such as: &amp;quot;A dog saw a girl and the dog chased the girl&amp;quot;. The total number of grammatically-correct sentences which can be generated by this modified grammar is now 11,772 (108 + 108*108), though some of these may not be very meaingful.&lt;br /&gt;
&lt;br /&gt;
===Towards infinity===&lt;br /&gt;
A significantly different rule change can have an astounding effect. Consider changing the first rule to read:&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''NounPhrase'' ''VerbPhrase'' '''and''' ''Sentence''&lt;br /&gt;
This can generate a potentially infinite number of sentences (any number of these five-word sentences linked by '''and'''). This is an example of what is known as a [[Recursion|recursive]] definition, whereby a ''Sentence'' is partially defined in terms of itself. In such a recursive rule there must be at least one transformation option which does not involve ''Sentence'', otherwise the transformation could never stop.&lt;br /&gt;
&lt;br /&gt;
The above change is known as right-recursive; a left-recursive formulation is also possible, and can in this example generate exactly the same sentences. As shown below  under 'Context-free grammar', there are situations where the choice of left- or right-recursive formulations can change the meaning. &lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''Sentence'' '''and''' ''NounPhrase'' ''VerbPhrase'' &lt;br /&gt;
&lt;br /&gt;
The distinction between left- and right-recursive grammars becomes important when trying to parse/analyse a sentence; some types of parser work best with left-recursive grammars, while other types work best with right-recursive grammars. This distinction is particularly relevant in connection with [[compiler|compiling or translating]] a program written in some high-level [[programming language]] so that it can be used on a [[computer]].&lt;br /&gt;
&lt;br /&gt;
==Chomsky hierarchy==&lt;br /&gt;
By imposing different constraints&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.cs.uaf.edu/2011/spring/cs331/lectures/cs331_20110124_grammar.html&lt;br /&gt;
| title = Lecture notes: Languages &amp;amp; Grammars&lt;br /&gt;
| accessdate = 2012-04-07&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; &lt;br /&gt;
as to what sort of transformation rules could be used, Chomsky was able to define four strictly nested transformational grammars, which he numbered from 0 to 3. As the grammar number increases, the generated language becomes simpler. As the grammar number decreases, parsing a sentence in that language becomes more difficult.&lt;br /&gt;
Other linguists have described formal grammars which fit in between the various Chomsky levels. &lt;br /&gt;
&lt;br /&gt;
The following table provides a summary, which is then explained further in the subsequent subsections.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!| Chomsky&amp;lt;br&amp;gt;number || linguistic name || Rule constraints || Recogniser+ || Notes &lt;br /&gt;
|-&lt;br /&gt;
| 0 || recursively enumerable || [anything] -&amp;gt; [anything] || Turing machine || most human languages &lt;br /&gt;
|-&lt;br /&gt;
| 1 || context-sensitive || X ''A'' Y -&amp;gt; X [anything] Y || linear bounded automaton || X and Y provide the context in which ''A'' can be transformed &lt;br /&gt;
|-&lt;br /&gt;
| 2 || context-free || ''A'' -&amp;gt; [anything] || non-deterministic push-down automaton || syntax analysis for most programming languages &lt;br /&gt;
|-&lt;br /&gt;
| 3 || regular || ''A'' -&amp;gt; [nothing]&amp;lt;br&amp;gt;''A'' -&amp;gt; '''xyz'''&amp;lt;br&amp;gt;''A'' -&amp;gt; '''xyz''' ''B'' || finite automaton&amp;lt;br&amp;gt;or finite state machine || lexical analysis (combining characters into words/tokens)  &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''+''' The '''recogniser''' column indicates the type of mathematical or computer science theoretical model needed to recognise that a sentence belongs to a language, essentially by applying the transformation rules in reverse to work backwards from the actual words in order to finish up with a ''sentence'' (in programming languages the starting concept is usually a ''program''). A finite automaton uses only a small fixed amount of memory, operates in time proportional to the length of the input, and always reaches a decision, while a Turing machine may use an infinite amount of memory and time and may fail to reach a decision (may never stop).&lt;br /&gt;
&lt;br /&gt;
In the linguistic literature, [nothing] is often represented by the symbol '''ε'''.&lt;br /&gt;
&lt;br /&gt;
The descriptions of the various Chomsky levels which follow are presented in reverse order, so as to work up from a simple case to a rather complicated case.&lt;br /&gt;
&lt;br /&gt;
===Level 3: regular grammar===&lt;br /&gt;
The transformation rules for regular grammars are required to be very simple. &lt;br /&gt;
*Only a single non-terminal item can appear on the left-hand side of a rule.&lt;br /&gt;
*The right-hand side of any rule must be one of:&lt;br /&gt;
**[nothing].&lt;br /&gt;
**a terminal item.&lt;br /&gt;
**a terminal item followed by a non-terminal item.&lt;br /&gt;
Note that instead of a terminal item we could have a non-terminal item whose transformation rule immediately resolves to a single terminal item, or to one of several terminal items.&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
Informally we can define a 'word' as a sequence of one or more ''Letter''s. The following regular grammar provides a more formal definition; for simplicity it is restricted to lower-case letters.&lt;br /&gt;
&lt;br /&gt;
 ''Word''     -&amp;gt; ''Letter'' ''PartWord''&lt;br /&gt;
 ''PartWord'' -&amp;gt; [nothing]&lt;br /&gt;
 ''PartWord'' -&amp;gt; ''Letter'' ''PartWord''&lt;br /&gt;
 ''Letter''   -&amp;gt; '''a''', '''b''', ... '''z'''&lt;br /&gt;
&lt;br /&gt;
Note that ''PartWord'' is recursively defined, with the recursion stopping if it is transformed into [nothing].&lt;br /&gt;
&lt;br /&gt;
For one-letter words we expand as: &lt;br /&gt;
:''Word'' -&amp;gt; ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' [nothing] -&amp;gt; ''Letter''&lt;br /&gt;
&lt;br /&gt;
For two-letter words we expand as: &lt;br /&gt;
:''Word'' -&amp;gt; ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' ''Letter'' [nothing] -&amp;gt;  ''Letter'' ''Letter''&lt;br /&gt;
&lt;br /&gt;
Obviously, words of any length can be constructed, though they may well not actually be words from any language. &lt;br /&gt;
&lt;br /&gt;
====Discussion====&lt;br /&gt;
Trying to devise transformation rules to produce words which are more English-like is much more difficult - how do you insist on at least one vowel or on no more than 5 consecutive consonants (e.g. as in 'strengths').&lt;br /&gt;
&lt;br /&gt;
Further examples in [[Regular grammar]] show how numbers can be defined via a regular grammar, and also show how a hyphenated word could be defined.&lt;br /&gt;
&lt;br /&gt;
One of the limitations of a regular grammar is that it can't cope with nested matching brackets, so that it is impossible to write a regular grammar to describe an expression such as '''2 * (3+4)''' where that grammar is expected to allow brackets nested to any depth. A context-free grammar is needed for this, as described in the next section.&lt;br /&gt;
&lt;br /&gt;
Regular grammars or equivalent are widely used by [[compiler]]s in the lexical analysis of programming languages.&lt;br /&gt;
&lt;br /&gt;
===Level 2: context-free grammar===&lt;br /&gt;
The transformation rules for context-free grammars don't appear that much different from those for regular grammars. &lt;br /&gt;
*Only a single non-terminal item can appear on the left-hand side of a rule.&lt;br /&gt;
*The right-hand side of any rule must be one of:&lt;br /&gt;
**[nothing].&lt;br /&gt;
**any combination of terminal items and non-terminal items.&lt;br /&gt;
&lt;br /&gt;
The key difference is that in a regular grammar, any non-empty rule must effectively start with terminal item so that every rule transformation makes some immediate progress, while in a context-free grammar a rule could start with a non-terminal item which itself could be subject to arbitrary further transformations.&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
The following example shows how context-free grammars can cope with arithmetic expressions involving possibly nested brackets. Also an expression such as &amp;quot;2 + 3 * 4&amp;quot; could be interpreted as either &amp;quot;(2 + 3) * 4&amp;quot; = 20 or as &amp;quot;2 + (3 * 4)&amp;quot; = 14. The latter interpretation is that which is normally used - multiplication &amp;quot;*&amp;quot; is said to have a higher priority than addition &amp;quot;+&amp;quot; - so the grammar must incorporate this priority concept. Furthermore, consecutive operators of the same priority are normally applied from left to right, so that &amp;quot;8 - 2 + 3&amp;quot; is interpreted as &amp;quot;(8 - 2) + 3&amp;quot; = 9, rather than as &amp;quot;8 - (2 + 3)&amp;quot; = 3.  This ordering must also be built in to the grammar.&lt;br /&gt;
&lt;br /&gt;
To avoid distracting side-issues, this example only deals with numbers which consist solely of a single digit. The example is a simplified version of the definition of an arithmetic expression given in the Revised Algol 60 Report (Section 3.3.1).&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.masswerk.at/algol60/report.htm&lt;br /&gt;
| title = Revised Report on the Algorithmic Language Algol 60&lt;br /&gt;
| accessdate = 2012-04-22&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ''Expression'' -&amp;gt; ''Term''                        # an ''Expression'' is either a ''Term''&lt;br /&gt;
 ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''    #   or an ''Expression'' followed by '''+''' or '''-''' followed by a ''Term''&lt;br /&gt;
 ''Term''       -&amp;gt; ''Primary''                     # a ''Term'' is either a ''Primary''&lt;br /&gt;
 ''Term''       -&amp;gt; ''Term'' ''MulDivOp'' ''Primary''       #   or a ''Term'' followed by '''*''' or '''/''' followed by a ''Primary''&lt;br /&gt;
                                           #&lt;br /&gt;
 ''Primary''    -&amp;gt; ''Number''                      # a ''Primary'' is either a ''Number''&lt;br /&gt;
 ''Primary''    -&amp;gt; '''(''' ''Expression'' ''')'''              #   or an ''Expression'' enclosed in brackets&lt;br /&gt;
                                           #&lt;br /&gt;
 ''MulDivOp''   -&amp;gt; '''*'''. '''/'''                        # multiplication and division have the same priority&lt;br /&gt;
 ''AddSubOp''   -&amp;gt; '''+'''. '''-'''                        # addition and subtraction have the same priority&lt;br /&gt;
 ''Number''     -&amp;gt; '''0''', '''1''', ... '''9'''                 # this simple-minded definition of a ''Number'' is enough for this example&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
* Both ''Expression'' and ''Term'' are each defined via a left-recursive rule; this ensures that operators of the same priority are applied from left to right.&lt;br /&gt;
* The distinction between ''Expression'' and ''Term'' ensures that multiplication/division are applied before addition/subtraction.&lt;br /&gt;
* ''Expression'' is indirectly recursive via ''Term'' and ''Primary'' to allow bracketed sub-expressions to any depth.&lt;br /&gt;
&lt;br /&gt;
Example 1: generate 2 + 3 * 4&lt;br /&gt;
&lt;br /&gt;
  ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Term'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Primary'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' ''Term''                                 # '''+''' can not be applied until ''Term'' has been evaluated&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' ''Term'' ''MulDivOp'' ''Primary''&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' ''Primary'' ''MulDipOp'' ''Primary''&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' '''3''' '''*''' '''4'''&lt;br /&gt;
&lt;br /&gt;
Example 2: generate 2 * 3 + 4&lt;br /&gt;
&lt;br /&gt;
  ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Term'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Term'' ''MulDivOp'' ''Primary'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Primary'' ''MulDivOp'' ''Primary'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; '''2''' '''*''' '''3''' ''AddSubOp'' ''Term''                      # ''Term'' to left of ''AddSubOp'' is evaluated first&lt;br /&gt;
             -&amp;gt; '''2''' '''*''' '''3''' ''AddSubOp'' ''Primary''  &lt;br /&gt;
             -&amp;gt; '''2''' '''*''' '''3''' '''+''' '''4'''&lt;br /&gt;
&lt;br /&gt;
====Discussion====&lt;br /&gt;
Context-free grammars (or equivalent definitions using Backus-Naur-Form) are widely used both to define the syntax of programming languages and to (semi-automatically) generate parsers for these languages.&lt;br /&gt;
&lt;br /&gt;
A limitation/feature of both regular grammars and context-free grammars is that the left-hand side of any rule is always a single non-terminal item, so any transformation is applied regardless of the context in which that non-terminal item appears.  A simple example which depends on context is the use of singular and plural nouns and verbs in English.  We say: '''the man runs''' or '''the men run''', but neither of '''the man run''' nor '''the men runs'''.  Which form of verb to use depends on the noun, i.e. there is a context dependency.&lt;br /&gt;
&lt;br /&gt;
===Level 1: context-sensitive grammar===&lt;br /&gt;
For context-sensitive grammars the left-hand side of a rule may indicate the context in which that rule applies, so that the same non-terminal item may be transformed in different ways depending on the context in which it appears.&lt;br /&gt;
&lt;br /&gt;
There is only one transformation rule for context-sensitive grammars:&lt;br /&gt;
*X [non-terminal] Y -&amp;gt; X [anything] Y&lt;br /&gt;
&lt;br /&gt;
where X and Y determine the context in which the [non-terminal] is transformed. Note that X and Y may each be terminals or non-terminals or [nothing]. When both X and Y are nothing there is no context and this reduces to a Level 2 or Level 3 grammar.&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
Taylor has provided several examples&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.divms.uiowa.edu/~fleck/taylor.pdf&lt;br /&gt;
| title = Context-sensitive Examples&lt;br /&gt;
| author = Taylor&lt;br /&gt;
| accessdate = 2012-04-26&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
and the following, inspired by his third example, is an extension of the original simple example above to handle singulars and plurals:&lt;br /&gt;
&lt;br /&gt;
 ''Sentence''                -&amp;gt;  ''NounPhrase'' ''VerbPhrase''            # simple sentence structure&lt;br /&gt;
 ''NounPhrase''              -&amp;gt;  ''Determiner'' ''Noun''                  # simple phrase structure&lt;br /&gt;
 ''VerbPhrase''              -&amp;gt;  ''Verb'' ''NounPhrase''                  # simple phrase structure&lt;br /&gt;
                                                              #&lt;br /&gt;
 ''Noun''                    -&amp;gt;  ''SingularNoun'', ''PluralNoun''         # nouns can be singular or plural &lt;br /&gt;
                                                              #&lt;br /&gt;
 ''Determiner'' ''SingularNoun'' -&amp;gt;  ''SingularDeterminer'' ''SingularNoun''  # context-sensitive:&lt;br /&gt;
 ''Determiner'' ''PluralNoun''   -&amp;gt;  ''PluralDeterminer'' ''PluralNoun''      #    determiner must agree with noun&lt;br /&gt;
                                                              #&lt;br /&gt;
 ''SingularNoun'' ''Verb''       -&amp;gt;  ''SingularNoun'' ''SingularVerb''        # context-sensitive: &lt;br /&gt;
 ''PluralNoun'' ''Verb''         -&amp;gt;  ''PluralNoun'' ''PluralVerb''            #    verb must agree with noun&lt;br /&gt;
                                                              #&lt;br /&gt;
 ''SingularDeterminer''      -&amp;gt;  '''a''', '''the'''                           # singular determiners&lt;br /&gt;
 ''PluralDeterminer''        -&amp;gt;  '''the'''                              # plural determiners&lt;br /&gt;
                                                              #&lt;br /&gt;
 ''SingularNoun''            -&amp;gt;  '''boy''', '''sheep''', '''dog'''                  # singular nouns&lt;br /&gt;
 ''PluralNoun''              -&amp;gt;  '''boys''', '''sheep''', '''dogs'''                # plural nouns&lt;br /&gt;
                                                              #&lt;br /&gt;
 ''SingularVerb''            -&amp;gt;  '''chases''', '''hears''', '''sees'''              # singular verbs&lt;br /&gt;
 ''PluralVerb''              -&amp;gt;  '''chase''', '''hear''', '''see'''                 # plural verbs&lt;br /&gt;
&lt;br /&gt;
The above grammar can generate sentences such as: '''a boy chases a dog''', '''the boys chase a dog''', etc. Because some words have the same form in both singular and plural, it can also generate meaningful (and grammatically-correct) sentences such as: '''the sheep sees the dog''', '''the sheep see the dog'''.&lt;br /&gt;
&lt;br /&gt;
But the above grammar can NOT generate sentences such as: '''a boys chases the sheep''', since this would violate the context-sensitive rules.&lt;br /&gt;
&lt;br /&gt;
====Discussion====&lt;br /&gt;
It is in fact possible to handle singular/plural issues by using only a Level 2 context-free grammar, but the above rules expressed as a Level 1 context-sensitive grammar are a closer match to ordinary concepts of English grammar (e.g. nouns and verbs must agree in number i.e. singular/plural).&lt;br /&gt;
&lt;br /&gt;
===Level 0: recursively enumerable grammar===&lt;br /&gt;
A recursively enumerable grammar has absolutely no restriction on what sort of transformation rules can be applied; hence it is also known as an unrestricted grammar. Rules take the general form:&lt;br /&gt;
*[anything] -&amp;gt; [anything]&lt;br /&gt;
&lt;br /&gt;
===Beyond Level 0===&lt;br /&gt;
These lecture notes&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.google.co.uk/url?sa=t&amp;amp;rct=j&amp;amp;q=recursively+enumerable+languages+examples&amp;amp;source=web&amp;amp;cd=4&amp;amp;ved=0CF4QFjAD&amp;amp;url=http%3A%2F%2Fwww.cs.colostate.edu%2F~massey%2FTeaching%2Fcs301%2FRestrictedAccess%2FSlides%2F301lecture23.pdf&amp;amp;ei=6qelT4KMA6SA0AXIu7CQBA&amp;amp;usg=AFQjCNG3fc1mD7g5f-14vfDPdvyX2uScDg&lt;br /&gt;
| title = Recursive and Recursively Enumerable Languages&lt;br /&gt;
| accessdate = 2012-05-05&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
show that languages exist which can not be described by any set of rules. As is common with logical proofs of this nature, the proof doesn't actually produce or demonstrate such a language.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[category:linguistics]]&lt;br /&gt;
[[Category:Computer Science]]&lt;/div&gt;</summary>
		<author><name>RolandPlankton</name></author>
	</entry>
	<entry>
		<id>https://www.conservapedia.com/index.php?title=Chomsky_hierarchy&amp;diff=980174</id>
		<title>Chomsky hierarchy</title>
		<link rel="alternate" type="text/html" href="https://www.conservapedia.com/index.php?title=Chomsky_hierarchy&amp;diff=980174"/>
		<updated>2012-05-07T23:18:14Z</updated>

		<summary type="html">&lt;p&gt;RolandPlankton: /* Chomsky hierarchy */ remove duplication&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The '''Chomsky hierarchy''', sometimes known as the '''Chomsky-Schützenberger hierarchy''', is a hierarchy of formal grammatical systems for describing various classes of languages; the hierarchy can apply to both human and computer languages. This hierarchy was first published in 1956 by [[Noam Chomsky|Chomsky]].&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite journal &lt;br /&gt;
| title = Three models for the description of language &lt;br /&gt;
| year = 1956 &lt;br /&gt;
| last = Chomsky &lt;br /&gt;
| first = Noam &lt;br /&gt;
| journal = IRE Transactions on Information Theory &lt;br /&gt;
| volume = 2 &lt;br /&gt;
| pages = 113–124 &lt;br /&gt;
| url = http://www.chomsky.info/articles/195609--.pdf &lt;br /&gt;
| accessdate = 2012-04-08&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
These grammatical systems were referred to by Chomsky as ''transformational grammars''.  Other linguists have since developed a variety of similar grammars; together these are known as ''generative grammars''. &lt;br /&gt;
&lt;br /&gt;
The basic idea of a '''generative grammar''' is to provide a set of rules which are capable of generating all possible grammatical sentences in some language; the rules must constrain the generation so that only grammatical sentences are generated. The rules can also be used in reverse to parse a sentence and check if it is grammatical.&lt;br /&gt;
&lt;br /&gt;
In the late 1950's, [[John Backus]] and Peter Naur developed a notation for describing [[programming language]]s. This notation is known as [[Backus Naur Form]] (or BNF) and turns out to be equivalent to Chomsky's grammar number two (context-free grammar), although it was developed independently of Chomsky's work. Backus-Naur Form was first used in the Algol 60 Report to specify the syntax of [[Algol 60]], and has since been used for specifying the syntax of other programming languages. &lt;br /&gt;
&lt;br /&gt;
==Example of a very simple generative grammar==&lt;br /&gt;
This very simple example can handle only a tiny subset of English and should not be taken seriously as a guide to English grammar or vocabulary. It is based on an example by David Crystal&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite book &lt;br /&gt;
| last = Crystal &lt;br /&gt;
| first = David  &lt;br /&gt;
| title = The Cambridge Encyclopedia of Language &lt;br /&gt;
| publisher = Cambridge University Press &lt;br /&gt;
| year = 1987 &lt;br /&gt;
| isbn = 0-521-42443-7&lt;br /&gt;
| pages = page 97&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; and is a slight extension of an example on slide 9 of this lecture.&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.cs.princeton.edu/~rywang/99f126/slides/16th.pdf&lt;br /&gt;
| title = Lecture notes: Formal Languages&lt;br /&gt;
| accessdate = 2012-04-07}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase''         # A ''Sentence'' consists of a ''NounPhrase'' followed by a ''VerbPhrase''&lt;br /&gt;
 ''NounPhrase'' -&amp;gt;  ''Determiner'' ''Noun''               # A ''NounPhrase'' consists of a ''Determiner'' followed by a ''Noun''&lt;br /&gt;
 ''VerbPhrase'' -&amp;gt;  ''Verb'' ''NounPhrase''               # A ''VerbPhrase'' consists of a ''Verb'' followed by a ''NounPhrase''&lt;br /&gt;
 ''Determiner'' -&amp;gt;  '''a''', '''the'''                        # A ''Determiner''  is one of: '''a''' or '''the'''&lt;br /&gt;
 ''Noun''       -&amp;gt;  '''boy''', '''girl''', '''dog'''                # A ''Noun'' is one of: '''boy''' or '''girl''' or '''dog'''  &lt;br /&gt;
 ''Verb''       -&amp;gt;  '''chased''', '''heard''', '''saw'''            # A ''Verb'' is one of: '''chased''' or '''heard''' or '''saw'''&lt;br /&gt;
&lt;br /&gt;
Notation used above: &lt;br /&gt;
:The symbol &amp;quot;-&amp;gt;&amp;quot; means &amp;quot;can be replaced by&amp;quot;.  &lt;br /&gt;
:When there are several items on the right hand side separated by commas, just one of these items can be selected. &lt;br /&gt;
:The comments preceded by &amp;quot;#&amp;quot; are not part of the generative grammar, but hopefully will help folks understand the example a little better.&lt;br /&gt;
&lt;br /&gt;
By making appropriate substitutions we can generate such sentences as:&lt;br /&gt;
:The dog chased a girl.&lt;br /&gt;
:The girl heard the dog.&lt;br /&gt;
:The boy saw a girl.&lt;br /&gt;
&lt;br /&gt;
The stages in the generation of these examples are as follows:&lt;br /&gt;
:''Sentence''&lt;br /&gt;
:-&amp;gt; ''NounPhrase'' ''VerbPhrase''&lt;br /&gt;
:-&amp;gt; ''Determiner'' ''Noun'' ''Verb'' ''NounPhrase''&lt;br /&gt;
:-&amp;gt; ''Determiner'' ''Noun'' ''Verb'' ''Determiner'' ''Noun''&lt;br /&gt;
&lt;br /&gt;
By appropriate selection of words to substitute for ''Determiner'', ''Noun'', and ''Verb'' we can produce the 3 example sentences above.&lt;br /&gt;
&lt;br /&gt;
The simple grammar defines a few words which can be substituted for ''Determiner'', ''Noun'', and ''Verb''. There are two possibilities for ''Determiner'', three for ''Noun'', and three for ''Verb'', with both ''Determiner'' and ''Noun'' appearing twice in the expansion. Hence the total number of grammatical sentences which can be generated by this simple grammar is 108 (= 2 * 3 * 3 * 2 * 3). In this particular case the possible words have been carefully chosen so that all of these 108 sentences also actually mean something.&lt;br /&gt;
&lt;br /&gt;
Note that the use of ''italics'' and '''boldface''' in this example is merely a convenient way of indicating the difference between items which can be expanded further (e.g. concepts such as ''NounPhrase'') and items which can not be expanded further (e.g. words such as '''girl'''). In the linguistic literature, items which can be expanded further are referred to as 'non-terminal' items, while items which can't be expanded further are known as 'terminal' items.&lt;br /&gt;
&lt;br /&gt;
The 'comma' notation for alternatives is a form of shorthand. In some formulations this would be shown as several separate rules, so that:&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''a''', '''the''' &lt;br /&gt;
could be shown as two rules:&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''a'''&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''the''' &lt;br /&gt;
&lt;br /&gt;
==Caution==&lt;br /&gt;
While a generative grammar may produce sentences which are grammatically correct, there is no certainty that such sentences will actually mean anything. The classic example of such a meaningless sentence is from Chomsky's book&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite book &lt;br /&gt;
| last = Chomsky &lt;br /&gt;
| first = Noam &lt;br /&gt;
| title = Syntactic Structures &lt;br /&gt;
| year = 1957 &lt;br /&gt;
| publisher = Mouton &lt;br /&gt;
| location = The Hague/Paris &lt;br /&gt;
| pages = page 15 &lt;br /&gt;
| isbn = 3-11-017279-8&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; with the grammatically correct sentence:&lt;br /&gt;
&lt;br /&gt;
:&amp;quot;Colorless green ideas sleep furiously.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
:This example illustrates the difference between grammar/syntax and meaning/semantics.&lt;br /&gt;
&lt;br /&gt;
Another problem when analysing a sentence is that many English words have multiple meanings, so that there may be more than one way to interpret a sentence. A simple example is the sentence: &lt;br /&gt;
:&amp;quot;Time flies.&amp;quot; &lt;br /&gt;
:Is this an instruction to check how fast flies are flying, or an indication that time appears to be passing quickly? &lt;br /&gt;
:A varied and entertaining selection of such ambiguities has been compiled by Jeff Gray.&amp;lt;ref&amp;gt;{{Cite web &lt;br /&gt;
| title = Collection of Ambiguous or Inconsistent/Incomplete Statements  &lt;br /&gt;
| url = http://www.gray-area.org/Research/Ambig/ &lt;br /&gt;
| author = Jeff Gray&lt;br /&gt;
| accessdate = 2012-04-10&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Formal grammar==&lt;br /&gt;
'''Note''': this section and subsequent sections are, by necessity, slightly more technical/formal than the earlier parts of this article, though specialist notation and abbreviations have been largely avoided. Make sure that you understand the 'Simple example' above before proceeding further, since references will be made to that example to help explain the technicalities, and variations on that example will be used to illustrate new ideas. &lt;br /&gt;
&lt;br /&gt;
A formal generative grammar has four components (see slide 19 of this lecture&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://adammikeal.org/courses/compute/Chomsky%20Presentation.pdf&lt;br /&gt;
| title = The Chomsky Hierarchy&lt;br /&gt;
| accessdate = 2012-04-06&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
):&lt;br /&gt;
# a finite number of non-terminal concepts (e.g. ''VerbPhrase'' in the example, or anything else in ''italics''),&lt;br /&gt;
# a finite number of terminal items (e.g. '''girl''' in the example, or anything else in '''bold-face''').&lt;br /&gt;
# a finite set of rules for transforming non-terminal items (e.g. the example has 6 rules).&lt;br /&gt;
# a single starting point (e.g. ''Sentence'' in the example).&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
:Terminal items are those which can not be transformed into anything else.&lt;br /&gt;
:A list of all the terminal items is effectively the vocabulary from which sentences are built.&lt;br /&gt;
:Non-terminal items are those which can be transformed into something else.&lt;br /&gt;
:Linguists have developed various classes of grammars by using constraints to govern what sort of rules can be used for any particular grammar.&lt;br /&gt;
&lt;br /&gt;
===Changing the rules===&lt;br /&gt;
An relatively small change to even a single rule can make a large change in the language which can be generated. For example, change the first rule in the simple example to read:&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''NounPhrase'' ''VerbPhrase'' '''and''' ''NounPhrase'' ''VerbPhrase''&lt;br /&gt;
This means that a ''Sentence'' is either a ''NounPhrase'' followed by a ''VerbPhrase'' or a ''NounPhrase'' followed by a ''VerbPhrase'' followed by '''and''' followed by a ''NounPhrase'' followed by a ''VerbPhrase''. In addition to the shorter sentences already discussed, this could also generate a sentence such as: &amp;quot;A dog saw a girl and the dog chased the girl&amp;quot;. The total number of grammatically-correct sentences which can be generated by this modified grammar is now 11,772 (108 + 108*108), though some of these may not be very meaingful.&lt;br /&gt;
&lt;br /&gt;
===Towards infinity===&lt;br /&gt;
A significantly different rule change can have an astounding effect. Consider changing the first rule to read:&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''NounPhrase'' ''VerbPhrase'' '''and''' ''Sentence''&lt;br /&gt;
This can generate a potentially infinite number of sentences (any number of these five-word sentences linked by '''and'''). This is an example of what is known as a [[Recursion|recursive]] definition, whereby a ''Sentence'' is partially defined in terms of itself. In such a recursive rule there must be at least one transformation option which does not involve ''Sentence'', otherwise the transformation could never stop.&lt;br /&gt;
&lt;br /&gt;
The above change is known as right-recursive; a left-recursive formulation is also possible, and can in this example generate exactly the same sentences. As shown below  under 'Context-free grammar', there are situations where the choice of left- or right-recursive formulations can change the meaning. &lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''Sentence'' '''and''' ''NounPhrase'' ''VerbPhrase'' &lt;br /&gt;
&lt;br /&gt;
The distinction between left- and right-recursive grammars becomes important when trying to parse/analyse a sentence; some types of parser work best with left-recursive grammars, while other types work best with right-recursive grammars. This distinction is particularly relevant in connection with [[compiler|compiling or translating]] a program written in some high-level [[programming language]] so that it can be used on a [[computer]].&lt;br /&gt;
&lt;br /&gt;
==Chomsky hierarchy==&lt;br /&gt;
By imposing different constraints&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.cs.uaf.edu/2011/spring/cs331/lectures/cs331_20110124_grammar.html&lt;br /&gt;
| title = Lecture notes: Languages &amp;amp; Grammars&lt;br /&gt;
| accessdate = 2012-04-07&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; &lt;br /&gt;
as to what sort of transformation rules could be used, Chomsky was able to define four strictly nested transformational grammars, which he numbered from 0 to 3. As the grammar number increases, the generated language becomes simpler. As the grammar number decreases, parsing a sentence in that language becomes more difficult.&lt;br /&gt;
Other linguists have described formal grammars which fit in between the various Chomsky levels. &lt;br /&gt;
&lt;br /&gt;
The following table provides a summary, which is then explained further in the subsequent subsections.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!| Chomsky&amp;lt;br&amp;gt;number || linguistic name || Rule constraints || Recogniser+ || Notes &lt;br /&gt;
|-&lt;br /&gt;
| 0 || recursively enumerable || [anything] -&amp;gt; [anything] || Turing machine || most human languages &lt;br /&gt;
|-&lt;br /&gt;
| 1 || context-sensitive || X ''A'' Y -&amp;gt; X [anything] Y || linear bounded automaton || X and Y provide the context in which ''A'' can be transformed &lt;br /&gt;
|-&lt;br /&gt;
| 2 || context-free || ''A'' -&amp;gt; [anything] || non-deterministic push-down automaton || syntax analysis for most programming languages &lt;br /&gt;
|-&lt;br /&gt;
| 3 || regular || ''A'' -&amp;gt; [nothing]&amp;lt;br&amp;gt;''A'' -&amp;gt; '''xyz'''&amp;lt;br&amp;gt;''A'' -&amp;gt; '''xyz''' ''B'' || finite automaton&amp;lt;br&amp;gt;or finite state machine || lexical analysis (combining characters into words/tokens)  &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''+''' The '''recogniser''' column indicates the type of mathematical or computer science theoretical model needed to recognise that a sentence belongs to a language, essentially by applying the transformation rules in reverse to work backwards from the actual words in order to finish up with a ''sentence'' (in programming languages the starting concept is usually a ''program''). A finite automaton uses only a small fixed amount of memory, operates in time proportional to the length of the input, and always reaches a decision, while a Turing machine may use an infinite amount of memory and time and may fail to reach a decision (may never stop).&lt;br /&gt;
&lt;br /&gt;
In the linguistic literature, [nothing] is often represented by the symbol '''ε'''.&lt;br /&gt;
&lt;br /&gt;
The descriptions of the various Chomsky levels which follow are presented in reverse order, so as to work up from a simple case to a rather complicated case.&lt;br /&gt;
&lt;br /&gt;
===Level 3: regular grammar===&lt;br /&gt;
The transformation rules for regular grammars are required to be very simple. &lt;br /&gt;
*Only a single non-terminal item can appear on the left-hand side of a rule.&lt;br /&gt;
*The right-hand side of any rule must be one of:&lt;br /&gt;
**[nothing].&lt;br /&gt;
**a terminal item.&lt;br /&gt;
**a terminal item followed by a non-terminal item.&lt;br /&gt;
Note that instead of a terminal item we could have a non-terminal item whose transformation rule immediately resolves to a single terminal item, or to one of several terminal items.&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
Informally we can define a 'word' as a sequence of one or more ''Letter''s. The following regular grammar provides a more formal definition; for simplicity it is restricted to lower-case letters.&lt;br /&gt;
&lt;br /&gt;
 ''Word''     -&amp;gt; ''Letter'' ''PartWord''&lt;br /&gt;
 ''PartWord'' -&amp;gt; [nothing]&lt;br /&gt;
 ''PartWord'' -&amp;gt; ''Letter'' ''PartWord''&lt;br /&gt;
 ''Letter''   -&amp;gt; '''a''', '''b''', ... '''z'''&lt;br /&gt;
&lt;br /&gt;
Note that ''PartWord'' is recursively defined, with the recursion stopping if it is transformed into [nothing].&lt;br /&gt;
&lt;br /&gt;
For one-letter words we expand as: &lt;br /&gt;
:''Word'' -&amp;gt; ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' [nothing] -&amp;gt; ''Letter''&lt;br /&gt;
&lt;br /&gt;
For two-letter words we expand as: &lt;br /&gt;
:''Word'' -&amp;gt; ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' ''Letter'' [nothing] -&amp;gt;  ''Letter'' ''Letter''&lt;br /&gt;
&lt;br /&gt;
Obviously, words of any length can be constructed, though they may well not actually be words from any language. &lt;br /&gt;
&lt;br /&gt;
====Discussion====&lt;br /&gt;
Trying to devise transformation rules to produce words which are more English-like is much more difficult - how do you insist on at least one vowel or on no more than 5 consecutive consonants (e.g. as in 'strengths').&lt;br /&gt;
&lt;br /&gt;
Further examples in [[Regular grammar]] show how numbers can be defined via a regular grammar, and also show how a hyphenated word could be defined.&lt;br /&gt;
&lt;br /&gt;
One of the limitations of a regular grammar is that it can't cope with nested matching brackets, so that it is impossible to write a regular grammar to describe an expression such as '''2 * (3+4)''' where that grammar is expected to allow brackets nested to any depth. A context-free grammar is needed for this, as described in the next section.&lt;br /&gt;
&lt;br /&gt;
Regular grammars or equivalent are widely used by [[compiler]]s in the lexical analysis of programming languages.&lt;br /&gt;
&lt;br /&gt;
===Level 2: context-free grammar===&lt;br /&gt;
The transformation rules for context-free grammars don't appear that much different from those for regular grammars. &lt;br /&gt;
*Only a single non-terminal item can appear on the left-hand side of a rule.&lt;br /&gt;
*The right-hand side of any rule must be one of:&lt;br /&gt;
**[nothing].&lt;br /&gt;
**any combination of terminal items and non-terminal items.&lt;br /&gt;
&lt;br /&gt;
The key difference is that in a regular grammar, any non-empty rule must effectively start with terminal item so that every rule transformation makes some immediate progress, while in a context-free grammar a rule could start with a non-terminal item which itself could be subject to arbitrary further transformations.&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
The following example shows how context-free grammars can cope with arithmetic expressions involving possibly nested brackets. Also an expression such as &amp;quot;2 + 3 * 4&amp;quot; could be interpreted as either &amp;quot;(2 + 3) * 4&amp;quot; = 20 or as &amp;quot;2 + (3 * 4)&amp;quot; = 14. The latter interpretation is that which is normally used - multiplication &amp;quot;*&amp;quot; is said to have a higher priority than addition &amp;quot;+&amp;quot; - so the grammar must incorporate this priority concept. Furthermore, consecutive operators of the same priority are normally applied from left to right, so that &amp;quot;8 - 2 + 3&amp;quot; is interpreted as &amp;quot;(8 - 2) + 3&amp;quot; = 9, rather than as &amp;quot;8 - (2 + 3)&amp;quot; = 3.  This ordering must also be built in to the grammar.&lt;br /&gt;
&lt;br /&gt;
To avoid distracting side-issues, this example only deals with numbers which consist solely of a single digit. The example is a simplified version of the definition of an arithmetic expression given in the Revised Algol 60 Report (Section 3.3.1).&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.masswerk.at/algol60/report.htm&lt;br /&gt;
| title = Revised Report on the Algorithmic Language Algol 60&lt;br /&gt;
| accessdate = 2012-04-22&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ''Expression'' -&amp;gt; ''Term''                        # an ''Expression'' is either a ''Term''&lt;br /&gt;
 ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''    #   or an ''Expression'' followed by '''+''' or '''-''' followed by a ''Term''&lt;br /&gt;
 ''Term''       -&amp;gt; ''Primary''                     # a ''Term'' is either a ''Primary''&lt;br /&gt;
 ''Term''       -&amp;gt; ''Term'' ''MulDivOp'' ''Primary''       #   or a ''Term'' followed by '''*''' or '''/''' followed by a ''Primary''&lt;br /&gt;
                                           #&lt;br /&gt;
 ''Primary''    -&amp;gt; ''Number''                      # a ''Primary'' is either a ''Number''&lt;br /&gt;
 ''Primary''    -&amp;gt; '''(''' ''Expression'' ''')'''              #   or an ''Expression'' enclosed in brackets&lt;br /&gt;
                                           #&lt;br /&gt;
 ''MulDivOp''   -&amp;gt; '''*'''. '''/'''                        # multiplication and division have the same priority&lt;br /&gt;
 ''AddSubOp''   -&amp;gt; '''+'''. '''-'''                        # addition and subtraction have the same priority&lt;br /&gt;
 ''Number''     -&amp;gt; '''0''', '''1''', ... '''9'''                 # this simple-minded definition of a ''Number'' is enough for this example&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
* Both ''Expression'' and ''Term'' are each defined via a left-recursive rule; this ensures that operators of the same priority are applied from left to right.&lt;br /&gt;
* The distinction between ''Expression'' and ''Term'' ensures that multiplication/division are applied before addition/subtraction.&lt;br /&gt;
* ''Expression'' is indirectly recursive via ''Term'' and ''Primary'' to allow bracketed sub-expressions to any depth.&lt;br /&gt;
&lt;br /&gt;
Example 1: generate 2 + 3 * 4&lt;br /&gt;
&lt;br /&gt;
  ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Term'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Primary'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' ''Term''                                 # '''+''' can not be applied until ''Term'' has been evaluated&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' ''Term'' ''MulDivOp'' ''Primary''&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' ''Primary'' ''MulDipOp'' ''Primary''&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' '''3''' '''*''' '''4'''&lt;br /&gt;
&lt;br /&gt;
Example 2: generate 2 * 3 + 4&lt;br /&gt;
&lt;br /&gt;
  ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Term'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Term'' ''MulDivOp'' ''Primary'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Primary'' ''MulDivOp'' ''Primary'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; '''2''' '''*''' '''3''' ''AddSubOp'' ''Term''                      # ''Term'' to left of ''AddSubOp'' is evaluated first&lt;br /&gt;
             -&amp;gt; '''2''' '''*''' '''3''' ''AddSubOp'' ''Primary''  &lt;br /&gt;
             -&amp;gt; '''2''' '''*''' '''3''' '''+''' '''4'''&lt;br /&gt;
&lt;br /&gt;
====Discussion====&lt;br /&gt;
Context-free grammars (or equivalent definitions using Backus-Naur-Form) are widely used both to define the syntax of programming languages and to (semi-automatically) generate parsers for these languages.&lt;br /&gt;
&lt;br /&gt;
A limitation/feature of both regular grammars and context-free grammars is that the left-hand side of any rule is always a single non-terminal item, so any transformation is applied regardless of the context in which that non-terminal item appears.  A simple example which depends on context is the use of singular and plural nouns and verbs in English.  We say: '''the man runs''' or '''the men run''', but neither of '''the man run''' nor '''the men runs'''.  Which form of verb to use depends on the noun, i.e. there is a context dependency.&lt;br /&gt;
&lt;br /&gt;
===Level 1: context-sensitive grammar===&lt;br /&gt;
For context-sensitive grammars the left-hand side of a rule may indicate the context in which that rule applies, so that the same non-terminal item may be transformed in different ways depending on the context in which it appears.&lt;br /&gt;
&lt;br /&gt;
There is only one transformation rule for context-sensitive grammars:&lt;br /&gt;
&lt;br /&gt;
 X [non-terminal] Y -&amp;gt; X [anything] Y&lt;br /&gt;
&lt;br /&gt;
where X and Y determine the context in which the [non-terminal] is transformed. Note that X and Y may each be terminals or non-terminals or [nothing]. When both X and Y are nothing there is no context and this reduces to a Level 2 or Level 3 grammar.&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
Taylor has provided several examples&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.divms.uiowa.edu/~fleck/taylor.pdf&lt;br /&gt;
| title = Context-sensitive Examples&lt;br /&gt;
| author = Taylor&lt;br /&gt;
| accessdate = 2012-04-26&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
and the following, inspired by his third example, is an extension of the original simple example above to handle singulars and plurals:&lt;br /&gt;
&lt;br /&gt;
 ''Sentence''                -&amp;gt;  ''NounPhrase'' ''VerbPhrase''            # simple sentence structure&lt;br /&gt;
 ''NounPhrase''              -&amp;gt;  ''Determiner'' ''Noun''                  # simple phrase structure&lt;br /&gt;
 ''VerbPhrase''              -&amp;gt;  ''Verb'' ''NounPhrase''                  # simple phrase structure&lt;br /&gt;
                                                              #&lt;br /&gt;
 ''Noun''                    -&amp;gt;  ''SingularNoun'', ''PluralNoun''         # nouns can be singular or plural &lt;br /&gt;
                                                              #&lt;br /&gt;
 ''Determiner'' ''SingularNoun'' -&amp;gt;  ''SingularDeterminer'' ''SingularNoun''  # context-sensitive:&lt;br /&gt;
 ''Determiner'' ''PluralNoun''   -&amp;gt;  ''PluralDeterminer'' ''PluralNoun''      #    determiner must agree with noun&lt;br /&gt;
                                                              #&lt;br /&gt;
 ''SingularNoun'' ''Verb''       -&amp;gt;  ''SingularNoun'' ''SingularVerb''        # context-sensitive: &lt;br /&gt;
 ''PluralNoun'' ''Verb''         -&amp;gt;  ''PluralNoun'' ''PluralVerb''            #    verb must agree with noun&lt;br /&gt;
                                                              #&lt;br /&gt;
 ''SingularDeterminer''      -&amp;gt;  '''a''', '''the'''                           # singular determiners&lt;br /&gt;
 ''PluralDeterminer''        -&amp;gt;  '''the'''                              # plural determiners&lt;br /&gt;
                                                              #&lt;br /&gt;
 ''SingularNoun''            -&amp;gt;  '''boy''', '''sheep''', '''dog'''                  # singular nouns&lt;br /&gt;
 ''PluralNoun''              -&amp;gt;  '''boys''', '''sheep''', '''dogs'''                # plural nouns&lt;br /&gt;
                                                              #&lt;br /&gt;
 ''SingularVerb''            -&amp;gt;  '''chases''', '''hears''', '''sees'''              # singular verbs&lt;br /&gt;
 ''PluralVerb''              -&amp;gt;  '''chase''', '''hear''', '''see'''                 # plural verbs&lt;br /&gt;
&lt;br /&gt;
The above grammar can generate sentences such as: '''a boy chases a dog''', '''the boys chase a dog''', etc. Because some words have the same form in both singular and plural, it can also generate meaningful (and grammatically-correct) sentences such as: '''the sheep sees the dog''', '''the sheep see the dog'''.&lt;br /&gt;
&lt;br /&gt;
But the above grammar can NOT generate sentences such as: '''a boys chases the sheep''', since this would violate the context-sensitive rules.&lt;br /&gt;
&lt;br /&gt;
====Discussion====&lt;br /&gt;
It is in fact possible to handle singular/plural issues by using only a Level 2 context-free grammar, but the above rules expressed as a Level 1 context-sensitive grammar are a closer match to ordinary concepts of English grammar (e.g. nouns and verbs must agree in number i.e. singular/plural).&lt;br /&gt;
&lt;br /&gt;
===Level 0: recursively enumerable grammar===&lt;br /&gt;
A recursively enumerable grammar has absolutely no restriction on what sort of transformation rules can be applied. Rules take the general form:&lt;br /&gt;
&lt;br /&gt;
 [anything] -&amp;gt; [anything]&lt;br /&gt;
&lt;br /&gt;
===Beyond Level 0===&lt;br /&gt;
These lecture notes&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.google.co.uk/url?sa=t&amp;amp;rct=j&amp;amp;q=recursively+enumerable+languages+examples&amp;amp;source=web&amp;amp;cd=4&amp;amp;ved=0CF4QFjAD&amp;amp;url=http%3A%2F%2Fwww.cs.colostate.edu%2F~massey%2FTeaching%2Fcs301%2FRestrictedAccess%2FSlides%2F301lecture23.pdf&amp;amp;ei=6qelT4KMA6SA0AXIu7CQBA&amp;amp;usg=AFQjCNG3fc1mD7g5f-14vfDPdvyX2uScDg&lt;br /&gt;
| title = Recursive and Recursively Enumerable Languages&lt;br /&gt;
| accessdate = 2012-05-05&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
show that languages exist which can not be described by any set of rules.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[category:linguistics]]&lt;br /&gt;
[[Category:Computer Science]]&lt;/div&gt;</summary>
		<author><name>RolandPlankton</name></author>
	</entry>
	<entry>
		<id>https://www.conservapedia.com/index.php?title=Chomsky_hierarchy&amp;diff=980172</id>
		<title>Chomsky hierarchy</title>
		<link rel="alternate" type="text/html" href="https://www.conservapedia.com/index.php?title=Chomsky_hierarchy&amp;diff=980172"/>
		<updated>2012-05-07T23:15:46Z</updated>

		<summary type="html">&lt;p&gt;RolandPlankton: /* Chomsky hierarchy */ add 'beyond level 0'&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The '''Chomsky hierarchy''', sometimes known as the '''Chomsky-Schützenberger hierarchy''', is a hierarchy of formal grammatical systems for describing various classes of languages; the hierarchy can apply to both human and computer languages. This hierarchy was first published in 1956 by [[Noam Chomsky|Chomsky]].&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite journal &lt;br /&gt;
| title = Three models for the description of language &lt;br /&gt;
| year = 1956 &lt;br /&gt;
| last = Chomsky &lt;br /&gt;
| first = Noam &lt;br /&gt;
| journal = IRE Transactions on Information Theory &lt;br /&gt;
| volume = 2 &lt;br /&gt;
| pages = 113–124 &lt;br /&gt;
| url = http://www.chomsky.info/articles/195609--.pdf &lt;br /&gt;
| accessdate = 2012-04-08&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
These grammatical systems were referred to by Chomsky as ''transformational grammars''.  Other linguists have since developed a variety of similar grammars; together these are known as ''generative grammars''. &lt;br /&gt;
&lt;br /&gt;
The basic idea of a '''generative grammar''' is to provide a set of rules which are capable of generating all possible grammatical sentences in some language; the rules must constrain the generation so that only grammatical sentences are generated. The rules can also be used in reverse to parse a sentence and check if it is grammatical.&lt;br /&gt;
&lt;br /&gt;
In the late 1950's, [[John Backus]] and Peter Naur developed a notation for describing [[programming language]]s. This notation is known as [[Backus Naur Form]] (or BNF) and turns out to be equivalent to Chomsky's grammar number two (context-free grammar), although it was developed independently of Chomsky's work. Backus-Naur Form was first used in the Algol 60 Report to specify the syntax of [[Algol 60]], and has since been used for specifying the syntax of other programming languages. &lt;br /&gt;
&lt;br /&gt;
==Example of a very simple generative grammar==&lt;br /&gt;
This very simple example can handle only a tiny subset of English and should not be taken seriously as a guide to English grammar or vocabulary. It is based on an example by David Crystal&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite book &lt;br /&gt;
| last = Crystal &lt;br /&gt;
| first = David  &lt;br /&gt;
| title = The Cambridge Encyclopedia of Language &lt;br /&gt;
| publisher = Cambridge University Press &lt;br /&gt;
| year = 1987 &lt;br /&gt;
| isbn = 0-521-42443-7&lt;br /&gt;
| pages = page 97&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; and is a slight extension of an example on slide 9 of this lecture.&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.cs.princeton.edu/~rywang/99f126/slides/16th.pdf&lt;br /&gt;
| title = Lecture notes: Formal Languages&lt;br /&gt;
| accessdate = 2012-04-07}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase''         # A ''Sentence'' consists of a ''NounPhrase'' followed by a ''VerbPhrase''&lt;br /&gt;
 ''NounPhrase'' -&amp;gt;  ''Determiner'' ''Noun''               # A ''NounPhrase'' consists of a ''Determiner'' followed by a ''Noun''&lt;br /&gt;
 ''VerbPhrase'' -&amp;gt;  ''Verb'' ''NounPhrase''               # A ''VerbPhrase'' consists of a ''Verb'' followed by a ''NounPhrase''&lt;br /&gt;
 ''Determiner'' -&amp;gt;  '''a''', '''the'''                        # A ''Determiner''  is one of: '''a''' or '''the'''&lt;br /&gt;
 ''Noun''       -&amp;gt;  '''boy''', '''girl''', '''dog'''                # A ''Noun'' is one of: '''boy''' or '''girl''' or '''dog'''  &lt;br /&gt;
 ''Verb''       -&amp;gt;  '''chased''', '''heard''', '''saw'''            # A ''Verb'' is one of: '''chased''' or '''heard''' or '''saw'''&lt;br /&gt;
&lt;br /&gt;
Notation used above: &lt;br /&gt;
:The symbol &amp;quot;-&amp;gt;&amp;quot; means &amp;quot;can be replaced by&amp;quot;.  &lt;br /&gt;
:When there are several items on the right hand side separated by commas, just one of these items can be selected. &lt;br /&gt;
:The comments preceded by &amp;quot;#&amp;quot; are not part of the generative grammar, but hopefully will help folks understand the example a little better.&lt;br /&gt;
&lt;br /&gt;
By making appropriate substitutions we can generate such sentences as:&lt;br /&gt;
:The dog chased a girl.&lt;br /&gt;
:The girl heard the dog.&lt;br /&gt;
:The boy saw a girl.&lt;br /&gt;
&lt;br /&gt;
The stages in the generation of these examples are as follows:&lt;br /&gt;
:''Sentence''&lt;br /&gt;
:-&amp;gt; ''NounPhrase'' ''VerbPhrase''&lt;br /&gt;
:-&amp;gt; ''Determiner'' ''Noun'' ''Verb'' ''NounPhrase''&lt;br /&gt;
:-&amp;gt; ''Determiner'' ''Noun'' ''Verb'' ''Determiner'' ''Noun''&lt;br /&gt;
&lt;br /&gt;
By appropriate selection of words to substitute for ''Determiner'', ''Noun'', and ''Verb'' we can produce the 3 example sentences above.&lt;br /&gt;
&lt;br /&gt;
The simple grammar defines a few words which can be substituted for ''Determiner'', ''Noun'', and ''Verb''. There are two possibilities for ''Determiner'', three for ''Noun'', and three for ''Verb'', with both ''Determiner'' and ''Noun'' appearing twice in the expansion. Hence the total number of grammatical sentences which can be generated by this simple grammar is 108 (= 2 * 3 * 3 * 2 * 3). In this particular case the possible words have been carefully chosen so that all of these 108 sentences also actually mean something.&lt;br /&gt;
&lt;br /&gt;
Note that the use of ''italics'' and '''boldface''' in this example is merely a convenient way of indicating the difference between items which can be expanded further (e.g. concepts such as ''NounPhrase'') and items which can not be expanded further (e.g. words such as '''girl'''). In the linguistic literature, items which can be expanded further are referred to as 'non-terminal' items, while items which can't be expanded further are known as 'terminal' items.&lt;br /&gt;
&lt;br /&gt;
The 'comma' notation for alternatives is a form of shorthand. In some formulations this would be shown as several separate rules, so that:&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''a''', '''the''' &lt;br /&gt;
could be shown as two rules:&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''a'''&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''the''' &lt;br /&gt;
&lt;br /&gt;
==Caution==&lt;br /&gt;
While a generative grammar may produce sentences which are grammatically correct, there is no certainty that such sentences will actually mean anything. The classic example of such a meaningless sentence is from Chomsky's book&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite book &lt;br /&gt;
| last = Chomsky &lt;br /&gt;
| first = Noam &lt;br /&gt;
| title = Syntactic Structures &lt;br /&gt;
| year = 1957 &lt;br /&gt;
| publisher = Mouton &lt;br /&gt;
| location = The Hague/Paris &lt;br /&gt;
| pages = page 15 &lt;br /&gt;
| isbn = 3-11-017279-8&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; with the grammatically correct sentence:&lt;br /&gt;
&lt;br /&gt;
:&amp;quot;Colorless green ideas sleep furiously.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
:This example illustrates the difference between grammar/syntax and meaning/semantics.&lt;br /&gt;
&lt;br /&gt;
Another problem when analysing a sentence is that many English words have multiple meanings, so that there may be more than one way to interpret a sentence. A simple example is the sentence: &lt;br /&gt;
:&amp;quot;Time flies.&amp;quot; &lt;br /&gt;
:Is this an instruction to check how fast flies are flying, or an indication that time appears to be passing quickly? &lt;br /&gt;
:A varied and entertaining selection of such ambiguities has been compiled by Jeff Gray.&amp;lt;ref&amp;gt;{{Cite web &lt;br /&gt;
| title = Collection of Ambiguous or Inconsistent/Incomplete Statements  &lt;br /&gt;
| url = http://www.gray-area.org/Research/Ambig/ &lt;br /&gt;
| author = Jeff Gray&lt;br /&gt;
| accessdate = 2012-04-10&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Formal grammar==&lt;br /&gt;
'''Note''': this section and subsequent sections are, by necessity, slightly more technical/formal than the earlier parts of this article, though specialist notation and abbreviations have been largely avoided. Make sure that you understand the 'Simple example' above before proceeding further, since references will be made to that example to help explain the technicalities, and variations on that example will be used to illustrate new ideas. &lt;br /&gt;
&lt;br /&gt;
A formal generative grammar has four components (see slide 19 of this lecture&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://adammikeal.org/courses/compute/Chomsky%20Presentation.pdf&lt;br /&gt;
| title = The Chomsky Hierarchy&lt;br /&gt;
| accessdate = 2012-04-06&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
):&lt;br /&gt;
# a finite number of non-terminal concepts (e.g. ''VerbPhrase'' in the example, or anything else in ''italics''),&lt;br /&gt;
# a finite number of terminal items (e.g. '''girl''' in the example, or anything else in '''bold-face''').&lt;br /&gt;
# a finite set of rules for transforming non-terminal items (e.g. the example has 6 rules).&lt;br /&gt;
# a single starting point (e.g. ''Sentence'' in the example).&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
:Terminal items are those which can not be transformed into anything else.&lt;br /&gt;
:A list of all the terminal items is effectively the vocabulary from which sentences are built.&lt;br /&gt;
:Non-terminal items are those which can be transformed into something else.&lt;br /&gt;
:Linguists have developed various classes of grammars by using constraints to govern what sort of rules can be used for any particular grammar.&lt;br /&gt;
&lt;br /&gt;
===Changing the rules===&lt;br /&gt;
An relatively small change to even a single rule can make a large change in the language which can be generated. For example, change the first rule in the simple example to read:&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''NounPhrase'' ''VerbPhrase'' '''and''' ''NounPhrase'' ''VerbPhrase''&lt;br /&gt;
This means that a ''Sentence'' is either a ''NounPhrase'' followed by a ''VerbPhrase'' or a ''NounPhrase'' followed by a ''VerbPhrase'' followed by '''and''' followed by a ''NounPhrase'' followed by a ''VerbPhrase''. In addition to the shorter sentences already discussed, this could also generate a sentence such as: &amp;quot;A dog saw a girl and the dog chased the girl&amp;quot;. The total number of grammatically-correct sentences which can be generated by this modified grammar is now 11,772 (108 + 108*108), though some of these may not be very meaingful.&lt;br /&gt;
&lt;br /&gt;
===Towards infinity===&lt;br /&gt;
A significantly different rule change can have an astounding effect. Consider changing the first rule to read:&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''NounPhrase'' ''VerbPhrase'' '''and''' ''Sentence''&lt;br /&gt;
This can generate a potentially infinite number of sentences (any number of these five-word sentences linked by '''and'''). This is an example of what is known as a [[Recursion|recursive]] definition, whereby a ''Sentence'' is partially defined in terms of itself. In such a recursive rule there must be at least one transformation option which does not involve ''Sentence'', otherwise the transformation could never stop.&lt;br /&gt;
&lt;br /&gt;
The above change is known as right-recursive; a left-recursive formulation is also possible, and can in this example generate exactly the same sentences. As shown below  under 'Context-free grammar', there are situations where the choice of left- or right-recursive formulations can change the meaning. &lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''Sentence'' '''and''' ''NounPhrase'' ''VerbPhrase'' &lt;br /&gt;
&lt;br /&gt;
The distinction between left- and right-recursive grammars becomes important when trying to parse/analyse a sentence; some types of parser work best with left-recursive grammars, while other types work best with right-recursive grammars. This distinction is particularly relevant in connection with [[compiler|compiling or translating]] a program written in some high-level [[programming language]] so that it can be used on a [[computer]].&lt;br /&gt;
&lt;br /&gt;
==Chomsky hierarchy==&lt;br /&gt;
By imposing different constraints&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.cs.uaf.edu/2011/spring/cs331/lectures/cs331_20110124_grammar.html&lt;br /&gt;
| title = Lecture notes: Languages &amp;amp; Grammars&lt;br /&gt;
| accessdate = 2012-04-07&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; &lt;br /&gt;
as to what sort of transformation rules could be used, Chomsky was able to define four strictly nested transformational grammars, which he numbered from 0 to 3. As the grammar number increases, the generated language becomes simpler. As the grammar number decreases, parsing a sentence in that language becomes more difficult.&lt;br /&gt;
Other linguists have described formal grammars which fit in between the various Chomsky levels. This lecture&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.google.co.uk/url?sa=t&amp;amp;rct=j&amp;amp;q=recursively+enumerable+languages+examples&amp;amp;source=web&amp;amp;cd=4&amp;amp;ved=0CF4QFjAD&amp;amp;url=http%3A%2F%2Fwww.cs.colostate.edu%2F~massey%2FTeaching%2Fcs301%2FRestrictedAccess%2FSlides%2F301lecture23.pdf&amp;amp;ei=6qelT4KMA6SA0AXIu7CQBA&amp;amp;usg=AFQjCNG3fc1mD7g5f-14vfDPdvyX2uScDg&lt;br /&gt;
| title = Recursive and Recursively Enumerable Languages&lt;br /&gt;
| accessdate = 2012-05-05&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
shows that there exist languages which can not be described by any set of rules.&lt;br /&gt;
&lt;br /&gt;
The following table provides a summary, which is then explained further in the subsequent subsections.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!| Chomsky&amp;lt;br&amp;gt;number || linguistic name || Rule constraints || Recogniser+ || Notes &lt;br /&gt;
|-&lt;br /&gt;
| 0 || recursively enumerable || [anything] -&amp;gt; [anything] || Turing machine || most human languages &lt;br /&gt;
|-&lt;br /&gt;
| 1 || context-sensitive || X ''A'' Y -&amp;gt; X [anything] Y || linear bounded automaton || X and Y provide the context in which ''A'' can be transformed &lt;br /&gt;
|-&lt;br /&gt;
| 2 || context-free || ''A'' -&amp;gt; [anything] || non-deterministic push-down automaton || syntax analysis for most programming languages &lt;br /&gt;
|-&lt;br /&gt;
| 3 || regular || ''A'' -&amp;gt; [nothing]&amp;lt;br&amp;gt;''A'' -&amp;gt; '''xyz'''&amp;lt;br&amp;gt;''A'' -&amp;gt; '''xyz''' ''B'' || finite automaton&amp;lt;br&amp;gt;or finite state machine || lexical analysis (combining characters into words/tokens)  &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''+''' The '''recogniser''' column indicates the type of mathematical or computer science theoretical model needed to recognise that a sentence belongs to a language, essentially by applying the transformation rules in reverse to work backwards from the actual words in order to finish up with a ''sentence'' (in programming languages the starting concept is usually a ''program''). A finite automaton uses only a small fixed amount of memory, operates in time proportional to the length of the input, and always reaches a decision, while a Turing machine may use an infinite amount of memory and time and may fail to reach a decision (may never stop).&lt;br /&gt;
&lt;br /&gt;
In the linguistic literature, [nothing] is often represented by the symbol '''ε'''.&lt;br /&gt;
&lt;br /&gt;
The descriptions of the various Chomsky levels which follow are presented in reverse order, so as to work up from a simple case to a rather complicated case.&lt;br /&gt;
&lt;br /&gt;
===Level 3: regular grammar===&lt;br /&gt;
The transformation rules for regular grammars are required to be very simple. &lt;br /&gt;
*Only a single non-terminal item can appear on the left-hand side of a rule.&lt;br /&gt;
*The right-hand side of any rule must be one of:&lt;br /&gt;
**[nothing].&lt;br /&gt;
**a terminal item.&lt;br /&gt;
**a terminal item followed by a non-terminal item.&lt;br /&gt;
Note that instead of a terminal item we could have a non-terminal item whose transformation rule immediately resolves to a single terminal item, or to one of several terminal items.&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
Informally we can define a 'word' as a sequence of one or more ''Letter''s. The following regular grammar provides a more formal definition; for simplicity it is restricted to lower-case letters.&lt;br /&gt;
&lt;br /&gt;
 ''Word''     -&amp;gt; ''Letter'' ''PartWord''&lt;br /&gt;
 ''PartWord'' -&amp;gt; [nothing]&lt;br /&gt;
 ''PartWord'' -&amp;gt; ''Letter'' ''PartWord''&lt;br /&gt;
 ''Letter''   -&amp;gt; '''a''', '''b''', ... '''z'''&lt;br /&gt;
&lt;br /&gt;
Note that ''PartWord'' is recursively defined, with the recursion stopping if it is transformed into [nothing].&lt;br /&gt;
&lt;br /&gt;
For one-letter words we expand as: &lt;br /&gt;
:''Word'' -&amp;gt; ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' [nothing] -&amp;gt; ''Letter''&lt;br /&gt;
&lt;br /&gt;
For two-letter words we expand as: &lt;br /&gt;
:''Word'' -&amp;gt; ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' ''Letter'' [nothing] -&amp;gt;  ''Letter'' ''Letter''&lt;br /&gt;
&lt;br /&gt;
Obviously, words of any length can be constructed, though they may well not actually be words from any language. &lt;br /&gt;
&lt;br /&gt;
====Discussion====&lt;br /&gt;
Trying to devise transformation rules to produce words which are more English-like is much more difficult - how do you insist on at least one vowel or on no more than 5 consecutive consonants (e.g. as in 'strengths').&lt;br /&gt;
&lt;br /&gt;
Further examples in [[Regular grammar]] show how numbers can be defined via a regular grammar, and also show how a hyphenated word could be defined.&lt;br /&gt;
&lt;br /&gt;
One of the limitations of a regular grammar is that it can't cope with nested matching brackets, so that it is impossible to write a regular grammar to describe an expression such as '''2 * (3+4)''' where that grammar is expected to allow brackets nested to any depth. A context-free grammar is needed for this, as described in the next section.&lt;br /&gt;
&lt;br /&gt;
Regular grammars or equivalent are widely used by [[compiler]]s in the lexical analysis of programming languages.&lt;br /&gt;
&lt;br /&gt;
===Level 2: context-free grammar===&lt;br /&gt;
The transformation rules for context-free grammars don't appear that much different from those for regular grammars. &lt;br /&gt;
*Only a single non-terminal item can appear on the left-hand side of a rule.&lt;br /&gt;
*The right-hand side of any rule must be one of:&lt;br /&gt;
**[nothing].&lt;br /&gt;
**any combination of terminal items and non-terminal items.&lt;br /&gt;
&lt;br /&gt;
The key difference is that in a regular grammar, any non-empty rule must effectively start with terminal item so that every rule transformation makes some immediate progress, while in a context-free grammar a rule could start with a non-terminal item which itself could be subject to arbitrary further transformations.&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
The following example shows how context-free grammars can cope with arithmetic expressions involving possibly nested brackets. Also an expression such as &amp;quot;2 + 3 * 4&amp;quot; could be interpreted as either &amp;quot;(2 + 3) * 4&amp;quot; = 20 or as &amp;quot;2 + (3 * 4)&amp;quot; = 14. The latter interpretation is that which is normally used - multiplication &amp;quot;*&amp;quot; is said to have a higher priority than addition &amp;quot;+&amp;quot; - so the grammar must incorporate this priority concept. Furthermore, consecutive operators of the same priority are normally applied from left to right, so that &amp;quot;8 - 2 + 3&amp;quot; is interpreted as &amp;quot;(8 - 2) + 3&amp;quot; = 9, rather than as &amp;quot;8 - (2 + 3)&amp;quot; = 3.  This ordering must also be built in to the grammar.&lt;br /&gt;
&lt;br /&gt;
To avoid distracting side-issues, this example only deals with numbers which consist solely of a single digit. The example is a simplified version of the definition of an arithmetic expression given in the Revised Algol 60 Report (Section 3.3.1).&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.masswerk.at/algol60/report.htm&lt;br /&gt;
| title = Revised Report on the Algorithmic Language Algol 60&lt;br /&gt;
| accessdate = 2012-04-22&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ''Expression'' -&amp;gt; ''Term''                        # an ''Expression'' is either a ''Term''&lt;br /&gt;
 ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''    #   or an ''Expression'' followed by '''+''' or '''-''' followed by a ''Term''&lt;br /&gt;
 ''Term''       -&amp;gt; ''Primary''                     # a ''Term'' is either a ''Primary''&lt;br /&gt;
 ''Term''       -&amp;gt; ''Term'' ''MulDivOp'' ''Primary''       #   or a ''Term'' followed by '''*''' or '''/''' followed by a ''Primary''&lt;br /&gt;
                                           #&lt;br /&gt;
 ''Primary''    -&amp;gt; ''Number''                      # a ''Primary'' is either a ''Number''&lt;br /&gt;
 ''Primary''    -&amp;gt; '''(''' ''Expression'' ''')'''              #   or an ''Expression'' enclosed in brackets&lt;br /&gt;
                                           #&lt;br /&gt;
 ''MulDivOp''   -&amp;gt; '''*'''. '''/'''                        # multiplication and division have the same priority&lt;br /&gt;
 ''AddSubOp''   -&amp;gt; '''+'''. '''-'''                        # addition and subtraction have the same priority&lt;br /&gt;
 ''Number''     -&amp;gt; '''0''', '''1''', ... '''9'''                 # this simple-minded definition of a ''Number'' is enough for this example&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
* Both ''Expression'' and ''Term'' are each defined via a left-recursive rule; this ensures that operators of the same priority are applied from left to right.&lt;br /&gt;
* The distinction between ''Expression'' and ''Term'' ensures that multiplication/division are applied before addition/subtraction.&lt;br /&gt;
* ''Expression'' is indirectly recursive via ''Term'' and ''Primary'' to allow bracketed sub-expressions to any depth.&lt;br /&gt;
&lt;br /&gt;
Example 1: generate 2 + 3 * 4&lt;br /&gt;
&lt;br /&gt;
  ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Term'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Primary'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' ''Term''                                 # '''+''' can not be applied until ''Term'' has been evaluated&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' ''Term'' ''MulDivOp'' ''Primary''&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' ''Primary'' ''MulDipOp'' ''Primary''&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' '''3''' '''*''' '''4'''&lt;br /&gt;
&lt;br /&gt;
Example 2: generate 2 * 3 + 4&lt;br /&gt;
&lt;br /&gt;
  ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Term'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Term'' ''MulDivOp'' ''Primary'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Primary'' ''MulDivOp'' ''Primary'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; '''2''' '''*''' '''3''' ''AddSubOp'' ''Term''                      # ''Term'' to left of ''AddSubOp'' is evaluated first&lt;br /&gt;
             -&amp;gt; '''2''' '''*''' '''3''' ''AddSubOp'' ''Primary''  &lt;br /&gt;
             -&amp;gt; '''2''' '''*''' '''3''' '''+''' '''4'''&lt;br /&gt;
&lt;br /&gt;
====Discussion====&lt;br /&gt;
Context-free grammars (or equivalent definitions using Backus-Naur-Form) are widely used both to define the syntax of programming languages and to (semi-automatically) generate parsers for these languages.&lt;br /&gt;
&lt;br /&gt;
A limitation/feature of both regular grammars and context-free grammars is that the left-hand side of any rule is always a single non-terminal item, so any transformation is applied regardless of the context in which that non-terminal item appears.  A simple example which depends on context is the use of singular and plural nouns and verbs in English.  We say: '''the man runs''' or '''the men run''', but neither of '''the man run''' nor '''the men runs'''.  Which form of verb to use depends on the noun, i.e. there is a context dependency.&lt;br /&gt;
&lt;br /&gt;
===Level 1: context-sensitive grammar===&lt;br /&gt;
For context-sensitive grammars the left-hand side of a rule may indicate the context in which that rule applies, so that the same non-terminal item may be transformed in different ways depending on the context in which it appears.&lt;br /&gt;
&lt;br /&gt;
There is only one transformation rule for context-sensitive grammars:&lt;br /&gt;
&lt;br /&gt;
 X [non-terminal] Y -&amp;gt; X [anything] Y&lt;br /&gt;
&lt;br /&gt;
where X and Y determine the context in which the [non-terminal] is transformed. Note that X and Y may each be terminals or non-terminals or [nothing]. When both X and Y are nothing there is no context and this reduces to a Level 2 or Level 3 grammar.&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
Taylor has provided several examples&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.divms.uiowa.edu/~fleck/taylor.pdf&lt;br /&gt;
| title = Context-sensitive Examples&lt;br /&gt;
| author = Taylor&lt;br /&gt;
| accessdate = 2012-04-26&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
and the following, inspired by his third example, is an extension of the original simple example above to handle singulars and plurals:&lt;br /&gt;
&lt;br /&gt;
 ''Sentence''                -&amp;gt;  ''NounPhrase'' ''VerbPhrase''            # simple sentence structure&lt;br /&gt;
 ''NounPhrase''              -&amp;gt;  ''Determiner'' ''Noun''                  # simple phrase structure&lt;br /&gt;
 ''VerbPhrase''              -&amp;gt;  ''Verb'' ''NounPhrase''                  # simple phrase structure&lt;br /&gt;
                                                              #&lt;br /&gt;
 ''Noun''                    -&amp;gt;  ''SingularNoun'', ''PluralNoun''         # nouns can be singular or plural &lt;br /&gt;
                                                              #&lt;br /&gt;
 ''Determiner'' ''SingularNoun'' -&amp;gt;  ''SingularDeterminer'' ''SingularNoun''  # context-sensitive:&lt;br /&gt;
 ''Determiner'' ''PluralNoun''   -&amp;gt;  ''PluralDeterminer'' ''PluralNoun''      #    determiner must agree with noun&lt;br /&gt;
                                                              #&lt;br /&gt;
 ''SingularNoun'' ''Verb''       -&amp;gt;  ''SingularNoun'' ''SingularVerb''        # context-sensitive: &lt;br /&gt;
 ''PluralNoun'' ''Verb''         -&amp;gt;  ''PluralNoun'' ''PluralVerb''            #    verb must agree with noun&lt;br /&gt;
                                                              #&lt;br /&gt;
 ''SingularDeterminer''      -&amp;gt;  '''a''', '''the'''                           # singular determiners&lt;br /&gt;
 ''PluralDeterminer''        -&amp;gt;  '''the'''                              # plural determiners&lt;br /&gt;
                                                              #&lt;br /&gt;
 ''SingularNoun''            -&amp;gt;  '''boy''', '''sheep''', '''dog'''                  # singular nouns&lt;br /&gt;
 ''PluralNoun''              -&amp;gt;  '''boys''', '''sheep''', '''dogs'''                # plural nouns&lt;br /&gt;
                                                              #&lt;br /&gt;
 ''SingularVerb''            -&amp;gt;  '''chases''', '''hears''', '''sees'''              # singular verbs&lt;br /&gt;
 ''PluralVerb''              -&amp;gt;  '''chase''', '''hear''', '''see'''                 # plural verbs&lt;br /&gt;
&lt;br /&gt;
The above grammar can generate sentences such as: '''a boy chases a dog''', '''the boys chase a dog''', etc. Because some words have the same form in both singular and plural, it can also generate meaningful (and grammatically-correct) sentences such as: '''the sheep sees the dog''', '''the sheep see the dog'''.&lt;br /&gt;
&lt;br /&gt;
But the above grammar can NOT generate sentences such as: '''a boys chases the sheep''', since this would violate the context-sensitive rules.&lt;br /&gt;
&lt;br /&gt;
====Discussion====&lt;br /&gt;
It is in fact possible to handle singular/plural issues by using only a Level 2 context-free grammar, but the above rules expressed as a Level 1 context-sensitive grammar are a closer match to ordinary concepts of English grammar (e.g. nouns and verbs must agree in number i.e. singular/plural).&lt;br /&gt;
&lt;br /&gt;
===Level 0: recursively enumerable grammar===&lt;br /&gt;
A recursively enumerable grammar has absolutely no restriction on what sort of transformation rules can be applied. Rules take the general form:&lt;br /&gt;
&lt;br /&gt;
 [anything] -&amp;gt; [anything]&lt;br /&gt;
&lt;br /&gt;
===Beyond Level 0===&lt;br /&gt;
These lecture notes&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.google.co.uk/url?sa=t&amp;amp;rct=j&amp;amp;q=recursively+enumerable+languages+examples&amp;amp;source=web&amp;amp;cd=4&amp;amp;ved=0CF4QFjAD&amp;amp;url=http%3A%2F%2Fwww.cs.colostate.edu%2F~massey%2FTeaching%2Fcs301%2FRestrictedAccess%2FSlides%2F301lecture23.pdf&amp;amp;ei=6qelT4KMA6SA0AXIu7CQBA&amp;amp;usg=AFQjCNG3fc1mD7g5f-14vfDPdvyX2uScDg&lt;br /&gt;
| title = Recursive and Recursively Enumerable Languages&lt;br /&gt;
| accessdate = 2012-05-05&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
show that languages exist which can not be described by any set of rules.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[category:linguistics]]&lt;br /&gt;
[[Category:Computer Science]]&lt;/div&gt;</summary>
		<author><name>RolandPlankton</name></author>
	</entry>
	<entry>
		<id>https://www.conservapedia.com/index.php?title=Chomsky_hierarchy&amp;diff=980171</id>
		<title>Chomsky hierarchy</title>
		<link rel="alternate" type="text/html" href="https://www.conservapedia.com/index.php?title=Chomsky_hierarchy&amp;diff=980171"/>
		<updated>2012-05-07T23:12:26Z</updated>

		<summary type="html">&lt;p&gt;RolandPlankton: /* Level 0 */ basic definition&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The '''Chomsky hierarchy''', sometimes known as the '''Chomsky-Schützenberger hierarchy''', is a hierarchy of formal grammatical systems for describing various classes of languages; the hierarchy can apply to both human and computer languages. This hierarchy was first published in 1956 by [[Noam Chomsky|Chomsky]].&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite journal &lt;br /&gt;
| title = Three models for the description of language &lt;br /&gt;
| year = 1956 &lt;br /&gt;
| last = Chomsky &lt;br /&gt;
| first = Noam &lt;br /&gt;
| journal = IRE Transactions on Information Theory &lt;br /&gt;
| volume = 2 &lt;br /&gt;
| pages = 113–124 &lt;br /&gt;
| url = http://www.chomsky.info/articles/195609--.pdf &lt;br /&gt;
| accessdate = 2012-04-08&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
These grammatical systems were referred to by Chomsky as ''transformational grammars''.  Other linguists have since developed a variety of similar grammars; together these are known as ''generative grammars''. &lt;br /&gt;
&lt;br /&gt;
The basic idea of a '''generative grammar''' is to provide a set of rules which are capable of generating all possible grammatical sentences in some language; the rules must constrain the generation so that only grammatical sentences are generated. The rules can also be used in reverse to parse a sentence and check if it is grammatical.&lt;br /&gt;
&lt;br /&gt;
In the late 1950's, [[John Backus]] and Peter Naur developed a notation for describing [[programming language]]s. This notation is known as [[Backus Naur Form]] (or BNF) and turns out to be equivalent to Chomsky's grammar number two (context-free grammar), although it was developed independently of Chomsky's work. Backus-Naur Form was first used in the Algol 60 Report to specify the syntax of [[Algol 60]], and has since been used for specifying the syntax of other programming languages. &lt;br /&gt;
&lt;br /&gt;
==Example of a very simple generative grammar==&lt;br /&gt;
This very simple example can handle only a tiny subset of English and should not be taken seriously as a guide to English grammar or vocabulary. It is based on an example by David Crystal&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite book &lt;br /&gt;
| last = Crystal &lt;br /&gt;
| first = David  &lt;br /&gt;
| title = The Cambridge Encyclopedia of Language &lt;br /&gt;
| publisher = Cambridge University Press &lt;br /&gt;
| year = 1987 &lt;br /&gt;
| isbn = 0-521-42443-7&lt;br /&gt;
| pages = page 97&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; and is a slight extension of an example on slide 9 of this lecture.&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.cs.princeton.edu/~rywang/99f126/slides/16th.pdf&lt;br /&gt;
| title = Lecture notes: Formal Languages&lt;br /&gt;
| accessdate = 2012-04-07}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase''         # A ''Sentence'' consists of a ''NounPhrase'' followed by a ''VerbPhrase''&lt;br /&gt;
 ''NounPhrase'' -&amp;gt;  ''Determiner'' ''Noun''               # A ''NounPhrase'' consists of a ''Determiner'' followed by a ''Noun''&lt;br /&gt;
 ''VerbPhrase'' -&amp;gt;  ''Verb'' ''NounPhrase''               # A ''VerbPhrase'' consists of a ''Verb'' followed by a ''NounPhrase''&lt;br /&gt;
 ''Determiner'' -&amp;gt;  '''a''', '''the'''                        # A ''Determiner''  is one of: '''a''' or '''the'''&lt;br /&gt;
 ''Noun''       -&amp;gt;  '''boy''', '''girl''', '''dog'''                # A ''Noun'' is one of: '''boy''' or '''girl''' or '''dog'''  &lt;br /&gt;
 ''Verb''       -&amp;gt;  '''chased''', '''heard''', '''saw'''            # A ''Verb'' is one of: '''chased''' or '''heard''' or '''saw'''&lt;br /&gt;
&lt;br /&gt;
Notation used above: &lt;br /&gt;
:The symbol &amp;quot;-&amp;gt;&amp;quot; means &amp;quot;can be replaced by&amp;quot;.  &lt;br /&gt;
:When there are several items on the right hand side separated by commas, just one of these items can be selected. &lt;br /&gt;
:The comments preceded by &amp;quot;#&amp;quot; are not part of the generative grammar, but hopefully will help folks understand the example a little better.&lt;br /&gt;
&lt;br /&gt;
By making appropriate substitutions we can generate such sentences as:&lt;br /&gt;
:The dog chased a girl.&lt;br /&gt;
:The girl heard the dog.&lt;br /&gt;
:The boy saw a girl.&lt;br /&gt;
&lt;br /&gt;
The stages in the generation of these examples are as follows:&lt;br /&gt;
:''Sentence''&lt;br /&gt;
:-&amp;gt; ''NounPhrase'' ''VerbPhrase''&lt;br /&gt;
:-&amp;gt; ''Determiner'' ''Noun'' ''Verb'' ''NounPhrase''&lt;br /&gt;
:-&amp;gt; ''Determiner'' ''Noun'' ''Verb'' ''Determiner'' ''Noun''&lt;br /&gt;
&lt;br /&gt;
By appropriate selection of words to substitute for ''Determiner'', ''Noun'', and ''Verb'' we can produce the 3 example sentences above.&lt;br /&gt;
&lt;br /&gt;
The simple grammar defines a few words which can be substituted for ''Determiner'', ''Noun'', and ''Verb''. There are two possibilities for ''Determiner'', three for ''Noun'', and three for ''Verb'', with both ''Determiner'' and ''Noun'' appearing twice in the expansion. Hence the total number of grammatical sentences which can be generated by this simple grammar is 108 (= 2 * 3 * 3 * 2 * 3). In this particular case the possible words have been carefully chosen so that all of these 108 sentences also actually mean something.&lt;br /&gt;
&lt;br /&gt;
Note that the use of ''italics'' and '''boldface''' in this example is merely a convenient way of indicating the difference between items which can be expanded further (e.g. concepts such as ''NounPhrase'') and items which can not be expanded further (e.g. words such as '''girl'''). In the linguistic literature, items which can be expanded further are referred to as 'non-terminal' items, while items which can't be expanded further are known as 'terminal' items.&lt;br /&gt;
&lt;br /&gt;
The 'comma' notation for alternatives is a form of shorthand. In some formulations this would be shown as several separate rules, so that:&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''a''', '''the''' &lt;br /&gt;
could be shown as two rules:&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''a'''&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''the''' &lt;br /&gt;
&lt;br /&gt;
==Caution==&lt;br /&gt;
While a generative grammar may produce sentences which are grammatically correct, there is no certainty that such sentences will actually mean anything. The classic example of such a meaningless sentence is from Chomsky's book&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite book &lt;br /&gt;
| last = Chomsky &lt;br /&gt;
| first = Noam &lt;br /&gt;
| title = Syntactic Structures &lt;br /&gt;
| year = 1957 &lt;br /&gt;
| publisher = Mouton &lt;br /&gt;
| location = The Hague/Paris &lt;br /&gt;
| pages = page 15 &lt;br /&gt;
| isbn = 3-11-017279-8&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; with the grammatically correct sentence:&lt;br /&gt;
&lt;br /&gt;
:&amp;quot;Colorless green ideas sleep furiously.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
:This example illustrates the difference between grammar/syntax and meaning/semantics.&lt;br /&gt;
&lt;br /&gt;
Another problem when analysing a sentence is that many English words have multiple meanings, so that there may be more than one way to interpret a sentence. A simple example is the sentence: &lt;br /&gt;
:&amp;quot;Time flies.&amp;quot; &lt;br /&gt;
:Is this an instruction to check how fast flies are flying, or an indication that time appears to be passing quickly? &lt;br /&gt;
:A varied and entertaining selection of such ambiguities has been compiled by Jeff Gray.&amp;lt;ref&amp;gt;{{Cite web &lt;br /&gt;
| title = Collection of Ambiguous or Inconsistent/Incomplete Statements  &lt;br /&gt;
| url = http://www.gray-area.org/Research/Ambig/ &lt;br /&gt;
| author = Jeff Gray&lt;br /&gt;
| accessdate = 2012-04-10&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Formal grammar==&lt;br /&gt;
'''Note''': this section and subsequent sections are, by necessity, slightly more technical/formal than the earlier parts of this article, though specialist notation and abbreviations have been largely avoided. Make sure that you understand the 'Simple example' above before proceeding further, since references will be made to that example to help explain the technicalities, and variations on that example will be used to illustrate new ideas. &lt;br /&gt;
&lt;br /&gt;
A formal generative grammar has four components (see slide 19 of this lecture&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://adammikeal.org/courses/compute/Chomsky%20Presentation.pdf&lt;br /&gt;
| title = The Chomsky Hierarchy&lt;br /&gt;
| accessdate = 2012-04-06&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
):&lt;br /&gt;
# a finite number of non-terminal concepts (e.g. ''VerbPhrase'' in the example, or anything else in ''italics''),&lt;br /&gt;
# a finite number of terminal items (e.g. '''girl''' in the example, or anything else in '''bold-face''').&lt;br /&gt;
# a finite set of rules for transforming non-terminal items (e.g. the example has 6 rules).&lt;br /&gt;
# a single starting point (e.g. ''Sentence'' in the example).&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
:Terminal items are those which can not be transformed into anything else.&lt;br /&gt;
:A list of all the terminal items is effectively the vocabulary from which sentences are built.&lt;br /&gt;
:Non-terminal items are those which can be transformed into something else.&lt;br /&gt;
:Linguists have developed various classes of grammars by using constraints to govern what sort of rules can be used for any particular grammar.&lt;br /&gt;
&lt;br /&gt;
===Changing the rules===&lt;br /&gt;
An relatively small change to even a single rule can make a large change in the language which can be generated. For example, change the first rule in the simple example to read:&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''NounPhrase'' ''VerbPhrase'' '''and''' ''NounPhrase'' ''VerbPhrase''&lt;br /&gt;
This means that a ''Sentence'' is either a ''NounPhrase'' followed by a ''VerbPhrase'' or a ''NounPhrase'' followed by a ''VerbPhrase'' followed by '''and''' followed by a ''NounPhrase'' followed by a ''VerbPhrase''. In addition to the shorter sentences already discussed, this could also generate a sentence such as: &amp;quot;A dog saw a girl and the dog chased the girl&amp;quot;. The total number of grammatically-correct sentences which can be generated by this modified grammar is now 11,772 (108 + 108*108), though some of these may not be very meaingful.&lt;br /&gt;
&lt;br /&gt;
===Towards infinity===&lt;br /&gt;
A significantly different rule change can have an astounding effect. Consider changing the first rule to read:&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''NounPhrase'' ''VerbPhrase'' '''and''' ''Sentence''&lt;br /&gt;
This can generate a potentially infinite number of sentences (any number of these five-word sentences linked by '''and'''). This is an example of what is known as a [[Recursion|recursive]] definition, whereby a ''Sentence'' is partially defined in terms of itself. In such a recursive rule there must be at least one transformation option which does not involve ''Sentence'', otherwise the transformation could never stop.&lt;br /&gt;
&lt;br /&gt;
The above change is known as right-recursive; a left-recursive formulation is also possible, and can in this example generate exactly the same sentences. As shown below  under 'Context-free grammar', there are situations where the choice of left- or right-recursive formulations can change the meaning. &lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''Sentence'' '''and''' ''NounPhrase'' ''VerbPhrase'' &lt;br /&gt;
&lt;br /&gt;
The distinction between left- and right-recursive grammars becomes important when trying to parse/analyse a sentence; some types of parser work best with left-recursive grammars, while other types work best with right-recursive grammars. This distinction is particularly relevant in connection with [[compiler|compiling or translating]] a program written in some high-level [[programming language]] so that it can be used on a [[computer]].&lt;br /&gt;
&lt;br /&gt;
==Chomsky hierarchy==&lt;br /&gt;
By imposing different constraints&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.cs.uaf.edu/2011/spring/cs331/lectures/cs331_20110124_grammar.html&lt;br /&gt;
| title = Lecture notes: Languages &amp;amp; Grammars&lt;br /&gt;
| accessdate = 2012-04-07&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; &lt;br /&gt;
as to what sort of transformation rules could be used, Chomsky was able to define four strictly nested transformational grammars, which he numbered from 0 to 3. As the grammar number increases, the generated language becomes simpler. As the grammar number decreases, parsing a sentence in that language becomes more difficult.&lt;br /&gt;
Other linguists have described formal grammars which fit in between the various Chomsky levels. This lecture&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.google.co.uk/url?sa=t&amp;amp;rct=j&amp;amp;q=recursively+enumerable+languages+examples&amp;amp;source=web&amp;amp;cd=4&amp;amp;ved=0CF4QFjAD&amp;amp;url=http%3A%2F%2Fwww.cs.colostate.edu%2F~massey%2FTeaching%2Fcs301%2FRestrictedAccess%2FSlides%2F301lecture23.pdf&amp;amp;ei=6qelT4KMA6SA0AXIu7CQBA&amp;amp;usg=AFQjCNG3fc1mD7g5f-14vfDPdvyX2uScDg&lt;br /&gt;
| title = Recursive and Recursively Enumerable Languages&lt;br /&gt;
| accessdate = 2012-05-05&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
shows that there exist languages which can not be described by any set of rules.&lt;br /&gt;
&lt;br /&gt;
The following table provides a summary, which is then explained further in the subsequent subsections.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!| Chomsky&amp;lt;br&amp;gt;number || linguistic name || Rule constraints || Recogniser+ || Notes &lt;br /&gt;
|-&lt;br /&gt;
| 0 || recursively enumerable || [anything] -&amp;gt; [anything] || Turing machine || most human languages &lt;br /&gt;
|-&lt;br /&gt;
| 1 || context-sensitive || X ''A'' Y -&amp;gt; X [anything] Y || linear bounded automaton || X and Y provide the context in which ''A'' can be transformed &lt;br /&gt;
|-&lt;br /&gt;
| 2 || context-free || ''A'' -&amp;gt; [anything] || non-deterministic push-down automaton || syntax analysis for most programming languages &lt;br /&gt;
|-&lt;br /&gt;
| 3 || regular || ''A'' -&amp;gt; [nothing]&amp;lt;br&amp;gt;''A'' -&amp;gt; '''xyz'''&amp;lt;br&amp;gt;''A'' -&amp;gt; '''xyz''' ''B'' || finite automaton&amp;lt;br&amp;gt;or finite state machine || lexical analysis (combining characters into words/tokens)  &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''+''' The '''recogniser''' column indicates the type of mathematical or computer science theoretical model needed to recognise that a sentence belongs to a language, essentially by applying the transformation rules in reverse to work backwards from the actual words in order to finish up with a ''sentence'' (in programming languages the starting concept is usually a ''program''). A finite automaton uses only a small fixed amount of memory, operates in time proportional to the length of the input, and always reaches a decision, while a Turing machine may use an infinite amount of memory and time and may fail to reach a decision (may never stop).&lt;br /&gt;
&lt;br /&gt;
In the linguistic literature, [nothing] is often represented by the symbol '''ε'''.&lt;br /&gt;
&lt;br /&gt;
The descriptions of the various Chomsky levels which follow are presented in reverse order, so as to work up from a simple case to a rather complicated case.&lt;br /&gt;
&lt;br /&gt;
===Level 3: regular grammar===&lt;br /&gt;
The transformation rules for regular grammars are required to be very simple. &lt;br /&gt;
*Only a single non-terminal item can appear on the left-hand side of a rule.&lt;br /&gt;
*The right-hand side of any rule must be one of:&lt;br /&gt;
**[nothing].&lt;br /&gt;
**a terminal item.&lt;br /&gt;
**a terminal item followed by a non-terminal item.&lt;br /&gt;
Note that instead of a terminal item we could have a non-terminal item whose transformation rule immediately resolves to a single terminal item, or to one of several terminal items.&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
Informally we can define a 'word' as a sequence of one or more ''Letter''s. The following regular grammar provides a more formal definition; for simplicity it is restricted to lower-case letters.&lt;br /&gt;
&lt;br /&gt;
 ''Word''     -&amp;gt; ''Letter'' ''PartWord''&lt;br /&gt;
 ''PartWord'' -&amp;gt; [nothing]&lt;br /&gt;
 ''PartWord'' -&amp;gt; ''Letter'' ''PartWord''&lt;br /&gt;
 ''Letter''   -&amp;gt; '''a''', '''b''', ... '''z'''&lt;br /&gt;
&lt;br /&gt;
Note that ''PartWord'' is recursively defined, with the recursion stopping if it is transformed into [nothing].&lt;br /&gt;
&lt;br /&gt;
For one-letter words we expand as: &lt;br /&gt;
:''Word'' -&amp;gt; ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' [nothing] -&amp;gt; ''Letter''&lt;br /&gt;
&lt;br /&gt;
For two-letter words we expand as: &lt;br /&gt;
:''Word'' -&amp;gt; ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' ''Letter'' [nothing] -&amp;gt;  ''Letter'' ''Letter''&lt;br /&gt;
&lt;br /&gt;
Obviously, words of any length can be constructed, though they may well not actually be words from any language. &lt;br /&gt;
&lt;br /&gt;
====Discussion====&lt;br /&gt;
Trying to devise transformation rules to produce words which are more English-like is much more difficult - how do you insist on at least one vowel or on no more than 5 consecutive consonants (e.g. as in 'strengths').&lt;br /&gt;
&lt;br /&gt;
Further examples in [[Regular grammar]] show how numbers can be defined via a regular grammar, and also show how a hyphenated word could be defined.&lt;br /&gt;
&lt;br /&gt;
One of the limitations of a regular grammar is that it can't cope with nested matching brackets, so that it is impossible to write a regular grammar to describe an expression such as '''2 * (3+4)''' where that grammar is expected to allow brackets nested to any depth. A context-free grammar is needed for this, as described in the next section.&lt;br /&gt;
&lt;br /&gt;
Regular grammars or equivalent are widely used by [[compiler]]s in the lexical analysis of programming languages.&lt;br /&gt;
&lt;br /&gt;
===Level 2: context-free grammar===&lt;br /&gt;
The transformation rules for context-free grammars don't appear that much different from those for regular grammars. &lt;br /&gt;
*Only a single non-terminal item can appear on the left-hand side of a rule.&lt;br /&gt;
*The right-hand side of any rule must be one of:&lt;br /&gt;
**[nothing].&lt;br /&gt;
**any combination of terminal items and non-terminal items.&lt;br /&gt;
&lt;br /&gt;
The key difference is that in a regular grammar, any non-empty rule must effectively start with terminal item so that every rule transformation makes some immediate progress, while in a context-free grammar a rule could start with a non-terminal item which itself could be subject to arbitrary further transformations.&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
The following example shows how context-free grammars can cope with arithmetic expressions involving possibly nested brackets. Also an expression such as &amp;quot;2 + 3 * 4&amp;quot; could be interpreted as either &amp;quot;(2 + 3) * 4&amp;quot; = 20 or as &amp;quot;2 + (3 * 4)&amp;quot; = 14. The latter interpretation is that which is normally used - multiplication &amp;quot;*&amp;quot; is said to have a higher priority than addition &amp;quot;+&amp;quot; - so the grammar must incorporate this priority concept. Furthermore, consecutive operators of the same priority are normally applied from left to right, so that &amp;quot;8 - 2 + 3&amp;quot; is interpreted as &amp;quot;(8 - 2) + 3&amp;quot; = 9, rather than as &amp;quot;8 - (2 + 3)&amp;quot; = 3.  This ordering must also be built in to the grammar.&lt;br /&gt;
&lt;br /&gt;
To avoid distracting side-issues, this example only deals with numbers which consist solely of a single digit. The example is a simplified version of the definition of an arithmetic expression given in the Revised Algol 60 Report (Section 3.3.1).&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.masswerk.at/algol60/report.htm&lt;br /&gt;
| title = Revised Report on the Algorithmic Language Algol 60&lt;br /&gt;
| accessdate = 2012-04-22&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ''Expression'' -&amp;gt; ''Term''                        # an ''Expression'' is either a ''Term''&lt;br /&gt;
 ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''    #   or an ''Expression'' followed by '''+''' or '''-''' followed by a ''Term''&lt;br /&gt;
 ''Term''       -&amp;gt; ''Primary''                     # a ''Term'' is either a ''Primary''&lt;br /&gt;
 ''Term''       -&amp;gt; ''Term'' ''MulDivOp'' ''Primary''       #   or a ''Term'' followed by '''*''' or '''/''' followed by a ''Primary''&lt;br /&gt;
                                           #&lt;br /&gt;
 ''Primary''    -&amp;gt; ''Number''                      # a ''Primary'' is either a ''Number''&lt;br /&gt;
 ''Primary''    -&amp;gt; '''(''' ''Expression'' ''')'''              #   or an ''Expression'' enclosed in brackets&lt;br /&gt;
                                           #&lt;br /&gt;
 ''MulDivOp''   -&amp;gt; '''*'''. '''/'''                        # multiplication and division have the same priority&lt;br /&gt;
 ''AddSubOp''   -&amp;gt; '''+'''. '''-'''                        # addition and subtraction have the same priority&lt;br /&gt;
 ''Number''     -&amp;gt; '''0''', '''1''', ... '''9'''                 # this simple-minded definition of a ''Number'' is enough for this example&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
* Both ''Expression'' and ''Term'' are each defined via a left-recursive rule; this ensures that operators of the same priority are applied from left to right.&lt;br /&gt;
* The distinction between ''Expression'' and ''Term'' ensures that multiplication/division are applied before addition/subtraction.&lt;br /&gt;
* ''Expression'' is indirectly recursive via ''Term'' and ''Primary'' to allow bracketed sub-expressions to any depth.&lt;br /&gt;
&lt;br /&gt;
Example 1: generate 2 + 3 * 4&lt;br /&gt;
&lt;br /&gt;
  ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Term'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Primary'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' ''Term''                                 # '''+''' can not be applied until ''Term'' has been evaluated&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' ''Term'' ''MulDivOp'' ''Primary''&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' ''Primary'' ''MulDipOp'' ''Primary''&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' '''3''' '''*''' '''4'''&lt;br /&gt;
&lt;br /&gt;
Example 2: generate 2 * 3 + 4&lt;br /&gt;
&lt;br /&gt;
  ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Term'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Term'' ''MulDivOp'' ''Primary'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Primary'' ''MulDivOp'' ''Primary'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; '''2''' '''*''' '''3''' ''AddSubOp'' ''Term''                      # ''Term'' to left of ''AddSubOp'' is evaluated first&lt;br /&gt;
             -&amp;gt; '''2''' '''*''' '''3''' ''AddSubOp'' ''Primary''  &lt;br /&gt;
             -&amp;gt; '''2''' '''*''' '''3''' '''+''' '''4'''&lt;br /&gt;
&lt;br /&gt;
====Discussion====&lt;br /&gt;
Context-free grammars (or equivalent definitions using Backus-Naur-Form) are widely used both to define the syntax of programming languages and to (semi-automatically) generate parsers for these languages.&lt;br /&gt;
&lt;br /&gt;
A limitation/feature of both regular grammars and context-free grammars is that the left-hand side of any rule is always a single non-terminal item, so any transformation is applied regardless of the context in which that non-terminal item appears.  A simple example which depends on context is the use of singular and plural nouns and verbs in English.  We say: '''the man runs''' or '''the men run''', but neither of '''the man run''' nor '''the men runs'''.  Which form of verb to use depends on the noun, i.e. there is a context dependency.&lt;br /&gt;
&lt;br /&gt;
===Level 1: context-sensitive grammar===&lt;br /&gt;
For context-sensitive grammars the left-hand side of a rule may indicate the context in which that rule applies, so that the same non-terminal item may be transformed in different ways depending on the context in which it appears.&lt;br /&gt;
&lt;br /&gt;
There is only one transformation rule for context-sensitive grammars:&lt;br /&gt;
&lt;br /&gt;
 X [non-terminal] Y -&amp;gt; X [anything] Y&lt;br /&gt;
&lt;br /&gt;
where X and Y determine the context in which the [non-terminal] is transformed. Note that X and Y may each be terminals or non-terminals or [nothing]. When both X and Y are nothing there is no context and this reduces to a Level 2 or Level 3 grammar.&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
Taylor has provided several examples&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.divms.uiowa.edu/~fleck/taylor.pdf&lt;br /&gt;
| title = Context-sensitive Examples&lt;br /&gt;
| author = Taylor&lt;br /&gt;
| accessdate = 2012-04-26&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
and the following, inspired by his third example, is an extension of the original simple example above to handle singulars and plurals:&lt;br /&gt;
&lt;br /&gt;
 ''Sentence''                -&amp;gt;  ''NounPhrase'' ''VerbPhrase''            # simple sentence structure&lt;br /&gt;
 ''NounPhrase''              -&amp;gt;  ''Determiner'' ''Noun''                  # simple phrase structure&lt;br /&gt;
 ''VerbPhrase''              -&amp;gt;  ''Verb'' ''NounPhrase''                  # simple phrase structure&lt;br /&gt;
                                                              #&lt;br /&gt;
 ''Noun''                    -&amp;gt;  ''SingularNoun'', ''PluralNoun''         # nouns can be singular or plural &lt;br /&gt;
                                                              #&lt;br /&gt;
 ''Determiner'' ''SingularNoun'' -&amp;gt;  ''SingularDeterminer'' ''SingularNoun''  # context-sensitive:&lt;br /&gt;
 ''Determiner'' ''PluralNoun''   -&amp;gt;  ''PluralDeterminer'' ''PluralNoun''      #    determiner must agree with noun&lt;br /&gt;
                                                              #&lt;br /&gt;
 ''SingularNoun'' ''Verb''       -&amp;gt;  ''SingularNoun'' ''SingularVerb''        # context-sensitive: &lt;br /&gt;
 ''PluralNoun'' ''Verb''         -&amp;gt;  ''PluralNoun'' ''PluralVerb''            #    verb must agree with noun&lt;br /&gt;
                                                              #&lt;br /&gt;
 ''SingularDeterminer''      -&amp;gt;  '''a''', '''the'''                           # singular determiners&lt;br /&gt;
 ''PluralDeterminer''        -&amp;gt;  '''the'''                              # plural determiners&lt;br /&gt;
                                                              #&lt;br /&gt;
 ''SingularNoun''            -&amp;gt;  '''boy''', '''sheep''', '''dog'''                  # singular nouns&lt;br /&gt;
 ''PluralNoun''              -&amp;gt;  '''boys''', '''sheep''', '''dogs'''                # plural nouns&lt;br /&gt;
                                                              #&lt;br /&gt;
 ''SingularVerb''            -&amp;gt;  '''chases''', '''hears''', '''sees'''              # singular verbs&lt;br /&gt;
 ''PluralVerb''              -&amp;gt;  '''chase''', '''hear''', '''see'''                 # plural verbs&lt;br /&gt;
&lt;br /&gt;
The above grammar can generate sentences such as: '''a boy chases a dog''', '''the boys chase a dog''', etc. Because some words have the same form in both singular and plural, it can also generate meaningful (and grammatically-correct) sentences such as: '''the sheep sees the dog''', '''the sheep see the dog'''.&lt;br /&gt;
&lt;br /&gt;
But the above grammar can NOT generate sentences such as: '''a boys chases the sheep''', since this would violate the context-sensitive rules.&lt;br /&gt;
&lt;br /&gt;
====Discussion====&lt;br /&gt;
It is in fact possible to handle singular/plural issues by using only a Level 2 context-free grammar, but the above rules expressed as a Level 1 context-sensitive grammar are a closer match to ordinary concepts of English grammar (e.g. nouns and verbs must agree in number i.e. singular/plural).&lt;br /&gt;
&lt;br /&gt;
===Level 0: recursively enumerable grammar===&lt;br /&gt;
A recursively enumerable grammar has absolutely no restriction on what sort of transformation rules can be applied. Rules take the general form:&lt;br /&gt;
&lt;br /&gt;
* [anything] -&amp;gt; [anything]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[category:linguistics]]&lt;br /&gt;
[[Category:Computer Science]]&lt;/div&gt;</summary>
		<author><name>RolandPlankton</name></author>
	</entry>
	<entry>
		<id>https://www.conservapedia.com/index.php?title=User_talk:GregG/Wikipedia_copyright&amp;diff=980169</id>
		<title>User talk:GregG/Wikipedia copyright</title>
		<link rel="alternate" type="text/html" href="https://www.conservapedia.com/index.php?title=User_talk:GregG/Wikipedia_copyright&amp;diff=980169"/>
		<updated>2012-05-07T22:47:29Z</updated>

		<summary type="html">&lt;p&gt;RolandPlankton: /* Wikipedia teaching usage */ allow criticism&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Wikipedia teaching usage==&lt;br /&gt;
Under the CC-BY-CA license you can copy any Wikipedia article you like, for teaching or any other purpose, provided you add something like the following:&lt;br /&gt;
 &amp;quot;copied from (or based on) Wikipedia article {name and link to article} accessed on {date/time}&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
This requirement does not seem particularly onerous. [[User:RolandPlankton|RolandPlankton]] 17:11, 7 May 2012 (EDT)&lt;br /&gt;
&lt;br /&gt;
:The Wikipedia policy seems to conflict with the CC-BY-SA 3100+ word license.  Which takes priority?--[[User:Aschlafly|Andy Schlafly]] 18:13, 7 May 2012 (EDT)&lt;br /&gt;
::There is no conflict.  Section 4c of the legal code reads&lt;br /&gt;
{{cquote|If You distribute, publicly display, publicly perform, or publicly digitally perform the Work (as defined in Section 1 above) or any Derivative Works (as defined in Section 1 above) or Collective Works (as defined in Section 1 above), You must, unless a request has been made pursuant to Section 4(a), keep intact all copyright notices for the Work and provide, reasonable to the medium or means You are utilizing: (i) the name of the Original Author (or pseudonym, if applicable) if supplied, and/or (ii) if the Original Author and/or Licensor designate another party or parties (e.g. a sponsor institute, publishing entity, journal) for attribution (&amp;quot;Attribution Parties&amp;quot;) in Licensor's copyright notice, terms of service or by other reasonable means, the name of such party or parties; the title of the Work if supplied; to the extent reasonably practicable, the Uniform Resource Identifier, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work; and, consistent with Section 3(b) in the case of a Derivative Work, a credit identifying the use of the Work in the Derivative Work (e.g., &amp;quot;French translation of the Work by Original Author,&amp;quot; or &amp;quot;Screenplay based on original Work by Original Author&amp;quot;). The credit required by this Section 4(c) may be implemented in any reasonable manner; provided, however, that in the case of a Derivative Work or Collective Work, at a minimum such credit will appear, if a credit for all contributing authors of the Derivative Work or Collective Work appears, then as part of these credits and in a manner at least as prominent as the credits for the other contributing authors. For the avoidance of doubt, You may only use the credit required by this Section for the purpose of attribution in the manner set out above and, by exercising Your rights under this License, You may not implicitly or explicitly assert or imply any connection with, sponsorship or endorsement by the Original Author, Licensor and/or Attribution Parties, as appropriate, of You or Your use of the Work, without the separate, express prior written permission of the Original Author, Licensor and/or Attribution Parties.}}&lt;br /&gt;
I understand Wikipedia's interpretation to be consistent with the legal code.  [[User:GregG|GregG]] 18:25, 7 May 2012 (EDT)&lt;br /&gt;
&lt;br /&gt;
:Provided you comply with the simple requirement above you can use a Wikipedia article for any purpose, '''including criticism''' (which could reasonably happen in a teaching/study environment). I note that the Conservapedia copyright conditions allow your copyright license to be revoked if someone (who?) doesn't like the way in which the copied material is used. I can't see any legal department allowing copying from Conservapedia if the copyright license could be revoked at any time, or indeed as the copyright license itself can be changed at any time. [[User:RolandPlankton|RolandPlankton]] 18:47, 7 May 2012 (EDT)&lt;br /&gt;
&lt;br /&gt;
== License changes ==&lt;br /&gt;
&lt;br /&gt;
Originally Wikipedia articles were licensed under the GNU Free Documentation License. After extensive discussion to which all editors could contribute the license terms were changed to dual licensing under both the GFDL and CC-BY-CA.  I count one repeat ONE change of license.&lt;br /&gt;
&lt;br /&gt;
The Conservapedia copyright license has no history available prior to 6 April 2007. On looking at the history from that point I count 11 non-minor changes on 6 April 2007, 2 on 7th April 2007. and 1 each on 20 April 2007, 23 May 2008, 12 April 2008. This looks like at least SIXTEEN license changes to me. And I can't see any commitment not to change the license again. Indeed it would be possible for some copying to be valid in April 2007, and invalid after April 2008.&lt;br /&gt;
&lt;br /&gt;
In summary, one upwards compatible license change for Wikipedia, and sixteen possible incompatible changes for Conservapedia. [[User:RolandPlankton|RolandPlankton]] 17:31, 7 May 2012 (EDT)&lt;br /&gt;
&lt;br /&gt;
== Byzantine ==&lt;br /&gt;
&lt;br /&gt;
What is the 'byzantine' system of rules which Wikipedia uses?&lt;br /&gt;
&lt;br /&gt;
Under teaching above I have shown the basic rule to follow, what is the problem with that? [[User:RolandPlankton|RolandPlankton]] 18:09, 7 May 2012 (EDT)&lt;/div&gt;</summary>
		<author><name>RolandPlankton</name></author>
	</entry>
	<entry>
		<id>https://www.conservapedia.com/index.php?title=User_talk:GregG/Wikipedia_copyright&amp;diff=980164</id>
		<title>User talk:GregG/Wikipedia copyright</title>
		<link rel="alternate" type="text/html" href="https://www.conservapedia.com/index.php?title=User_talk:GregG/Wikipedia_copyright&amp;diff=980164"/>
		<updated>2012-05-07T22:09:57Z</updated>

		<summary type="html">&lt;p&gt;RolandPlankton: /* Byzantine */ new section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Wikipedia teaching usage==&lt;br /&gt;
Under the CC-BY-CA license you can copy any Wikipedia article you like, for teaching or any other purpose, provided you add something like the following:&lt;br /&gt;
 &amp;quot;copied from (or based on) Wikipedia article {name and link to article} accessed on {date/time}&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
This requirement does not seem particularly onerous. [[User:RolandPlankton|RolandPlankton]] 17:11, 7 May 2012 (EDT)&lt;br /&gt;
&lt;br /&gt;
== License changes ==&lt;br /&gt;
&lt;br /&gt;
Originally Wikipedia articles were licensed under the GNU Free Documentation License. After extensive discussion to which all editors could contribute the license terms were changed to dual licensing under both the GFDL and CC-BY-CA.  I count one repeat ONE change of license.&lt;br /&gt;
&lt;br /&gt;
The Conservapedia copyright license has no history available prior to 6 April 2007. On looking at the history from that point I count 11 non-minor changes on 6 April 2007, 2 on 7th April 2007. and 1 each on 20 April 2007, 23 May 2008, 12 April 2008. This looks like at least SIXTEEN license changes to me. And I can't see any commitment not to change the license again. Indeed it would be possible for some copying to be valid in April 2007, and invalid after April 2008.&lt;br /&gt;
&lt;br /&gt;
In summary, one upwards compatible license change for Wikipedia, and sixteen possible incompatible changes for Conservapedia. [[User:RolandPlankton|RolandPlankton]] 17:31, 7 May 2012 (EDT)&lt;br /&gt;
&lt;br /&gt;
== Byzantine ==&lt;br /&gt;
&lt;br /&gt;
What is the 'byzantine' system of rules which Wikipedia uses?&lt;br /&gt;
&lt;br /&gt;
Under teaching above I have shown the basic rule to follow, what is the problem with that? [[User:RolandPlankton|RolandPlankton]] 18:09, 7 May 2012 (EDT)&lt;/div&gt;</summary>
		<author><name>RolandPlankton</name></author>
	</entry>
	<entry>
		<id>https://www.conservapedia.com/index.php?title=User_talk:GregG/Wikipedia_copyright&amp;diff=980148</id>
		<title>User talk:GregG/Wikipedia copyright</title>
		<link rel="alternate" type="text/html" href="https://www.conservapedia.com/index.php?title=User_talk:GregG/Wikipedia_copyright&amp;diff=980148"/>
		<updated>2012-05-07T21:31:25Z</updated>

		<summary type="html">&lt;p&gt;RolandPlankton: /* License changes */ new section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Wikipedia teaching usage==&lt;br /&gt;
Under the CC-BY-CA license you can copy any Wikipedia article you like, for teaching or any other purpose, provided you add something like the following:&lt;br /&gt;
 &amp;quot;copied from (or based on) Wikipedia article {name and link to article} accessed on {date/time}&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
This requirement does not seem particularly onerous. [[User:RolandPlankton|RolandPlankton]] 17:11, 7 May 2012 (EDT)&lt;br /&gt;
&lt;br /&gt;
== License changes ==&lt;br /&gt;
&lt;br /&gt;
Originally Wikipedia articles were licensed under the GNU Free Documentation License. After extensive discussion to which all editors could contribute the license terms were changed to dual licensing under both the GFDL and CC-BY-CA.  I count one repeat ONE change of license.&lt;br /&gt;
&lt;br /&gt;
The Conservapedia copyright license has no history available prior to 6 April 2007. On looking at the history from that point I count 11 non-minor changes on 6 April 2007, 2 on 7th April 2007. and 1 each on 20 April 2007, 23 May 2008, 12 April 2008. This looks like at least SIXTEEN license changes to me. And I can't see any commitment not to change the license again. Indeed it would be possible for some copying to be valid in April 2007, and invalid after April 2008.&lt;br /&gt;
&lt;br /&gt;
In summary, one upwards compatible license change for Wikipedia, and sixteen possible incompatible changes for Conservapedia. [[User:RolandPlankton|RolandPlankton]] 17:31, 7 May 2012 (EDT)&lt;/div&gt;</summary>
		<author><name>RolandPlankton</name></author>
	</entry>
	<entry>
		<id>https://www.conservapedia.com/index.php?title=User_talk:GregG/Wikipedia_copyright&amp;diff=980146</id>
		<title>User talk:GregG/Wikipedia copyright</title>
		<link rel="alternate" type="text/html" href="https://www.conservapedia.com/index.php?title=User_talk:GregG/Wikipedia_copyright&amp;diff=980146"/>
		<updated>2012-05-07T21:11:11Z</updated>

		<summary type="html">&lt;p&gt;RolandPlankton: you CAN copy WIkipedia articles for teaching purposes&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Wikipedia teaching usage==&lt;br /&gt;
Under the CC-BY-CA license you can copy any Wikipedia article you like, for teaching or any other purpose, provided you add something like the following:&lt;br /&gt;
 &amp;quot;copied from (or based on) Wikipedia article {name and link to article} accessed on {date/time}&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
This requirement does not seem particularly onerous. [[User:RolandPlankton|RolandPlankton]] 17:11, 7 May 2012 (EDT)&lt;/div&gt;</summary>
		<author><name>RolandPlankton</name></author>
	</entry>
	<entry>
		<id>https://www.conservapedia.com/index.php?title=Chomsky_hierarchy&amp;diff=979806</id>
		<title>Chomsky hierarchy</title>
		<link rel="alternate" type="text/html" href="https://www.conservapedia.com/index.php?title=Chomsky_hierarchy&amp;diff=979806"/>
		<updated>2012-05-05T22:49:25Z</updated>

		<summary type="html">&lt;p&gt;RolandPlankton: there are other formal grammars&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The '''Chomsky hierarchy''', sometimes known as the '''Chomsky-Schützenberger hierarchy''', is a hierarchy of formal grammatical systems for describing various classes of languages; the hierarchy can apply to both human and computer languages. This hierarchy was first published in 1956 by [[Noam Chomsky|Chomsky]].&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite journal &lt;br /&gt;
| title = Three models for the description of language &lt;br /&gt;
| year = 1956 &lt;br /&gt;
| last = Chomsky &lt;br /&gt;
| first = Noam &lt;br /&gt;
| journal = IRE Transactions on Information Theory &lt;br /&gt;
| volume = 2 &lt;br /&gt;
| pages = 113–124 &lt;br /&gt;
| url = http://www.chomsky.info/articles/195609--.pdf &lt;br /&gt;
| accessdate = 2012-04-08&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
These grammatical systems were referred to by Chomsky as ''transformational grammars''.  Other linguists have since developed a variety of similar grammars; together these are known as ''generative grammars''. &lt;br /&gt;
&lt;br /&gt;
The basic idea of a '''generative grammar''' is to provide a set of rules which are capable of generating all possible grammatical sentences in some language; the rules must constrain the generation so that only grammatical sentences are generated. The rules can also be used in reverse to parse a sentence and check if it is grammatical.&lt;br /&gt;
&lt;br /&gt;
In the late 1950's, [[John Backus]] and Peter Naur developed a notation for describing [[programming language]]s. This notation is known as [[Backus Naur Form]] (or BNF) and turns out to be equivalent to Chomsky's grammar number two (context-free grammar), although it was developed independently of Chomsky's work. Backus-Naur Form was first used in the Algol 60 Report to specify the syntax of [[Algol 60]], and has since been used for specifying the syntax of other programming languages. &lt;br /&gt;
&lt;br /&gt;
==Example of a very simple generative grammar==&lt;br /&gt;
This very simple example can handle only a tiny subset of English and should not be taken seriously as a guide to English grammar or vocabulary. It is based on an example by David Crystal&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite book &lt;br /&gt;
| last = Crystal &lt;br /&gt;
| first = David  &lt;br /&gt;
| title = The Cambridge Encyclopedia of Language &lt;br /&gt;
| publisher = Cambridge University Press &lt;br /&gt;
| year = 1987 &lt;br /&gt;
| isbn = 0-521-42443-7&lt;br /&gt;
| pages = page 97&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; and is a slight extension of an example on slide 9 of this lecture.&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.cs.princeton.edu/~rywang/99f126/slides/16th.pdf&lt;br /&gt;
| title = Lecture notes: Formal Languages&lt;br /&gt;
| accessdate = 2012-04-07}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase''         # A ''Sentence'' consists of a ''NounPhrase'' followed by a ''VerbPhrase''&lt;br /&gt;
 ''NounPhrase'' -&amp;gt;  ''Determiner'' ''Noun''               # A ''NounPhrase'' consists of a ''Determiner'' followed by a ''Noun''&lt;br /&gt;
 ''VerbPhrase'' -&amp;gt;  ''Verb'' ''NounPhrase''               # A ''VerbPhrase'' consists of a ''Verb'' followed by a ''NounPhrase''&lt;br /&gt;
 ''Determiner'' -&amp;gt;  '''a''', '''the'''                        # A ''Determiner''  is one of: '''a''' or '''the'''&lt;br /&gt;
 ''Noun''       -&amp;gt;  '''boy''', '''girl''', '''dog'''                # A ''Noun'' is one of: '''boy''' or '''girl''' or '''dog'''  &lt;br /&gt;
 ''Verb''       -&amp;gt;  '''chased''', '''heard''', '''saw'''            # A ''Verb'' is one of: '''chased''' or '''heard''' or '''saw'''&lt;br /&gt;
&lt;br /&gt;
Notation used above: &lt;br /&gt;
:The symbol &amp;quot;-&amp;gt;&amp;quot; means &amp;quot;can be replaced by&amp;quot;.  &lt;br /&gt;
:When there are several items on the right hand side separated by commas, just one of these items can be selected. &lt;br /&gt;
:The comments preceded by &amp;quot;#&amp;quot; are not part of the generative grammar, but hopefully will help folks understand the example a little better.&lt;br /&gt;
&lt;br /&gt;
By making appropriate substitutions we can generate such sentences as:&lt;br /&gt;
:The dog chased a girl.&lt;br /&gt;
:The girl heard the dog.&lt;br /&gt;
:The boy saw a girl.&lt;br /&gt;
&lt;br /&gt;
The stages in the generation of these examples are as follows:&lt;br /&gt;
:''Sentence''&lt;br /&gt;
:-&amp;gt; ''NounPhrase'' ''VerbPhrase''&lt;br /&gt;
:-&amp;gt; ''Determiner'' ''Noun'' ''Verb'' ''NounPhrase''&lt;br /&gt;
:-&amp;gt; ''Determiner'' ''Noun'' ''Verb'' ''Determiner'' ''Noun''&lt;br /&gt;
&lt;br /&gt;
By appropriate selection of words to substitute for ''Determiner'', ''Noun'', and ''Verb'' we can produce the 3 example sentences above.&lt;br /&gt;
&lt;br /&gt;
The simple grammar defines a few words which can be substituted for ''Determiner'', ''Noun'', and ''Verb''. There are two possibilities for ''Determiner'', three for ''Noun'', and three for ''Verb'', with both ''Determiner'' and ''Noun'' appearing twice in the expansion. Hence the total number of grammatical sentences which can be generated by this simple grammar is 108 (= 2 * 3 * 3 * 2 * 3). In this particular case the possible words have been carefully chosen so that all of these 108 sentences also actually mean something.&lt;br /&gt;
&lt;br /&gt;
Note that the use of ''italics'' and '''boldface''' in this example is merely a convenient way of indicating the difference between items which can be expanded further (e.g. concepts such as ''NounPhrase'') and items which can not be expanded further (e.g. words such as '''girl'''). In the linguistic literature, items which can be expanded further are referred to as 'non-terminal' items, while items which can't be expanded further are known as 'terminal' items.&lt;br /&gt;
&lt;br /&gt;
The 'comma' notation for alternatives is a form of shorthand. In some formulations this would be shown as several separate rules, so that:&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''a''', '''the''' &lt;br /&gt;
could be shown as two rules:&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''a'''&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''the''' &lt;br /&gt;
&lt;br /&gt;
==Caution==&lt;br /&gt;
While a generative grammar may produce sentences which are grammatically correct, there is no certainty that such sentences will actually mean anything. The classic example of such a meaningless sentence is from Chomsky's book&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite book &lt;br /&gt;
| last = Chomsky &lt;br /&gt;
| first = Noam &lt;br /&gt;
| title = Syntactic Structures &lt;br /&gt;
| year = 1957 &lt;br /&gt;
| publisher = Mouton &lt;br /&gt;
| location = The Hague/Paris &lt;br /&gt;
| pages = page 15 &lt;br /&gt;
| isbn = 3-11-017279-8&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; with the grammatically correct sentence:&lt;br /&gt;
&lt;br /&gt;
:&amp;quot;Colorless green ideas sleep furiously.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
:This example illustrates the difference between grammar/syntax and meaning/semantics.&lt;br /&gt;
&lt;br /&gt;
Another problem when analysing a sentence is that many English words have multiple meanings, so that there may be more than one way to interpret a sentence. A simple example is the sentence: &lt;br /&gt;
:&amp;quot;Time flies.&amp;quot; &lt;br /&gt;
:Is this an instruction to check how fast flies are flying, or an indication that time appears to be passing quickly? &lt;br /&gt;
:A varied and entertaining selection of such ambiguities has been compiled by Jeff Gray.&amp;lt;ref&amp;gt;{{Cite web &lt;br /&gt;
| title = Collection of Ambiguous or Inconsistent/Incomplete Statements  &lt;br /&gt;
| url = http://www.gray-area.org/Research/Ambig/ &lt;br /&gt;
| author = Jeff Gray&lt;br /&gt;
| accessdate = 2012-04-10&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Formal grammar==&lt;br /&gt;
'''Note''': this section and subsequent sections are, by necessity, slightly more technical/formal than the earlier parts of this article, though specialist notation and abbreviations have been largely avoided. Make sure that you understand the 'Simple example' above before proceeding further, since references will be made to that example to help explain the technicalities, and variations on that example will be used to illustrate new ideas. &lt;br /&gt;
&lt;br /&gt;
A formal generative grammar has four components (see slide 19 of this lecture&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://adammikeal.org/courses/compute/Chomsky%20Presentation.pdf&lt;br /&gt;
| title = The Chomsky Hierarchy&lt;br /&gt;
| accessdate = 2012-04-06&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
):&lt;br /&gt;
# a finite number of non-terminal concepts (e.g. ''VerbPhrase'' in the example, or anything else in ''italics''),&lt;br /&gt;
# a finite number of terminal items (e.g. '''girl''' in the example, or anything else in '''bold-face''').&lt;br /&gt;
# a finite set of rules for transforming non-terminal items (e.g. the example has 6 rules).&lt;br /&gt;
# a single starting point (e.g. ''Sentence'' in the example).&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
:Terminal items are those which can not be transformed into anything else.&lt;br /&gt;
:A list of all the terminal items is effectively the vocabulary from which sentences are built.&lt;br /&gt;
:Non-terminal items are those which can be transformed into something else.&lt;br /&gt;
:Linguists have developed various classes of grammars by using constraints to govern what sort of rules can be used for any particular grammar.&lt;br /&gt;
&lt;br /&gt;
===Changing the rules===&lt;br /&gt;
An relatively small change to even a single rule can make a large change in the language which can be generated. For example, change the first rule in the simple example to read:&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''NounPhrase'' ''VerbPhrase'' '''and''' ''NounPhrase'' ''VerbPhrase''&lt;br /&gt;
This means that a ''Sentence'' is either a ''NounPhrase'' followed by a ''VerbPhrase'' or a ''NounPhrase'' followed by a ''VerbPhrase'' followed by '''and''' followed by a ''NounPhrase'' followed by a ''VerbPhrase''. In addition to the shorter sentences already discussed, this could also generate a sentence such as: &amp;quot;A dog saw a girl and the dog chased the girl&amp;quot;. The total number of grammatically-correct sentences which can be generated by this modified grammar is now 11,772 (108 + 108*108), though some of these may not be very meaingful.&lt;br /&gt;
&lt;br /&gt;
===Towards infinity===&lt;br /&gt;
A significantly different rule change can have an astounding effect. Consider changing the first rule to read:&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''NounPhrase'' ''VerbPhrase'' '''and''' ''Sentence''&lt;br /&gt;
This can generate a potentially infinite number of sentences (any number of these five-word sentences linked by '''and'''). This is an example of what is known as a [[Recursion|recursive]] definition, whereby a ''Sentence'' is partially defined in terms of itself. In such a recursive rule there must be at least one transformation option which does not involve ''Sentence'', otherwise the transformation could never stop.&lt;br /&gt;
&lt;br /&gt;
The above change is known as right-recursive; a left-recursive formulation is also possible, and can in this example generate exactly the same sentences. As shown below  under 'Context-free grammar', there are situations where the choice of left- or right-recursive formulations can change the meaning. &lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''Sentence'' '''and''' ''NounPhrase'' ''VerbPhrase'' &lt;br /&gt;
&lt;br /&gt;
The distinction between left- and right-recursive grammars becomes important when trying to parse/analyse a sentence; some types of parser work best with left-recursive grammars, while other types work best with right-recursive grammars. This distinction is particularly relevant in connection with [[compiler|compiling or translating]] a program written in some high-level [[programming language]] so that it can be used on a [[computer]].&lt;br /&gt;
&lt;br /&gt;
==Chomsky hierarchy==&lt;br /&gt;
By imposing different constraints&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.cs.uaf.edu/2011/spring/cs331/lectures/cs331_20110124_grammar.html&lt;br /&gt;
| title = Lecture notes: Languages &amp;amp; Grammars&lt;br /&gt;
| accessdate = 2012-04-07&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; &lt;br /&gt;
as to what sort of transformation rules could be used, Chomsky was able to define four strictly nested transformational grammars, which he numbered from 0 to 3. As the grammar number increases, the generated language becomes simpler. As the grammar number decreases, parsing a sentence in that language becomes more difficult.&lt;br /&gt;
Other linguists have described formal grammars which fit in between the various Chomsky levels. This lecture&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.google.co.uk/url?sa=t&amp;amp;rct=j&amp;amp;q=recursively+enumerable+languages+examples&amp;amp;source=web&amp;amp;cd=4&amp;amp;ved=0CF4QFjAD&amp;amp;url=http%3A%2F%2Fwww.cs.colostate.edu%2F~massey%2FTeaching%2Fcs301%2FRestrictedAccess%2FSlides%2F301lecture23.pdf&amp;amp;ei=6qelT4KMA6SA0AXIu7CQBA&amp;amp;usg=AFQjCNG3fc1mD7g5f-14vfDPdvyX2uScDg&lt;br /&gt;
| title = Recursive and Recursively Enumerable Languages&lt;br /&gt;
| accessdate = 2012-05-05&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
shows that there exist languages which can not be described by any set of rules.&lt;br /&gt;
&lt;br /&gt;
The following table provides a summary, which is then explained further in the subsequent subsections.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!| Chomsky&amp;lt;br&amp;gt;number || linguistic name || Rule constraints || Recogniser+ || Notes &lt;br /&gt;
|-&lt;br /&gt;
| 0 || recursively enumerable || [anything] -&amp;gt; [anything] || Turing machine || most human languages &lt;br /&gt;
|-&lt;br /&gt;
| 1 || context-sensitive || X ''A'' Y -&amp;gt; X [anything] Y || linear bounded automaton || X and Y provide the context in which ''A'' can be transformed &lt;br /&gt;
|-&lt;br /&gt;
| 2 || context-free || ''A'' -&amp;gt; [anything] || non-deterministic push-down automaton || syntax analysis for most programming languages &lt;br /&gt;
|-&lt;br /&gt;
| 3 || regular || ''A'' -&amp;gt; [nothing]&amp;lt;br&amp;gt;''A'' -&amp;gt; '''xyz'''&amp;lt;br&amp;gt;''A'' -&amp;gt; '''xyz''' ''B'' || finite automaton&amp;lt;br&amp;gt;or finite state machine || lexical analysis (combining characters into words/tokens)  &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''+''' The '''recogniser''' column indicates the type of mathematical or computer science theoretical model needed to recognise that a sentence belongs to a language, essentially by applying the transformation rules in reverse to work backwards from the actual words in order to finish up with a ''sentence'' (in programming languages the starting concept is usually a ''program''). A finite automaton uses only a small fixed amount of memory, operates in time proportional to the length of the input, and always reaches a decision, while a Turing machine may use an infinite amount of memory and time and may fail to reach a decision (may never stop).&lt;br /&gt;
&lt;br /&gt;
In the linguistic literature, [nothing] is often represented by the symbol '''ε'''.&lt;br /&gt;
&lt;br /&gt;
The descriptions of the various Chomsky levels which follow are presented in reverse order, so as to work up from a simple case to a rather complicated case.&lt;br /&gt;
&lt;br /&gt;
===Level 3: regular grammar===&lt;br /&gt;
The transformation rules for regular grammars are required to be very simple. &lt;br /&gt;
*Only a single non-terminal item can appear on the left-hand side of a rule.&lt;br /&gt;
*The right-hand side of any rule must be one of:&lt;br /&gt;
**[nothing].&lt;br /&gt;
**a terminal item.&lt;br /&gt;
**a terminal item followed by a non-terminal item.&lt;br /&gt;
Note that instead of a terminal item we could have a non-terminal item whose transformation rule immediately resolves to a single terminal item, or to one of several terminal items.&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
Informally we can define a 'word' as a sequence of one or more ''Letter''s. The following regular grammar provides a more formal definition; for simplicity it is restricted to lower-case letters.&lt;br /&gt;
&lt;br /&gt;
 ''Word''     -&amp;gt; ''Letter'' ''PartWord''&lt;br /&gt;
 ''PartWord'' -&amp;gt; [nothing]&lt;br /&gt;
 ''PartWord'' -&amp;gt; ''Letter'' ''PartWord''&lt;br /&gt;
 ''Letter''   -&amp;gt; '''a''', '''b''', ... '''z'''&lt;br /&gt;
&lt;br /&gt;
Note that ''PartWord'' is recursively defined, with the recursion stopping if it is transformed into [nothing].&lt;br /&gt;
&lt;br /&gt;
For one-letter words we expand as: &lt;br /&gt;
:''Word'' -&amp;gt; ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' [nothing] -&amp;gt; ''Letter''&lt;br /&gt;
&lt;br /&gt;
For two-letter words we expand as: &lt;br /&gt;
:''Word'' -&amp;gt; ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' ''Letter'' [nothing] -&amp;gt;  ''Letter'' ''Letter''&lt;br /&gt;
&lt;br /&gt;
Obviously, words of any length can be constructed, though they may well not actually be words from any language. &lt;br /&gt;
&lt;br /&gt;
====Discussion====&lt;br /&gt;
Trying to devise transformation rules to produce words which are more English-like is much more difficult - how do you insist on at least one vowel or on no more than 5 consecutive consonants (e.g. as in 'strengths').&lt;br /&gt;
&lt;br /&gt;
Further examples in [[Regular grammar]] show how numbers can be defined via a regular grammar, and also show how a hyphenated word could be defined.&lt;br /&gt;
&lt;br /&gt;
One of the limitations of a regular grammar is that it can't cope with nested matching brackets, so that it is impossible to write a regular grammar to describe an expression such as '''2 * (3+4)''' where that grammar is expected to allow brackets nested to any depth. A context-free grammar is needed for this, as described in the next section.&lt;br /&gt;
&lt;br /&gt;
Regular grammars or equivalent are widely used by [[compiler]]s in the lexical analysis of programming languages.&lt;br /&gt;
&lt;br /&gt;
===Level 2: context-free grammar===&lt;br /&gt;
The transformation rules for context-free grammars don't appear that much different from those for regular grammars. &lt;br /&gt;
*Only a single non-terminal item can appear on the left-hand side of a rule.&lt;br /&gt;
*The right-hand side of any rule must be one of:&lt;br /&gt;
**[nothing].&lt;br /&gt;
**any combination of terminal items and non-terminal items.&lt;br /&gt;
&lt;br /&gt;
The key difference is that in a regular grammar, any non-empty rule must effectively start with terminal item so that every rule transformation makes some immediate progress, while in a context-free grammar a rule could start with a non-terminal item which itself could be subject to arbitrary further transformations.&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
The following example shows how context-free grammars can cope with arithmetic expressions involving possibly nested brackets. Also an expression such as &amp;quot;2 + 3 * 4&amp;quot; could be interpreted as either &amp;quot;(2 + 3) * 4&amp;quot; = 20 or as &amp;quot;2 + (3 * 4)&amp;quot; = 14. The latter interpretation is that which is normally used - multiplication &amp;quot;*&amp;quot; is said to have a higher priority than addition &amp;quot;+&amp;quot; - so the grammar must incorporate this priority concept. Furthermore, consecutive operators of the same priority are normally applied from left to right, so that &amp;quot;8 - 2 + 3&amp;quot; is interpreted as &amp;quot;(8 - 2) + 3&amp;quot; = 9, rather than as &amp;quot;8 - (2 + 3)&amp;quot; = 3.  This ordering must also be built in to the grammar.&lt;br /&gt;
&lt;br /&gt;
To avoid distracting side-issues, this example only deals with numbers which consist solely of a single digit. The example is a simplified version of the definition of an arithmetic expression given in the Revised Algol 60 Report (Section 3.3.1).&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.masswerk.at/algol60/report.htm&lt;br /&gt;
| title = Revised Report on the Algorithmic Language Algol 60&lt;br /&gt;
| accessdate = 2012-04-22&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ''Expression'' -&amp;gt; ''Term''                        # an ''Expression'' is either a ''Term''&lt;br /&gt;
 ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''    #   or an ''Expression'' followed by '''+''' or '''-''' followed by a ''Term''&lt;br /&gt;
 ''Term''       -&amp;gt; ''Primary''                     # a ''Term'' is either a ''Primary''&lt;br /&gt;
 ''Term''       -&amp;gt; ''Term'' ''MulDivOp'' ''Primary''       #   or a ''Term'' followed by '''*''' or '''/''' followed by a ''Primary''&lt;br /&gt;
                                           #&lt;br /&gt;
 ''Primary''    -&amp;gt; ''Number''                      # a ''Primary'' is either a ''Number''&lt;br /&gt;
 ''Primary''    -&amp;gt; '''(''' ''Expression'' ''')'''              #   or an ''Expression'' enclosed in brackets&lt;br /&gt;
                                           #&lt;br /&gt;
 ''MulDivOp''   -&amp;gt; '''*'''. '''/'''                        # multiplication and division have the same priority&lt;br /&gt;
 ''AddSubOp''   -&amp;gt; '''+'''. '''-'''                        # addition and subtraction have the same priority&lt;br /&gt;
 ''Number''     -&amp;gt; '''0''', '''1''', ... '''9'''                 # this simple-minded definition of a ''Number'' is enough for this example&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
* Both ''Expression'' and ''Term'' are each defined via a left-recursive rule; this ensures that operators of the same priority are applied from left to right.&lt;br /&gt;
* The distinction between ''Expression'' and ''Term'' ensures that multiplication/division are applied before addition/subtraction.&lt;br /&gt;
* ''Expression'' is indirectly recursive via ''Term'' and ''Primary'' to allow bracketed sub-expressions to any depth.&lt;br /&gt;
&lt;br /&gt;
Example 1: generate 2 + 3 * 4&lt;br /&gt;
&lt;br /&gt;
  ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Term'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Primary'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' ''Term''                                 # '''+''' can not be applied until ''Term'' has been evaluated&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' ''Term'' ''MulDivOp'' ''Primary''&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' ''Primary'' ''MulDipOp'' ''Primary''&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' '''3''' '''*''' '''4'''&lt;br /&gt;
&lt;br /&gt;
Example 2: generate 2 * 3 + 4&lt;br /&gt;
&lt;br /&gt;
  ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Term'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Term'' ''MulDivOp'' ''Primary'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Primary'' ''MulDivOp'' ''Primary'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; '''2''' '''*''' '''3''' ''AddSubOp'' ''Term''                      # ''Term'' to left of ''AddSubOp'' is evaluated first&lt;br /&gt;
             -&amp;gt; '''2''' '''*''' '''3''' ''AddSubOp'' ''Primary''  &lt;br /&gt;
             -&amp;gt; '''2''' '''*''' '''3''' '''+''' '''4'''&lt;br /&gt;
&lt;br /&gt;
====Discussion====&lt;br /&gt;
Context-free grammars (or equivalent definitions using Backus-Naur-Form) are widely used both to define the syntax of programming languages and to (semi-automatically) generate parsers for these languages.&lt;br /&gt;
&lt;br /&gt;
A limitation/feature of both regular grammars and context-free grammars is that the left-hand side of any rule is always a single non-terminal item, so any transformation is applied regardless of the context in which that non-terminal item appears.  A simple example which depends on context is the use of singular and plural nouns and verbs in English.  We say: '''the man runs''' or '''the men run''', but neither of '''the man run''' nor '''the men runs'''.  Which form of verb to use depends on the noun, i.e. there is a context dependency.&lt;br /&gt;
&lt;br /&gt;
===Level 1: context-sensitive grammar===&lt;br /&gt;
For context-sensitive grammars the left-hand side of a rule may indicate the context in which that rule applies, so that the same non-terminal item may be transformed in different ways depending on the context in which it appears.&lt;br /&gt;
&lt;br /&gt;
There is only one transformation rule for context-sensitive grammars:&lt;br /&gt;
&lt;br /&gt;
 X [non-terminal] Y -&amp;gt; X [anything] Y&lt;br /&gt;
&lt;br /&gt;
where X and Y determine the context in which the [non-terminal] is transformed. Note that X and Y may each be terminals or non-terminals or [nothing]. When both X and Y are nothing there is no context and this reduces to a Level 2 or Level 3 grammar.&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
Taylor has provided several examples&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.divms.uiowa.edu/~fleck/taylor.pdf&lt;br /&gt;
| title = Context-sensitive Examples&lt;br /&gt;
| author = Taylor&lt;br /&gt;
| accessdate = 2012-04-26&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
and the following, inspired by his third example, is an extension of the original simple example above to handle singulars and plurals:&lt;br /&gt;
&lt;br /&gt;
 ''Sentence''                -&amp;gt;  ''NounPhrase'' ''VerbPhrase''            # simple sentence structure&lt;br /&gt;
 ''NounPhrase''              -&amp;gt;  ''Determiner'' ''Noun''                  # simple phrase structure&lt;br /&gt;
 ''VerbPhrase''              -&amp;gt;  ''Verb'' ''NounPhrase''                  # simple phrase structure&lt;br /&gt;
                                                              #&lt;br /&gt;
 ''Noun''                    -&amp;gt;  ''SingularNoun'', ''PluralNoun''         # nouns can be singular or plural &lt;br /&gt;
                                                              #&lt;br /&gt;
 ''Determiner'' ''SingularNoun'' -&amp;gt;  ''SingularDeterminer'' ''SingularNoun''  # context-sensitive:&lt;br /&gt;
 ''Determiner'' ''PluralNoun''   -&amp;gt;  ''PluralDeterminer'' ''PluralNoun''      #    determiner must agree with noun&lt;br /&gt;
                                                              #&lt;br /&gt;
 ''SingularNoun'' ''Verb''       -&amp;gt;  ''SingularNoun'' ''SingularVerb''        # context-sensitive: &lt;br /&gt;
 ''PluralNoun'' ''Verb''         -&amp;gt;  ''PluralNoun'' ''PluralVerb''            #    verb must agree with noun&lt;br /&gt;
                                                              #&lt;br /&gt;
 ''SingularDeterminer''      -&amp;gt;  '''a''', '''the'''                           # singular determiners&lt;br /&gt;
 ''PluralDeterminer''        -&amp;gt;  '''the'''                              # plural determiners&lt;br /&gt;
                                                              #&lt;br /&gt;
 ''SingularNoun''            -&amp;gt;  '''boy''', '''sheep''', '''dog'''                  # singular nouns&lt;br /&gt;
 ''PluralNoun''              -&amp;gt;  '''boys''', '''sheep''', '''dogs'''                # plural nouns&lt;br /&gt;
                                                              #&lt;br /&gt;
 ''SingularVerb''            -&amp;gt;  '''chases''', '''hears''', '''sees'''              # singular verbs&lt;br /&gt;
 ''PluralVerb''              -&amp;gt;  '''chase''', '''hear''', '''see'''                 # plural verbs&lt;br /&gt;
&lt;br /&gt;
The above grammar can generate sentences such as: '''a boy chases a dog''', '''the boys chase a dog''', etc. Because some words have the same form in both singular and plural, it can also generate meaningful (and grammatically-correct) sentences such as: '''the sheep sees the dog''', '''the sheep see the dog'''.&lt;br /&gt;
&lt;br /&gt;
But the above grammar can NOT generate sentences such as: '''a boys chases the sheep''', since this would violate the context-sensitive rules.&lt;br /&gt;
&lt;br /&gt;
====Discussion====&lt;br /&gt;
It is in fact possible to handle singular/plural issues by using only a Level 2 context-free grammar, but the above rules expressed as a Level 1 context-sensitive grammar are a closer match to ordinary concepts of English grammar (e.g. nouns and verbs must agree in number i.e. singular/plural).&lt;br /&gt;
&lt;br /&gt;
===Level 0===&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[category:linguistics]]&lt;br /&gt;
[[Category:Computer Science]]&lt;/div&gt;</summary>
		<author><name>RolandPlankton</name></author>
	</entry>
	<entry>
		<id>https://www.conservapedia.com/index.php?title=Chomsky_hierarchy&amp;diff=979794</id>
		<title>Chomsky hierarchy</title>
		<link rel="alternate" type="text/html" href="https://www.conservapedia.com/index.php?title=Chomsky_hierarchy&amp;diff=979794"/>
		<updated>2012-05-05T22:18:10Z</updated>

		<summary type="html">&lt;p&gt;RolandPlankton: /* Formal grammar */ rephrase the notes for greater precision&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The '''Chomsky hierarchy''', sometimes known as the '''Chomsky-Schützenberger hierarchy''', is a hierarchy of formal grammatical systems for describing various classes of languages; the hierarchy can apply to both human and computer languages. This hierarchy was first published in 1956 by [[Noam Chomsky|Chomsky]].&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite journal &lt;br /&gt;
| title = Three models for the description of language &lt;br /&gt;
| year = 1956 &lt;br /&gt;
| last = Chomsky &lt;br /&gt;
| first = Noam &lt;br /&gt;
| journal = IRE Transactions on Information Theory &lt;br /&gt;
| volume = 2 &lt;br /&gt;
| pages = 113–124 &lt;br /&gt;
| url = http://www.chomsky.info/articles/195609--.pdf &lt;br /&gt;
| accessdate = 2012-04-08&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
These grammatical systems were referred to by Chomsky as ''transformational grammars''.  Other linguists have since developed a variety of similar grammars; together these are known as ''generative grammars''. &lt;br /&gt;
&lt;br /&gt;
The basic idea of a '''generative grammar''' is to provide a set of rules which are capable of generating all possible grammatical sentences in some language; the rules must constrain the generation so that only grammatical sentences are generated. The rules can also be used in reverse to parse a sentence and check if it is grammatical.&lt;br /&gt;
&lt;br /&gt;
In the late 1950's, [[John Backus]] and Peter Naur developed a notation for describing [[programming language]]s. This notation is known as [[Backus Naur Form]] (or BNF) and turns out to be equivalent to Chomsky's grammar number two (context-free grammar), although it was developed independently of Chomsky's work. Backus-Naur Form was first used in the Algol 60 Report to specify the syntax of [[Algol 60]], and has since been used for specifying the syntax of other programming languages. &lt;br /&gt;
&lt;br /&gt;
==Example of a very simple generative grammar==&lt;br /&gt;
This very simple example can handle only a tiny subset of English and should not be taken seriously as a guide to English grammar or vocabulary. It is based on an example by David Crystal&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite book &lt;br /&gt;
| last = Crystal &lt;br /&gt;
| first = David  &lt;br /&gt;
| title = The Cambridge Encyclopedia of Language &lt;br /&gt;
| publisher = Cambridge University Press &lt;br /&gt;
| year = 1987 &lt;br /&gt;
| isbn = 0-521-42443-7&lt;br /&gt;
| pages = page 97&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; and is a slight extension of an example on slide 9 of this lecture.&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.cs.princeton.edu/~rywang/99f126/slides/16th.pdf&lt;br /&gt;
| title = Lecture notes: Formal Languages&lt;br /&gt;
| accessdate = 2012-04-07}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase''         # A ''Sentence'' consists of a ''NounPhrase'' followed by a ''VerbPhrase''&lt;br /&gt;
 ''NounPhrase'' -&amp;gt;  ''Determiner'' ''Noun''               # A ''NounPhrase'' consists of a ''Determiner'' followed by a ''Noun''&lt;br /&gt;
 ''VerbPhrase'' -&amp;gt;  ''Verb'' ''NounPhrase''               # A ''VerbPhrase'' consists of a ''Verb'' followed by a ''NounPhrase''&lt;br /&gt;
 ''Determiner'' -&amp;gt;  '''a''', '''the'''                        # A ''Determiner''  is one of: '''a''' or '''the'''&lt;br /&gt;
 ''Noun''       -&amp;gt;  '''boy''', '''girl''', '''dog'''                # A ''Noun'' is one of: '''boy''' or '''girl''' or '''dog'''  &lt;br /&gt;
 ''Verb''       -&amp;gt;  '''chased''', '''heard''', '''saw'''            # A ''Verb'' is one of: '''chased''' or '''heard''' or '''saw'''&lt;br /&gt;
&lt;br /&gt;
Notation used above: &lt;br /&gt;
:The symbol &amp;quot;-&amp;gt;&amp;quot; means &amp;quot;can be replaced by&amp;quot;.  &lt;br /&gt;
:When there are several items on the right hand side separated by commas, just one of these items can be selected. &lt;br /&gt;
:The comments preceded by &amp;quot;#&amp;quot; are not part of the generative grammar, but hopefully will help folks understand the example a little better.&lt;br /&gt;
&lt;br /&gt;
By making appropriate substitutions we can generate such sentences as:&lt;br /&gt;
:The dog chased a girl.&lt;br /&gt;
:The girl heard the dog.&lt;br /&gt;
:The boy saw a girl.&lt;br /&gt;
&lt;br /&gt;
The stages in the generation of these examples are as follows:&lt;br /&gt;
:''Sentence''&lt;br /&gt;
:-&amp;gt; ''NounPhrase'' ''VerbPhrase''&lt;br /&gt;
:-&amp;gt; ''Determiner'' ''Noun'' ''Verb'' ''NounPhrase''&lt;br /&gt;
:-&amp;gt; ''Determiner'' ''Noun'' ''Verb'' ''Determiner'' ''Noun''&lt;br /&gt;
&lt;br /&gt;
By appropriate selection of words to substitute for ''Determiner'', ''Noun'', and ''Verb'' we can produce the 3 example sentences above.&lt;br /&gt;
&lt;br /&gt;
The simple grammar defines a few words which can be substituted for ''Determiner'', ''Noun'', and ''Verb''. There are two possibilities for ''Determiner'', three for ''Noun'', and three for ''Verb'', with both ''Determiner'' and ''Noun'' appearing twice in the expansion. Hence the total number of grammatical sentences which can be generated by this simple grammar is 108 (= 2 * 3 * 3 * 2 * 3). In this particular case the possible words have been carefully chosen so that all of these 108 sentences also actually mean something.&lt;br /&gt;
&lt;br /&gt;
Note that the use of ''italics'' and '''boldface''' in this example is merely a convenient way of indicating the difference between items which can be expanded further (e.g. concepts such as ''NounPhrase'') and items which can not be expanded further (e.g. words such as '''girl'''). In the linguistic literature, items which can be expanded further are referred to as 'non-terminal' items, while items which can't be expanded further are known as 'terminal' items.&lt;br /&gt;
&lt;br /&gt;
The 'comma' notation for alternatives is a form of shorthand. In some formulations this would be shown as several separate rules, so that:&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''a''', '''the''' &lt;br /&gt;
could be shown as two rules:&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''a'''&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''the''' &lt;br /&gt;
&lt;br /&gt;
==Caution==&lt;br /&gt;
While a generative grammar may produce sentences which are grammatically correct, there is no certainty that such sentences will actually mean anything. The classic example of such a meaningless sentence is from Chomsky's book&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite book &lt;br /&gt;
| last = Chomsky &lt;br /&gt;
| first = Noam &lt;br /&gt;
| title = Syntactic Structures &lt;br /&gt;
| year = 1957 &lt;br /&gt;
| publisher = Mouton &lt;br /&gt;
| location = The Hague/Paris &lt;br /&gt;
| pages = page 15 &lt;br /&gt;
| isbn = 3-11-017279-8&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; with the grammatically correct sentence:&lt;br /&gt;
&lt;br /&gt;
:&amp;quot;Colorless green ideas sleep furiously.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
:This example illustrates the difference between grammar/syntax and meaning/semantics.&lt;br /&gt;
&lt;br /&gt;
Another problem when analysing a sentence is that many English words have multiple meanings, so that there may be more than one way to interpret a sentence. A simple example is the sentence: &lt;br /&gt;
:&amp;quot;Time flies.&amp;quot; &lt;br /&gt;
:Is this an instruction to check how fast flies are flying, or an indication that time appears to be passing quickly? &lt;br /&gt;
:A varied and entertaining selection of such ambiguities has been compiled by Jeff Gray.&amp;lt;ref&amp;gt;{{Cite web &lt;br /&gt;
| title = Collection of Ambiguous or Inconsistent/Incomplete Statements  &lt;br /&gt;
| url = http://www.gray-area.org/Research/Ambig/ &lt;br /&gt;
| author = Jeff Gray&lt;br /&gt;
| accessdate = 2012-04-10&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Formal grammar==&lt;br /&gt;
'''Note''': this section and subsequent sections are, by necessity, slightly more technical/formal than the earlier parts of this article, though specialist notation and abbreviations have been largely avoided. Make sure that you understand the 'Simple example' above before proceeding further, since references will be made to that example to help explain the technicalities, and variations on that example will be used to illustrate new ideas. &lt;br /&gt;
&lt;br /&gt;
A formal generative grammar has four components (see slide 19 of this lecture&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://adammikeal.org/courses/compute/Chomsky%20Presentation.pdf&lt;br /&gt;
| title = The Chomsky Hierarchy&lt;br /&gt;
| accessdate = 2012-04-06&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
):&lt;br /&gt;
# a finite number of non-terminal concepts (e.g. ''VerbPhrase'' in the example, or anything else in ''italics''),&lt;br /&gt;
# a finite number of terminal items (e.g. '''girl''' in the example, or anything else in '''bold-face''').&lt;br /&gt;
# a finite set of rules for transforming non-terminal items (e.g. the example has 6 rules).&lt;br /&gt;
# a single starting point (e.g. ''Sentence'' in the example).&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
:Terminal items are those which can not be transformed into anything else.&lt;br /&gt;
:A list of all the terminal items is effectively the vocabulary from which sentences are built.&lt;br /&gt;
:Non-terminal items are those which can be transformed into something else.&lt;br /&gt;
:Linguists have developed various classes of grammars by using constraints to govern what sort of rules can be used for any particular grammar.&lt;br /&gt;
&lt;br /&gt;
===Changing the rules===&lt;br /&gt;
An relatively small change to even a single rule can make a large change in the language which can be generated. For example, change the first rule in the simple example to read:&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''NounPhrase'' ''VerbPhrase'' '''and''' ''NounPhrase'' ''VerbPhrase''&lt;br /&gt;
This means that a ''Sentence'' is either a ''NounPhrase'' followed by a ''VerbPhrase'' or a ''NounPhrase'' followed by a ''VerbPhrase'' followed by '''and''' followed by a ''NounPhrase'' followed by a ''VerbPhrase''. In addition to the shorter sentences already discussed, this could also generate a sentence such as: &amp;quot;A dog saw a girl and the dog chased the girl&amp;quot;. The total number of grammatically-correct sentences which can be generated by this modified grammar is now 11,772 (108 + 108*108), though some of these may not be very meaingful.&lt;br /&gt;
&lt;br /&gt;
===Towards infinity===&lt;br /&gt;
A significantly different rule change can have an astounding effect. Consider changing the first rule to read:&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''NounPhrase'' ''VerbPhrase'' '''and''' ''Sentence''&lt;br /&gt;
This can generate a potentially infinite number of sentences (any number of these five-word sentences linked by '''and'''). This is an example of what is known as a [[Recursion|recursive]] definition, whereby a ''Sentence'' is partially defined in terms of itself. In such a recursive rule there must be at least one transformation option which does not involve ''Sentence'', otherwise the transformation could never stop.&lt;br /&gt;
&lt;br /&gt;
The above change is known as right-recursive; a left-recursive formulation is also possible, and can in this example generate exactly the same sentences. As shown below  under 'Context-free grammar', there are situations where the choice of left- or right-recursive formulations can change the meaning. &lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''Sentence'' '''and''' ''NounPhrase'' ''VerbPhrase'' &lt;br /&gt;
&lt;br /&gt;
The distinction between left- and right-recursive grammars becomes important when trying to parse/analyse a sentence; some types of parser work best with left-recursive grammars, while other types work best with right-recursive grammars. This distinction is particularly relevant in connection with [[compiler|compiling or translating]] a program written in some high-level [[programming language]] so that it can be used on a [[computer]].&lt;br /&gt;
&lt;br /&gt;
==Chomsky hierarchy==&lt;br /&gt;
By imposing different constraints&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.cs.uaf.edu/2011/spring/cs331/lectures/cs331_20110124_grammar.html&lt;br /&gt;
| title = Lecture notes: Languages &amp;amp; Grammars&lt;br /&gt;
| accessdate = 2012-04-07&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; &lt;br /&gt;
as to what sort of transformation rules could be used, Chomsky was able to define four strictly nested transformational grammars, which he numbered from 0 to 3. As the grammar number increases, the generated language becomes simpler. As the grammar number decreases, parsing a sentence in that language becomes more difficult. The following table provides a summary, which is then explained further in the subsequent subsections.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!| Chomsky&amp;lt;br&amp;gt;number || linguistic name || Rule constraints || Recogniser+ || Notes &lt;br /&gt;
|-&lt;br /&gt;
| 0 || recursively enumerable || [anything] -&amp;gt; [anything] || Turing machine || most human languages &lt;br /&gt;
|-&lt;br /&gt;
| 1 || context-sensitive || X ''A'' Y -&amp;gt; X [anything] Y || linear bounded automaton || X and Y provide the context in which ''A'' can be transformed &lt;br /&gt;
|-&lt;br /&gt;
| 2 || context-free || ''A'' -&amp;gt; [anything] || non-deterministic push-down automaton || syntax analysis for most programming languages &lt;br /&gt;
|-&lt;br /&gt;
| 3 || regular || ''A'' -&amp;gt; [nothing]&amp;lt;br&amp;gt;''A'' -&amp;gt; '''xyz'''&amp;lt;br&amp;gt;''A'' -&amp;gt; '''xyz''' ''B'' || finite automaton&amp;lt;br&amp;gt;or finite state machine || lexical analysis (combining characters into words/tokens)  &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''+''' The '''recogniser''' column indicates the type of mathematical or computer science theoretical model needed to recognise that a sentence belongs to a language, essentially by applying the transformation rules in reverse to work backwards from the actual words in order to finish up with a ''sentence'' (in programming languages the starting concept is usually a ''program''). A finite automaton uses only a small fixed amount of memory, operates in time proportional to the length of the input, and always reaches a decision, while a Turing machine may use an infinite amount of memory and time and may fail to reach a decision (may never stop).&lt;br /&gt;
&lt;br /&gt;
In the linguistic literature, [nothing] is often represented by the symbol '''ε'''.&lt;br /&gt;
&lt;br /&gt;
The descriptions of the various Chomsky levels which follow are presented in reverse order, so as to work up from a simple case to a rather complicated case.&lt;br /&gt;
&lt;br /&gt;
===Level 3: regular grammar===&lt;br /&gt;
The transformation rules for regular grammars are required to be very simple. &lt;br /&gt;
*Only a single non-terminal item can appear on the left-hand side of a rule.&lt;br /&gt;
*The right-hand side of any rule must be one of:&lt;br /&gt;
**[nothing].&lt;br /&gt;
**a terminal item.&lt;br /&gt;
**a terminal item followed by a non-terminal item.&lt;br /&gt;
Note that instead of a terminal item we could have a non-terminal item whose transformation rule immediately resolves to a single terminal item, or to one of several terminal items.&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
Informally we can define a 'word' as a sequence of one or more ''Letter''s. The following regular grammar provides a more formal definition; for simplicity it is restricted to lower-case letters.&lt;br /&gt;
&lt;br /&gt;
 ''Word''     -&amp;gt; ''Letter'' ''PartWord''&lt;br /&gt;
 ''PartWord'' -&amp;gt; [nothing]&lt;br /&gt;
 ''PartWord'' -&amp;gt; ''Letter'' ''PartWord''&lt;br /&gt;
 ''Letter''   -&amp;gt; '''a''', '''b''', ... '''z'''&lt;br /&gt;
&lt;br /&gt;
Note that ''PartWord'' is recursively defined, with the recursion stopping if it is transformed into [nothing].&lt;br /&gt;
&lt;br /&gt;
For one-letter words we expand as: &lt;br /&gt;
:''Word'' -&amp;gt; ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' [nothing] -&amp;gt; ''Letter''&lt;br /&gt;
&lt;br /&gt;
For two-letter words we expand as: &lt;br /&gt;
:''Word'' -&amp;gt; ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' ''Letter'' [nothing] -&amp;gt;  ''Letter'' ''Letter''&lt;br /&gt;
&lt;br /&gt;
Obviously, words of any length can be constructed, though they may well not actually be words from any language. &lt;br /&gt;
&lt;br /&gt;
====Discussion====&lt;br /&gt;
Trying to devise transformation rules to produce words which are more English-like is much more difficult - how do you insist on at least one vowel or on no more than 5 consecutive consonants (e.g. as in 'strengths').&lt;br /&gt;
&lt;br /&gt;
Further examples in [[Regular grammar]] show how numbers can be defined via a regular grammar, and also show how a hyphenated word could be defined.&lt;br /&gt;
&lt;br /&gt;
One of the limitations of a regular grammar is that it can't cope with nested matching brackets, so that it is impossible to write a regular grammar to describe an expression such as '''2 * (3+4)''' where that grammar is expected to allow brackets nested to any depth. A context-free grammar is needed for this, as described in the next section.&lt;br /&gt;
&lt;br /&gt;
Regular grammars or equivalent are widely used by [[compiler]]s in the lexical analysis of programming languages.&lt;br /&gt;
&lt;br /&gt;
===Level 2: context-free grammar===&lt;br /&gt;
The transformation rules for context-free grammars don't appear that much different from those for regular grammars. &lt;br /&gt;
*Only a single non-terminal item can appear on the left-hand side of a rule.&lt;br /&gt;
*The right-hand side of any rule must be one of:&lt;br /&gt;
**[nothing].&lt;br /&gt;
**any combination of terminal items and non-terminal items.&lt;br /&gt;
&lt;br /&gt;
The key difference is that in a regular grammar, any non-empty rule must effectively start with terminal item so that every rule transformation makes some immediate progress, while in a context-free grammar a rule could start with a non-terminal item which itself could be subject to arbitrary further transformations.&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
The following example shows how context-free grammars can cope with arithmetic expressions involving possibly nested brackets. Also an expression such as &amp;quot;2 + 3 * 4&amp;quot; could be interpreted as either &amp;quot;(2 + 3) * 4&amp;quot; = 20 or as &amp;quot;2 + (3 * 4)&amp;quot; = 14. The latter interpretation is that which is normally used - multiplication &amp;quot;*&amp;quot; is said to have a higher priority than addition &amp;quot;+&amp;quot; - so the grammar must incorporate this priority concept. Furthermore, consecutive operators of the same priority are normally applied from left to right, so that &amp;quot;8 - 2 + 3&amp;quot; is interpreted as &amp;quot;(8 - 2) + 3&amp;quot; = 9, rather than as &amp;quot;8 - (2 + 3)&amp;quot; = 3.  This ordering must also be built in to the grammar.&lt;br /&gt;
&lt;br /&gt;
To avoid distracting side-issues, this example only deals with numbers which consist solely of a single digit. The example is a simplified version of the definition of an arithmetic expression given in the Revised Algol 60 Report (Section 3.3.1).&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.masswerk.at/algol60/report.htm&lt;br /&gt;
| title = Revised Report on the Algorithmic Language Algol 60&lt;br /&gt;
| accessdate = 2012-04-22&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ''Expression'' -&amp;gt; ''Term''                        # an ''Expression'' is either a ''Term''&lt;br /&gt;
 ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''    #   or an ''Expression'' followed by '''+''' or '''-''' followed by a ''Term''&lt;br /&gt;
 ''Term''       -&amp;gt; ''Primary''                     # a ''Term'' is either a ''Primary''&lt;br /&gt;
 ''Term''       -&amp;gt; ''Term'' ''MulDivOp'' ''Primary''       #   or a ''Term'' followed by '''*''' or '''/''' followed by a ''Primary''&lt;br /&gt;
                                           #&lt;br /&gt;
 ''Primary''    -&amp;gt; ''Number''                      # a ''Primary'' is either a ''Number''&lt;br /&gt;
 ''Primary''    -&amp;gt; '''(''' ''Expression'' ''')'''              #   or an ''Expression'' enclosed in brackets&lt;br /&gt;
                                           #&lt;br /&gt;
 ''MulDivOp''   -&amp;gt; '''*'''. '''/'''                        # multiplication and division have the same priority&lt;br /&gt;
 ''AddSubOp''   -&amp;gt; '''+'''. '''-'''                        # addition and subtraction have the same priority&lt;br /&gt;
 ''Number''     -&amp;gt; '''0''', '''1''', ... '''9'''                 # this simple-minded definition of a ''Number'' is enough for this example&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
* Both ''Expression'' and ''Term'' are each defined via a left-recursive rule; this ensures that operators of the same priority are applied from left to right.&lt;br /&gt;
* The distinction between ''Expression'' and ''Term'' ensures that multiplication/division are applied before addition/subtraction.&lt;br /&gt;
* ''Expression'' is indirectly recursive via ''Term'' and ''Primary'' to allow bracketed sub-expressions to any depth.&lt;br /&gt;
&lt;br /&gt;
Example 1: generate 2 + 3 * 4&lt;br /&gt;
&lt;br /&gt;
  ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Term'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Primary'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' ''Term''                                 # '''+''' can not be applied until ''Term'' has been evaluated&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' ''Term'' ''MulDivOp'' ''Primary''&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' ''Primary'' ''MulDipOp'' ''Primary''&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' '''3''' '''*''' '''4'''&lt;br /&gt;
&lt;br /&gt;
Example 2: generate 2 * 3 + 4&lt;br /&gt;
&lt;br /&gt;
  ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Term'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Term'' ''MulDivOp'' ''Primary'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Primary'' ''MulDivOp'' ''Primary'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; '''2''' '''*''' '''3''' ''AddSubOp'' ''Term''                      # ''Term'' to left of ''AddSubOp'' is evaluated first&lt;br /&gt;
             -&amp;gt; '''2''' '''*''' '''3''' ''AddSubOp'' ''Primary''  &lt;br /&gt;
             -&amp;gt; '''2''' '''*''' '''3''' '''+''' '''4'''&lt;br /&gt;
&lt;br /&gt;
====Discussion====&lt;br /&gt;
Context-free grammars (or equivalent definitions using Backus-Naur-Form) are widely used both to define the syntax of programming languages and to (semi-automatically) generate parsers for these languages.&lt;br /&gt;
&lt;br /&gt;
A limitation/feature of both regular grammars and context-free grammars is that the left-hand side of any rule is always a single non-terminal item, so any transformation is applied regardless of the context in which that non-terminal item appears.  A simple example which depends on context is the use of singular and plural nouns and verbs in English.  We say: '''the man runs''' or '''the men run''', but neither of '''the man run''' nor '''the men runs'''.  Which form of verb to use depends on the noun, i.e. there is a context dependency.&lt;br /&gt;
&lt;br /&gt;
===Level 1: context-sensitive grammar===&lt;br /&gt;
For context-sensitive grammars the left-hand side of a rule may indicate the context in which that rule applies, so that the same non-terminal item may be transformed in different ways depending on the context in which it appears.&lt;br /&gt;
&lt;br /&gt;
There is only one transformation rule for context-sensitive grammars:&lt;br /&gt;
&lt;br /&gt;
 X [non-terminal] Y -&amp;gt; X [anything] Y&lt;br /&gt;
&lt;br /&gt;
where X and Y determine the context in which the [non-terminal] is transformed. Note that X and Y may each be terminals or non-terminals or [nothing]. When both X and Y are nothing there is no context and this reduces to a Level 2 or Level 3 grammar.&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
Taylor has provided several examples&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.divms.uiowa.edu/~fleck/taylor.pdf&lt;br /&gt;
| title = Context-sensitive Examples&lt;br /&gt;
| author = Taylor&lt;br /&gt;
| accessdate = 2012-04-26&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
and the following, inspired by his third example, is an extension of the original simple example above to handle singulars and plurals:&lt;br /&gt;
&lt;br /&gt;
 ''Sentence''                -&amp;gt;  ''NounPhrase'' ''VerbPhrase''            # simple sentence structure&lt;br /&gt;
 ''NounPhrase''              -&amp;gt;  ''Determiner'' ''Noun''                  # simple phrase structure&lt;br /&gt;
 ''VerbPhrase''              -&amp;gt;  ''Verb'' ''NounPhrase''                  # simple phrase structure&lt;br /&gt;
                                                              #&lt;br /&gt;
 ''Noun''                    -&amp;gt;  ''SingularNoun'', ''PluralNoun''         # nouns can be singular or plural &lt;br /&gt;
                                                              #&lt;br /&gt;
 ''Determiner'' ''SingularNoun'' -&amp;gt;  ''SingularDeterminer'' ''SingularNoun''  # context-sensitive:&lt;br /&gt;
 ''Determiner'' ''PluralNoun''   -&amp;gt;  ''PluralDeterminer'' ''PluralNoun''      #    determiner must agree with noun&lt;br /&gt;
                                                              #&lt;br /&gt;
 ''SingularNoun'' ''Verb''       -&amp;gt;  ''SingularNoun'' ''SingularVerb''        # context-sensitive: &lt;br /&gt;
 ''PluralNoun'' ''Verb''         -&amp;gt;  ''PluralNoun'' ''PluralVerb''            #    verb must agree with noun&lt;br /&gt;
                                                              #&lt;br /&gt;
 ''SingularDeterminer''      -&amp;gt;  '''a''', '''the'''                           # singular determiners&lt;br /&gt;
 ''PluralDeterminer''        -&amp;gt;  '''the'''                              # plural determiners&lt;br /&gt;
                                                              #&lt;br /&gt;
 ''SingularNoun''            -&amp;gt;  '''boy''', '''sheep''', '''dog'''                  # singular nouns&lt;br /&gt;
 ''PluralNoun''              -&amp;gt;  '''boys''', '''sheep''', '''dogs'''                # plural nouns&lt;br /&gt;
                                                              #&lt;br /&gt;
 ''SingularVerb''            -&amp;gt;  '''chases''', '''hears''', '''sees'''              # singular verbs&lt;br /&gt;
 ''PluralVerb''              -&amp;gt;  '''chase''', '''hear''', '''see'''                 # plural verbs&lt;br /&gt;
&lt;br /&gt;
The above grammar can generate sentences such as: '''a boy chases a dog''', '''the boys chase a dog''', etc. Because some words have the same form in both singular and plural, it can also generate meaningful (and grammatically-correct) sentences such as: '''the sheep sees the dog''', '''the sheep see the dog'''.&lt;br /&gt;
&lt;br /&gt;
But the above grammar can NOT generate sentences such as: '''a boys chases the sheep''', since this would violate the context-sensitive rules.&lt;br /&gt;
&lt;br /&gt;
====Discussion====&lt;br /&gt;
It is in fact possible to handle singular/plural issues by using only a Level 2 context-free grammar, but the above rules expressed as a Level 1 context-sensitive grammar are a closer match to ordinary concepts of English grammar (e.g. nouns and verbs must agree in number i.e. singular/plural).&lt;br /&gt;
&lt;br /&gt;
===Level 0===&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[category:linguistics]]&lt;br /&gt;
[[Category:Computer Science]]&lt;/div&gt;</summary>
		<author><name>RolandPlankton</name></author>
	</entry>
	<entry>
		<id>https://www.conservapedia.com/index.php?title=Chomsky_hierarchy&amp;diff=979763</id>
		<title>Chomsky hierarchy</title>
		<link rel="alternate" type="text/html" href="https://www.conservapedia.com/index.php?title=Chomsky_hierarchy&amp;diff=979763"/>
		<updated>2012-05-05T16:37:25Z</updated>

		<summary type="html">&lt;p&gt;RolandPlankton: /* Level 1: context-sensitive grammar */ add some discussion&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The '''Chomsky hierarchy''', sometimes known as the '''Chomsky-Schützenberger hierarchy''', is a hierarchy of formal grammatical systems for describing various classes of languages; the hierarchy can apply to both human and computer languages. This hierarchy was first published in 1956 by [[Noam Chomsky|Chomsky]].&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite journal &lt;br /&gt;
| title = Three models for the description of language &lt;br /&gt;
| year = 1956 &lt;br /&gt;
| last = Chomsky &lt;br /&gt;
| first = Noam &lt;br /&gt;
| journal = IRE Transactions on Information Theory &lt;br /&gt;
| volume = 2 &lt;br /&gt;
| pages = 113–124 &lt;br /&gt;
| url = http://www.chomsky.info/articles/195609--.pdf &lt;br /&gt;
| accessdate = 2012-04-08&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
These grammatical systems were referred to by Chomsky as ''transformational grammars''.  Other linguists have since developed a variety of similar grammars; together these are known as ''generative grammars''. &lt;br /&gt;
&lt;br /&gt;
The basic idea of a '''generative grammar''' is to provide a set of rules which are capable of generating all possible grammatical sentences in some language; the rules must constrain the generation so that only grammatical sentences are generated. The rules can also be used in reverse to parse a sentence and check if it is grammatical.&lt;br /&gt;
&lt;br /&gt;
In the late 1950's, [[John Backus]] and Peter Naur developed a notation for describing [[programming language]]s. This notation is known as [[Backus Naur Form]] (or BNF) and turns out to be equivalent to Chomsky's grammar number two (context-free grammar), although it was developed independently of Chomsky's work. Backus-Naur Form was first used in the Algol 60 Report to specify the syntax of [[Algol 60]], and has since been used for specifying the syntax of other programming languages. &lt;br /&gt;
&lt;br /&gt;
==Example of a very simple generative grammar==&lt;br /&gt;
This very simple example can handle only a tiny subset of English and should not be taken seriously as a guide to English grammar or vocabulary. It is based on an example by David Crystal&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite book &lt;br /&gt;
| last = Crystal &lt;br /&gt;
| first = David  &lt;br /&gt;
| title = The Cambridge Encyclopedia of Language &lt;br /&gt;
| publisher = Cambridge University Press &lt;br /&gt;
| year = 1987 &lt;br /&gt;
| isbn = 0-521-42443-7&lt;br /&gt;
| pages = page 97&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; and is a slight extension of an example on slide 9 of this lecture.&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.cs.princeton.edu/~rywang/99f126/slides/16th.pdf&lt;br /&gt;
| title = Lecture notes: Formal Languages&lt;br /&gt;
| accessdate = 2012-04-07}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase''         # A ''Sentence'' consists of a ''NounPhrase'' followed by a ''VerbPhrase''&lt;br /&gt;
 ''NounPhrase'' -&amp;gt;  ''Determiner'' ''Noun''               # A ''NounPhrase'' consists of a ''Determiner'' followed by a ''Noun''&lt;br /&gt;
 ''VerbPhrase'' -&amp;gt;  ''Verb'' ''NounPhrase''               # A ''VerbPhrase'' consists of a ''Verb'' followed by a ''NounPhrase''&lt;br /&gt;
 ''Determiner'' -&amp;gt;  '''a''', '''the'''                        # A ''Determiner''  is one of: '''a''' or '''the'''&lt;br /&gt;
 ''Noun''       -&amp;gt;  '''boy''', '''girl''', '''dog'''                # A ''Noun'' is one of: '''boy''' or '''girl''' or '''dog'''  &lt;br /&gt;
 ''Verb''       -&amp;gt;  '''chased''', '''heard''', '''saw'''            # A ''Verb'' is one of: '''chased''' or '''heard''' or '''saw'''&lt;br /&gt;
&lt;br /&gt;
Notation used above: &lt;br /&gt;
:The symbol &amp;quot;-&amp;gt;&amp;quot; means &amp;quot;can be replaced by&amp;quot;.  &lt;br /&gt;
:When there are several items on the right hand side separated by commas, just one of these items can be selected. &lt;br /&gt;
:The comments preceded by &amp;quot;#&amp;quot; are not part of the generative grammar, but hopefully will help folks understand the example a little better.&lt;br /&gt;
&lt;br /&gt;
By making appropriate substitutions we can generate such sentences as:&lt;br /&gt;
:The dog chased a girl.&lt;br /&gt;
:The girl heard the dog.&lt;br /&gt;
:The boy saw a girl.&lt;br /&gt;
&lt;br /&gt;
The stages in the generation of these examples are as follows:&lt;br /&gt;
:''Sentence''&lt;br /&gt;
:-&amp;gt; ''NounPhrase'' ''VerbPhrase''&lt;br /&gt;
:-&amp;gt; ''Determiner'' ''Noun'' ''Verb'' ''NounPhrase''&lt;br /&gt;
:-&amp;gt; ''Determiner'' ''Noun'' ''Verb'' ''Determiner'' ''Noun''&lt;br /&gt;
&lt;br /&gt;
By appropriate selection of words to substitute for ''Determiner'', ''Noun'', and ''Verb'' we can produce the 3 example sentences above.&lt;br /&gt;
&lt;br /&gt;
The simple grammar defines a few words which can be substituted for ''Determiner'', ''Noun'', and ''Verb''. There are two possibilities for ''Determiner'', three for ''Noun'', and three for ''Verb'', with both ''Determiner'' and ''Noun'' appearing twice in the expansion. Hence the total number of grammatical sentences which can be generated by this simple grammar is 108 (= 2 * 3 * 3 * 2 * 3). In this particular case the possible words have been carefully chosen so that all of these 108 sentences also actually mean something.&lt;br /&gt;
&lt;br /&gt;
Note that the use of ''italics'' and '''boldface''' in this example is merely a convenient way of indicating the difference between items which can be expanded further (e.g. concepts such as ''NounPhrase'') and items which can not be expanded further (e.g. words such as '''girl'''). In the linguistic literature, items which can be expanded further are referred to as 'non-terminal' items, while items which can't be expanded further are known as 'terminal' items.&lt;br /&gt;
&lt;br /&gt;
The 'comma' notation for alternatives is a form of shorthand. In some formulations this would be shown as several separate rules, so that:&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''a''', '''the''' &lt;br /&gt;
could be shown as two rules:&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''a'''&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''the''' &lt;br /&gt;
&lt;br /&gt;
==Caution==&lt;br /&gt;
While a generative grammar may produce sentences which are grammatically correct, there is no certainty that such sentences will actually mean anything. The classic example of such a meaningless sentence is from Chomsky's book&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite book &lt;br /&gt;
| last = Chomsky &lt;br /&gt;
| first = Noam &lt;br /&gt;
| title = Syntactic Structures &lt;br /&gt;
| year = 1957 &lt;br /&gt;
| publisher = Mouton &lt;br /&gt;
| location = The Hague/Paris &lt;br /&gt;
| pages = page 15 &lt;br /&gt;
| isbn = 3-11-017279-8&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; with the grammatically correct sentence:&lt;br /&gt;
&lt;br /&gt;
:&amp;quot;Colorless green ideas sleep furiously.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
:This example illustrates the difference between grammar/syntax and meaning/semantics.&lt;br /&gt;
&lt;br /&gt;
Another problem when analysing a sentence is that many English words have multiple meanings, so that there may be more than one way to interpret a sentence. A simple example is the sentence: &lt;br /&gt;
:&amp;quot;Time flies.&amp;quot; &lt;br /&gt;
:Is this an instruction to check how fast flies are flying, or an indication that time appears to be passing quickly? &lt;br /&gt;
:A varied and entertaining selection of such ambiguities has been compiled by Jeff Gray.&amp;lt;ref&amp;gt;{{Cite web &lt;br /&gt;
| title = Collection of Ambiguous or Inconsistent/Incomplete Statements  &lt;br /&gt;
| url = http://www.gray-area.org/Research/Ambig/ &lt;br /&gt;
| author = Jeff Gray&lt;br /&gt;
| accessdate = 2012-04-10&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Formal grammar==&lt;br /&gt;
'''Note''': this section and subsequent sections are, by necessity, slightly more technical/formal than the earlier parts of this article, though specialist notation has been largely avoided. Make sure that you understand the 'Simple example' above before proceeding further, since references will be made to that example to help explain the technicalities, and variations on that example will be used to illustrate new ideas. An attempt has been made to avoid formal linguistic abbreviations and unexplained jargon.&lt;br /&gt;
&lt;br /&gt;
A formal generative grammar has four components (see slide 19 of this lecture&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://adammikeal.org/courses/compute/Chomsky%20Presentation.pdf&lt;br /&gt;
| title = The Chomsky Hierarchy&lt;br /&gt;
| accessdate = 2012-04-06&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
):&lt;br /&gt;
# a finite number of non-terminal concepts (e.g. ''VerbPhrase'' in the example, or anything else in ''italics''),&lt;br /&gt;
# a finite number of terminal items (e.g. '''girl''' in the example, or anything else in '''bold-face''').&lt;br /&gt;
# a finite set of rules for transforming non-terminal items (e.g. the example has 6 rules).&lt;br /&gt;
# a single starting point (e.g. ''Sentence'' in the example).&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
:Any item which appears on the left-hand side of a transformation rule is non-terminal since it can be replaced by something else; apart from the starting point, all other non-terminals must also appear somewhere on the right-hand side of transformation rule.&lt;br /&gt;
:An item which appears only on the right-hand side of a transformation rule is a terminal item, since it can not be transformed further.&lt;br /&gt;
:A list of all the terminal items is effectively the vocabulary from which sentences are built.&lt;br /&gt;
:Linguists have developed various classes of grammars by using constraints to govern what sort of rules can be used for any particular grammar.&lt;br /&gt;
&lt;br /&gt;
===Changing the rules===&lt;br /&gt;
An relatively small change to even a single rule can make a large change in the language which can be generated. For example, change the first rule in the simple example to read:&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''NounPhrase'' ''VerbPhrase'' '''and''' ''NounPhrase'' ''VerbPhrase''&lt;br /&gt;
This means that a ''Sentence'' is either a ''NounPhrase'' followed by a ''VerbPhrase'' or a ''NounPhrase'' followed by a ''VerbPhrase'' followed by '''and''' followed by a ''NounPhrase'' followed by a ''VerbPhrase''. In addition to the shorter sentences already discussed, this could also generate a sentence such as: &amp;quot;A dog saw a girl and the dog chased the girl&amp;quot;. The total number of grammatically-correct sentences which can be generated by this modified grammar is now 11,772 (108 + 108*108), though some of these may not be very meaingful.&lt;br /&gt;
&lt;br /&gt;
===Towards infinity===&lt;br /&gt;
A significantly different rule change can have an astounding effect. Consider changing the first rule to read:&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''NounPhrase'' ''VerbPhrase'' '''and''' ''Sentence''&lt;br /&gt;
This can generate a potentially infinite number of sentences (any number of these five-word sentences linked by '''and'''). This is an example of what is known as a [[Recursion|recursive]] definition, whereby a ''Sentence'' is partially defined in terms of itself. In such a recursive rule there must be at least one transformation option which does not involve ''Sentence'', otherwise the transformation could never stop.&lt;br /&gt;
&lt;br /&gt;
The above change is known as right-recursive; a left-recursive formulation is also possible, and can in this example generate exactly the same sentences. As shown below  under 'Context-free grammar', there are situations where the choice of left- or right-recursive formulations can change the meaning. &lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''Sentence'' '''and''' ''NounPhrase'' ''VerbPhrase'' &lt;br /&gt;
&lt;br /&gt;
The distinction between left- and right-recursive grammars becomes important when trying to parse/analyse a sentence; some types of parser work best with left-recursive grammars, while other types work best with right-recursive grammars. This distinction is particularly relevant in connection with [[compiler|compiling or translating]] a program written in some high-level [[programming language]] so that it can be used on a [[computer]].&lt;br /&gt;
&lt;br /&gt;
==Chomsky hierarchy==&lt;br /&gt;
By imposing different constraints&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.cs.uaf.edu/2011/spring/cs331/lectures/cs331_20110124_grammar.html&lt;br /&gt;
| title = Lecture notes: Languages &amp;amp; Grammars&lt;br /&gt;
| accessdate = 2012-04-07&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; &lt;br /&gt;
as to what sort of transformation rules could be used, Chomsky was able to define four strictly nested transformational grammars, which he numbered from 0 to 3. As the grammar number increases, the generated language becomes simpler. As the grammar number decreases, parsing a sentence in that language becomes more difficult. The following table provides a summary, which is then explained further in the subsequent subsections.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!| Chomsky&amp;lt;br&amp;gt;number || linguistic name || Rule constraints || Recogniser+ || Notes &lt;br /&gt;
|-&lt;br /&gt;
| 0 || recursively enumerable || [anything] -&amp;gt; [anything] || Turing machine || most human languages &lt;br /&gt;
|-&lt;br /&gt;
| 1 || context-sensitive || X ''A'' Y -&amp;gt; X [anything] Y || linear bounded automaton || X and Y provide the context in which ''A'' can be transformed &lt;br /&gt;
|-&lt;br /&gt;
| 2 || context-free || ''A'' -&amp;gt; [anything] || non-deterministic push-down automaton || syntax analysis for most programming languages &lt;br /&gt;
|-&lt;br /&gt;
| 3 || regular || ''A'' -&amp;gt; [nothing]&amp;lt;br&amp;gt;''A'' -&amp;gt; '''xyz'''&amp;lt;br&amp;gt;''A'' -&amp;gt; '''xyz''' ''B'' || finite automaton&amp;lt;br&amp;gt;or finite state machine || lexical analysis (combining characters into words/tokens)  &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''+''' The '''recogniser''' column indicates the type of mathematical or computer science theoretical model needed to recognise that a sentence belongs to a language, essentially by applying the transformation rules in reverse to work backwards from the actual words in order to finish up with a ''sentence'' (in programming languages the starting concept is usually a ''program''). A finite automaton uses only a small fixed amount of memory, operates in time proportional to the length of the input, and always reaches a decision, while a Turing machine may use an infinite amount of memory and time and may fail to reach a decision (may never stop).&lt;br /&gt;
&lt;br /&gt;
In the linguistic literature, [nothing] is often represented by the symbol '''ε'''.&lt;br /&gt;
&lt;br /&gt;
The descriptions of the various Chomsky levels which follow are presented in reverse order, so as to work up from a simple case to a rather complicated case.&lt;br /&gt;
&lt;br /&gt;
===Level 3: regular grammar===&lt;br /&gt;
The transformation rules for regular grammars are required to be very simple. &lt;br /&gt;
*Only a single non-terminal item can appear on the left-hand side of a rule.&lt;br /&gt;
*The right-hand side of any rule must be one of:&lt;br /&gt;
**[nothing].&lt;br /&gt;
**a terminal item.&lt;br /&gt;
**a terminal item followed by a non-terminal item.&lt;br /&gt;
Note that instead of a terminal item we could have a non-terminal item whose transformation rule immediately resolves to a single terminal item, or to one of several terminal items.&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
Informally we can define a 'word' as a sequence of one or more ''Letter''s. The following regular grammar provides a more formal definition; for simplicity it is restricted to lower-case letters.&lt;br /&gt;
&lt;br /&gt;
 ''Word''     -&amp;gt; ''Letter'' ''PartWord''&lt;br /&gt;
 ''PartWord'' -&amp;gt; [nothing]&lt;br /&gt;
 ''PartWord'' -&amp;gt; ''Letter'' ''PartWord''&lt;br /&gt;
 ''Letter''   -&amp;gt; '''a''', '''b''', ... '''z'''&lt;br /&gt;
&lt;br /&gt;
Note that ''PartWord'' is recursively defined, with the recursion stopping if it is transformed into [nothing].&lt;br /&gt;
&lt;br /&gt;
For one-letter words we expand as: &lt;br /&gt;
:''Word'' -&amp;gt; ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' [nothing] -&amp;gt; ''Letter''&lt;br /&gt;
&lt;br /&gt;
For two-letter words we expand as: &lt;br /&gt;
:''Word'' -&amp;gt; ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' ''Letter'' [nothing] -&amp;gt;  ''Letter'' ''Letter''&lt;br /&gt;
&lt;br /&gt;
Obviously, words of any length can be constructed, though they may well not actually be words from any language. &lt;br /&gt;
&lt;br /&gt;
====Discussion====&lt;br /&gt;
Trying to devise transformation rules to produce words which are more English-like is much more difficult - how do you insist on at least one vowel or on no more than 5 consecutive consonants (e.g. as in 'strengths').&lt;br /&gt;
&lt;br /&gt;
Further examples in [[Regular grammar]] show how numbers can be defined via a regular grammar, and also show how a hyphenated word could be defined.&lt;br /&gt;
&lt;br /&gt;
One of the limitations of a regular grammar is that it can't cope with nested matching brackets, so that it is impossible to write a regular grammar to describe an expression such as '''2 * (3+4)''' where that grammar is expected to allow brackets nested to any depth. A context-free grammar is needed for this, as described in the next section.&lt;br /&gt;
&lt;br /&gt;
Regular grammars or equivalent are widely used by [[compiler]]s in the lexical analysis of programming languages.&lt;br /&gt;
&lt;br /&gt;
===Level 2: context-free grammar===&lt;br /&gt;
The transformation rules for context-free grammars don't appear that much different from those for regular grammars. &lt;br /&gt;
*Only a single non-terminal item can appear on the left-hand side of a rule.&lt;br /&gt;
*The right-hand side of any rule must be one of:&lt;br /&gt;
**[nothing].&lt;br /&gt;
**any combination of terminal items and non-terminal items.&lt;br /&gt;
&lt;br /&gt;
The key difference is that in a regular grammar, any non-empty rule must effectively start with terminal item so that every rule transformation makes some immediate progress, while in a context-free grammar a rule could start with a non-terminal item which itself could be subject to arbitrary further transformations.&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
The following example shows how context-free grammars can cope with arithmetic expressions involving possibly nested brackets. Also an expression such as &amp;quot;2 + 3 * 4&amp;quot; could be interpreted as either &amp;quot;(2 + 3) * 4&amp;quot; = 20 or as &amp;quot;2 + (3 * 4)&amp;quot; = 14. The latter interpretation is that which is normally used - multiplication &amp;quot;*&amp;quot; is said to have a higher priority than addition &amp;quot;+&amp;quot; - so the grammar must incorporate this priority concept. Furthermore, consecutive operators of the same priority are normally applied from left to right, so that &amp;quot;8 - 2 + 3&amp;quot; is interpreted as &amp;quot;(8 - 2) + 3&amp;quot; = 9, rather than as &amp;quot;8 - (2 + 3)&amp;quot; = 3.  This ordering must also be built in to the grammar.&lt;br /&gt;
&lt;br /&gt;
To avoid distracting side-issues, this example only deals with numbers which consist solely of a single digit. The example is a simplified version of the definition of an arithmetic expression given in the Revised Algol 60 Report (Section 3.3.1).&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.masswerk.at/algol60/report.htm&lt;br /&gt;
| title = Revised Report on the Algorithmic Language Algol 60&lt;br /&gt;
| accessdate = 2012-04-22&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ''Expression'' -&amp;gt; ''Term''                        # an ''Expression'' is either a ''Term''&lt;br /&gt;
 ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''    #   or an ''Expression'' followed by '''+''' or '''-''' followed by a ''Term''&lt;br /&gt;
 ''Term''       -&amp;gt; ''Primary''                     # a ''Term'' is either a ''Primary''&lt;br /&gt;
 ''Term''       -&amp;gt; ''Term'' ''MulDivOp'' ''Primary''       #   or a ''Term'' followed by '''*''' or '''/''' followed by a ''Primary''&lt;br /&gt;
                                           #&lt;br /&gt;
 ''Primary''    -&amp;gt; ''Number''                      # a ''Primary'' is either a ''Number''&lt;br /&gt;
 ''Primary''    -&amp;gt; '''(''' ''Expression'' ''')'''              #   or an ''Expression'' enclosed in brackets&lt;br /&gt;
                                           #&lt;br /&gt;
 ''MulDivOp''   -&amp;gt; '''*'''. '''/'''                        # multiplication and division have the same priority&lt;br /&gt;
 ''AddSubOp''   -&amp;gt; '''+'''. '''-'''                        # addition and subtraction have the same priority&lt;br /&gt;
 ''Number''     -&amp;gt; '''0''', '''1''', ... '''9'''                 # this simple-minded definition of a ''Number'' is enough for this example&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
* Both ''Expression'' and ''Term'' are each defined via a left-recursive rule; this ensures that operators of the same priority are applied from left to right.&lt;br /&gt;
* The distinction between ''Expression'' and ''Term'' ensures that multiplication/division are applied before addition/subtraction.&lt;br /&gt;
* ''Expression'' is indirectly recursive via ''Term'' and ''Primary'' to allow bracketed sub-expressions to any depth.&lt;br /&gt;
&lt;br /&gt;
Example 1: generate 2 + 3 * 4&lt;br /&gt;
&lt;br /&gt;
  ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Term'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Primary'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' ''Term''                                 # '''+''' can not be applied until ''Term'' has been evaluated&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' ''Term'' ''MulDivOp'' ''Primary''&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' ''Primary'' ''MulDipOp'' ''Primary''&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' '''3''' '''*''' '''4'''&lt;br /&gt;
&lt;br /&gt;
Example 2: generate 2 * 3 + 4&lt;br /&gt;
&lt;br /&gt;
  ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Term'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Term'' ''MulDivOp'' ''Primary'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Primary'' ''MulDivOp'' ''Primary'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; '''2''' '''*''' '''3''' ''AddSubOp'' ''Term''                      # ''Term'' to left of ''AddSubOp'' is evaluated first&lt;br /&gt;
             -&amp;gt; '''2''' '''*''' '''3''' ''AddSubOp'' ''Primary''  &lt;br /&gt;
             -&amp;gt; '''2''' '''*''' '''3''' '''+''' '''4'''&lt;br /&gt;
&lt;br /&gt;
====Discussion====&lt;br /&gt;
Context-free grammars (or equivalent definitions using Backus-Naur-Form) are widely used both to define the syntax of programming languages and to (semi-automatically) generate parsers for these languages.&lt;br /&gt;
&lt;br /&gt;
A limitation/feature of both regular grammars and context-free grammars is that the left-hand side of any rule is always a single non-terminal item, so any transformation is applied regardless of the context in which that non-terminal item appears.  A simple example which depends on context is the use of singular and plural nouns and verbs in English.  We say: '''the man runs''' or '''the men run''', but neither of '''the man run''' nor '''the men runs'''.  Which form of verb to use depends on the noun, i.e. there is a context dependency.&lt;br /&gt;
&lt;br /&gt;
===Level 1: context-sensitive grammar===&lt;br /&gt;
For context-sensitive grammars the left-hand side of a rule may indicate the context in which that rule applies, so that the same non-terminal item may be transformed in different ways depending on the context in which it appears.&lt;br /&gt;
&lt;br /&gt;
There is only one transformation rule for context-sensitive grammars:&lt;br /&gt;
&lt;br /&gt;
 X [non-terminal] Y -&amp;gt; X [anything] Y&lt;br /&gt;
&lt;br /&gt;
where X and Y determine the context in which the [non-terminal] is transformed. Note that X and Y may each be terminals or non-terminals or [nothing]. When both X and Y are nothing there is no context and this reduces to a Level 2 or Level 3 grammar.&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
Taylor has provided several examples&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.divms.uiowa.edu/~fleck/taylor.pdf&lt;br /&gt;
| title = Context-sensitive Examples&lt;br /&gt;
| author = Taylor&lt;br /&gt;
| accessdate = 2012-04-26&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
and the following, inspired by his third example, is an extension of the original simple example above to handle singulars and plurals:&lt;br /&gt;
&lt;br /&gt;
 ''Sentence''                -&amp;gt;  ''NounPhrase'' ''VerbPhrase''            # simple sentence structure&lt;br /&gt;
 ''NounPhrase''              -&amp;gt;  ''Determiner'' ''Noun''                  # simple phrase structure&lt;br /&gt;
 ''VerbPhrase''              -&amp;gt;  ''Verb'' ''NounPhrase''                  # simple phrase structure&lt;br /&gt;
                                                              #&lt;br /&gt;
 ''Noun''                    -&amp;gt;  ''SingularNoun'', ''PluralNoun''         # nouns can be singular or plural &lt;br /&gt;
                                                              #&lt;br /&gt;
 ''Determiner'' ''SingularNoun'' -&amp;gt;  ''SingularDeterminer'' ''SingularNoun''  # context-sensitive:&lt;br /&gt;
 ''Determiner'' ''PluralNoun''   -&amp;gt;  ''PluralDeterminer'' ''PluralNoun''      #    determiner must agree with noun&lt;br /&gt;
                                                              #&lt;br /&gt;
 ''SingularNoun'' ''Verb''       -&amp;gt;  ''SingularNoun'' ''SingularVerb''        # context-sensitive: &lt;br /&gt;
 ''PluralNoun'' ''Verb''         -&amp;gt;  ''PluralNoun'' ''PluralVerb''            #    verb must agree with noun&lt;br /&gt;
                                                              #&lt;br /&gt;
 ''SingularDeterminer''      -&amp;gt;  '''a''', '''the'''                           # singular determiners&lt;br /&gt;
 ''PluralDeterminer''        -&amp;gt;  '''the'''                              # plural determiners&lt;br /&gt;
                                                              #&lt;br /&gt;
 ''SingularNoun''            -&amp;gt;  '''boy''', '''sheep''', '''dog'''                  # singular nouns&lt;br /&gt;
 ''PluralNoun''              -&amp;gt;  '''boys''', '''sheep''', '''dogs'''                # plural nouns&lt;br /&gt;
                                                              #&lt;br /&gt;
 ''SingularVerb''            -&amp;gt;  '''chases''', '''hears''', '''sees'''              # singular verbs&lt;br /&gt;
 ''PluralVerb''              -&amp;gt;  '''chase''', '''hear''', '''see'''                 # plural verbs&lt;br /&gt;
&lt;br /&gt;
The above grammar can generate sentences such as: '''a boy chases a dog''', '''the boys chase a dog''', etc. Because some words have the same form in both singular and plural, it can also generate meaningful (and grammatically-correct) sentences such as: '''the sheep sees the dog''', '''the sheep see the dog'''.&lt;br /&gt;
&lt;br /&gt;
But the above grammar can NOT generate sentences such as: '''a boys chases the sheep''', since this would violate the context-sensitive rules.&lt;br /&gt;
&lt;br /&gt;
====Discussion====&lt;br /&gt;
It is in fact possible to handle singular/plural issues by using only a Level 2 context-free grammar, but the above rules expressed as a Level 1 context-sensitive grammar are a closer match to ordinary concepts of English grammar (e.g. nouns and verbs must agree in number i.e. singular/plural).&lt;br /&gt;
&lt;br /&gt;
===Level 0===&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[category:linguistics]]&lt;br /&gt;
[[Category:Computer Science]]&lt;/div&gt;</summary>
		<author><name>RolandPlankton</name></author>
	</entry>
	<entry>
		<id>https://www.conservapedia.com/index.php?title=Chomsky_hierarchy&amp;diff=979762</id>
		<title>Chomsky hierarchy</title>
		<link rel="alternate" type="text/html" href="https://www.conservapedia.com/index.php?title=Chomsky_hierarchy&amp;diff=979762"/>
		<updated>2012-05-05T16:29:59Z</updated>

		<summary type="html">&lt;p&gt;RolandPlankton: /* Level 1 */ add a few examples&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The '''Chomsky hierarchy''', sometimes known as the '''Chomsky-Schützenberger hierarchy''', is a hierarchy of formal grammatical systems for describing various classes of languages; the hierarchy can apply to both human and computer languages. This hierarchy was first published in 1956 by [[Noam Chomsky|Chomsky]].&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite journal &lt;br /&gt;
| title = Three models for the description of language &lt;br /&gt;
| year = 1956 &lt;br /&gt;
| last = Chomsky &lt;br /&gt;
| first = Noam &lt;br /&gt;
| journal = IRE Transactions on Information Theory &lt;br /&gt;
| volume = 2 &lt;br /&gt;
| pages = 113–124 &lt;br /&gt;
| url = http://www.chomsky.info/articles/195609--.pdf &lt;br /&gt;
| accessdate = 2012-04-08&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
These grammatical systems were referred to by Chomsky as ''transformational grammars''.  Other linguists have since developed a variety of similar grammars; together these are known as ''generative grammars''. &lt;br /&gt;
&lt;br /&gt;
The basic idea of a '''generative grammar''' is to provide a set of rules which are capable of generating all possible grammatical sentences in some language; the rules must constrain the generation so that only grammatical sentences are generated. The rules can also be used in reverse to parse a sentence and check if it is grammatical.&lt;br /&gt;
&lt;br /&gt;
In the late 1950's, [[John Backus]] and Peter Naur developed a notation for describing [[programming language]]s. This notation is known as [[Backus Naur Form]] (or BNF) and turns out to be equivalent to Chomsky's grammar number two (context-free grammar), although it was developed independently of Chomsky's work. Backus-Naur Form was first used in the Algol 60 Report to specify the syntax of [[Algol 60]], and has since been used for specifying the syntax of other programming languages. &lt;br /&gt;
&lt;br /&gt;
==Example of a very simple generative grammar==&lt;br /&gt;
This very simple example can handle only a tiny subset of English and should not be taken seriously as a guide to English grammar or vocabulary. It is based on an example by David Crystal&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite book &lt;br /&gt;
| last = Crystal &lt;br /&gt;
| first = David  &lt;br /&gt;
| title = The Cambridge Encyclopedia of Language &lt;br /&gt;
| publisher = Cambridge University Press &lt;br /&gt;
| year = 1987 &lt;br /&gt;
| isbn = 0-521-42443-7&lt;br /&gt;
| pages = page 97&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; and is a slight extension of an example on slide 9 of this lecture.&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.cs.princeton.edu/~rywang/99f126/slides/16th.pdf&lt;br /&gt;
| title = Lecture notes: Formal Languages&lt;br /&gt;
| accessdate = 2012-04-07}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase''         # A ''Sentence'' consists of a ''NounPhrase'' followed by a ''VerbPhrase''&lt;br /&gt;
 ''NounPhrase'' -&amp;gt;  ''Determiner'' ''Noun''               # A ''NounPhrase'' consists of a ''Determiner'' followed by a ''Noun''&lt;br /&gt;
 ''VerbPhrase'' -&amp;gt;  ''Verb'' ''NounPhrase''               # A ''VerbPhrase'' consists of a ''Verb'' followed by a ''NounPhrase''&lt;br /&gt;
 ''Determiner'' -&amp;gt;  '''a''', '''the'''                        # A ''Determiner''  is one of: '''a''' or '''the'''&lt;br /&gt;
 ''Noun''       -&amp;gt;  '''boy''', '''girl''', '''dog'''                # A ''Noun'' is one of: '''boy''' or '''girl''' or '''dog'''  &lt;br /&gt;
 ''Verb''       -&amp;gt;  '''chased''', '''heard''', '''saw'''            # A ''Verb'' is one of: '''chased''' or '''heard''' or '''saw'''&lt;br /&gt;
&lt;br /&gt;
Notation used above: &lt;br /&gt;
:The symbol &amp;quot;-&amp;gt;&amp;quot; means &amp;quot;can be replaced by&amp;quot;.  &lt;br /&gt;
:When there are several items on the right hand side separated by commas, just one of these items can be selected. &lt;br /&gt;
:The comments preceded by &amp;quot;#&amp;quot; are not part of the generative grammar, but hopefully will help folks understand the example a little better.&lt;br /&gt;
&lt;br /&gt;
By making appropriate substitutions we can generate such sentences as:&lt;br /&gt;
:The dog chased a girl.&lt;br /&gt;
:The girl heard the dog.&lt;br /&gt;
:The boy saw a girl.&lt;br /&gt;
&lt;br /&gt;
The stages in the generation of these examples are as follows:&lt;br /&gt;
:''Sentence''&lt;br /&gt;
:-&amp;gt; ''NounPhrase'' ''VerbPhrase''&lt;br /&gt;
:-&amp;gt; ''Determiner'' ''Noun'' ''Verb'' ''NounPhrase''&lt;br /&gt;
:-&amp;gt; ''Determiner'' ''Noun'' ''Verb'' ''Determiner'' ''Noun''&lt;br /&gt;
&lt;br /&gt;
By appropriate selection of words to substitute for ''Determiner'', ''Noun'', and ''Verb'' we can produce the 3 example sentences above.&lt;br /&gt;
&lt;br /&gt;
The simple grammar defines a few words which can be substituted for ''Determiner'', ''Noun'', and ''Verb''. There are two possibilities for ''Determiner'', three for ''Noun'', and three for ''Verb'', with both ''Determiner'' and ''Noun'' appearing twice in the expansion. Hence the total number of grammatical sentences which can be generated by this simple grammar is 108 (= 2 * 3 * 3 * 2 * 3). In this particular case the possible words have been carefully chosen so that all of these 108 sentences also actually mean something.&lt;br /&gt;
&lt;br /&gt;
Note that the use of ''italics'' and '''boldface''' in this example is merely a convenient way of indicating the difference between items which can be expanded further (e.g. concepts such as ''NounPhrase'') and items which can not be expanded further (e.g. words such as '''girl'''). In the linguistic literature, items which can be expanded further are referred to as 'non-terminal' items, while items which can't be expanded further are known as 'terminal' items.&lt;br /&gt;
&lt;br /&gt;
The 'comma' notation for alternatives is a form of shorthand. In some formulations this would be shown as several separate rules, so that:&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''a''', '''the''' &lt;br /&gt;
could be shown as two rules:&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''a'''&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''the''' &lt;br /&gt;
&lt;br /&gt;
==Caution==&lt;br /&gt;
While a generative grammar may produce sentences which are grammatically correct, there is no certainty that such sentences will actually mean anything. The classic example of such a meaningless sentence is from Chomsky's book&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite book &lt;br /&gt;
| last = Chomsky &lt;br /&gt;
| first = Noam &lt;br /&gt;
| title = Syntactic Structures &lt;br /&gt;
| year = 1957 &lt;br /&gt;
| publisher = Mouton &lt;br /&gt;
| location = The Hague/Paris &lt;br /&gt;
| pages = page 15 &lt;br /&gt;
| isbn = 3-11-017279-8&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; with the grammatically correct sentence:&lt;br /&gt;
&lt;br /&gt;
:&amp;quot;Colorless green ideas sleep furiously.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
:This example illustrates the difference between grammar/syntax and meaning/semantics.&lt;br /&gt;
&lt;br /&gt;
Another problem when analysing a sentence is that many English words have multiple meanings, so that there may be more than one way to interpret a sentence. A simple example is the sentence: &lt;br /&gt;
:&amp;quot;Time flies.&amp;quot; &lt;br /&gt;
:Is this an instruction to check how fast flies are flying, or an indication that time appears to be passing quickly? &lt;br /&gt;
:A varied and entertaining selection of such ambiguities has been compiled by Jeff Gray.&amp;lt;ref&amp;gt;{{Cite web &lt;br /&gt;
| title = Collection of Ambiguous or Inconsistent/Incomplete Statements  &lt;br /&gt;
| url = http://www.gray-area.org/Research/Ambig/ &lt;br /&gt;
| author = Jeff Gray&lt;br /&gt;
| accessdate = 2012-04-10&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Formal grammar==&lt;br /&gt;
'''Note''': this section and subsequent sections are, by necessity, slightly more technical/formal than the earlier parts of this article, though specialist notation has been largely avoided. Make sure that you understand the 'Simple example' above before proceeding further, since references will be made to that example to help explain the technicalities, and variations on that example will be used to illustrate new ideas. An attempt has been made to avoid formal linguistic abbreviations and unexplained jargon.&lt;br /&gt;
&lt;br /&gt;
A formal generative grammar has four components (see slide 19 of this lecture&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://adammikeal.org/courses/compute/Chomsky%20Presentation.pdf&lt;br /&gt;
| title = The Chomsky Hierarchy&lt;br /&gt;
| accessdate = 2012-04-06&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
):&lt;br /&gt;
# a finite number of non-terminal concepts (e.g. ''VerbPhrase'' in the example, or anything else in ''italics''),&lt;br /&gt;
# a finite number of terminal items (e.g. '''girl''' in the example, or anything else in '''bold-face''').&lt;br /&gt;
# a finite set of rules for transforming non-terminal items (e.g. the example has 6 rules).&lt;br /&gt;
# a single starting point (e.g. ''Sentence'' in the example).&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
:Any item which appears on the left-hand side of a transformation rule is non-terminal since it can be replaced by something else; apart from the starting point, all other non-terminals must also appear somewhere on the right-hand side of transformation rule.&lt;br /&gt;
:An item which appears only on the right-hand side of a transformation rule is a terminal item, since it can not be transformed further.&lt;br /&gt;
:A list of all the terminal items is effectively the vocabulary from which sentences are built.&lt;br /&gt;
:Linguists have developed various classes of grammars by using constraints to govern what sort of rules can be used for any particular grammar.&lt;br /&gt;
&lt;br /&gt;
===Changing the rules===&lt;br /&gt;
An relatively small change to even a single rule can make a large change in the language which can be generated. For example, change the first rule in the simple example to read:&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''NounPhrase'' ''VerbPhrase'' '''and''' ''NounPhrase'' ''VerbPhrase''&lt;br /&gt;
This means that a ''Sentence'' is either a ''NounPhrase'' followed by a ''VerbPhrase'' or a ''NounPhrase'' followed by a ''VerbPhrase'' followed by '''and''' followed by a ''NounPhrase'' followed by a ''VerbPhrase''. In addition to the shorter sentences already discussed, this could also generate a sentence such as: &amp;quot;A dog saw a girl and the dog chased the girl&amp;quot;. The total number of grammatically-correct sentences which can be generated by this modified grammar is now 11,772 (108 + 108*108), though some of these may not be very meaingful.&lt;br /&gt;
&lt;br /&gt;
===Towards infinity===&lt;br /&gt;
A significantly different rule change can have an astounding effect. Consider changing the first rule to read:&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''NounPhrase'' ''VerbPhrase'' '''and''' ''Sentence''&lt;br /&gt;
This can generate a potentially infinite number of sentences (any number of these five-word sentences linked by '''and'''). This is an example of what is known as a [[Recursion|recursive]] definition, whereby a ''Sentence'' is partially defined in terms of itself. In such a recursive rule there must be at least one transformation option which does not involve ''Sentence'', otherwise the transformation could never stop.&lt;br /&gt;
&lt;br /&gt;
The above change is known as right-recursive; a left-recursive formulation is also possible, and can in this example generate exactly the same sentences. As shown below  under 'Context-free grammar', there are situations where the choice of left- or right-recursive formulations can change the meaning. &lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''Sentence'' '''and''' ''NounPhrase'' ''VerbPhrase'' &lt;br /&gt;
&lt;br /&gt;
The distinction between left- and right-recursive grammars becomes important when trying to parse/analyse a sentence; some types of parser work best with left-recursive grammars, while other types work best with right-recursive grammars. This distinction is particularly relevant in connection with [[compiler|compiling or translating]] a program written in some high-level [[programming language]] so that it can be used on a [[computer]].&lt;br /&gt;
&lt;br /&gt;
==Chomsky hierarchy==&lt;br /&gt;
By imposing different constraints&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.cs.uaf.edu/2011/spring/cs331/lectures/cs331_20110124_grammar.html&lt;br /&gt;
| title = Lecture notes: Languages &amp;amp; Grammars&lt;br /&gt;
| accessdate = 2012-04-07&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; &lt;br /&gt;
as to what sort of transformation rules could be used, Chomsky was able to define four strictly nested transformational grammars, which he numbered from 0 to 3. As the grammar number increases, the generated language becomes simpler. As the grammar number decreases, parsing a sentence in that language becomes more difficult. The following table provides a summary, which is then explained further in the subsequent subsections.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!| Chomsky&amp;lt;br&amp;gt;number || linguistic name || Rule constraints || Recogniser+ || Notes &lt;br /&gt;
|-&lt;br /&gt;
| 0 || recursively enumerable || [anything] -&amp;gt; [anything] || Turing machine || most human languages &lt;br /&gt;
|-&lt;br /&gt;
| 1 || context-sensitive || X ''A'' Y -&amp;gt; X [anything] Y || linear bounded automaton || X and Y provide the context in which ''A'' can be transformed &lt;br /&gt;
|-&lt;br /&gt;
| 2 || context-free || ''A'' -&amp;gt; [anything] || non-deterministic push-down automaton || syntax analysis for most programming languages &lt;br /&gt;
|-&lt;br /&gt;
| 3 || regular || ''A'' -&amp;gt; [nothing]&amp;lt;br&amp;gt;''A'' -&amp;gt; '''xyz'''&amp;lt;br&amp;gt;''A'' -&amp;gt; '''xyz''' ''B'' || finite automaton&amp;lt;br&amp;gt;or finite state machine || lexical analysis (combining characters into words/tokens)  &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''+''' The '''recogniser''' column indicates the type of mathematical or computer science theoretical model needed to recognise that a sentence belongs to a language, essentially by applying the transformation rules in reverse to work backwards from the actual words in order to finish up with a ''sentence'' (in programming languages the starting concept is usually a ''program''). A finite automaton uses only a small fixed amount of memory, operates in time proportional to the length of the input, and always reaches a decision, while a Turing machine may use an infinite amount of memory and time and may fail to reach a decision (may never stop).&lt;br /&gt;
&lt;br /&gt;
In the linguistic literature, [nothing] is often represented by the symbol '''ε'''.&lt;br /&gt;
&lt;br /&gt;
The descriptions of the various Chomsky levels which follow are presented in reverse order, so as to work up from a simple case to a rather complicated case.&lt;br /&gt;
&lt;br /&gt;
===Level 3: regular grammar===&lt;br /&gt;
The transformation rules for regular grammars are required to be very simple. &lt;br /&gt;
*Only a single non-terminal item can appear on the left-hand side of a rule.&lt;br /&gt;
*The right-hand side of any rule must be one of:&lt;br /&gt;
**[nothing].&lt;br /&gt;
**a terminal item.&lt;br /&gt;
**a terminal item followed by a non-terminal item.&lt;br /&gt;
Note that instead of a terminal item we could have a non-terminal item whose transformation rule immediately resolves to a single terminal item, or to one of several terminal items.&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
Informally we can define a 'word' as a sequence of one or more ''Letter''s. The following regular grammar provides a more formal definition; for simplicity it is restricted to lower-case letters.&lt;br /&gt;
&lt;br /&gt;
 ''Word''     -&amp;gt; ''Letter'' ''PartWord''&lt;br /&gt;
 ''PartWord'' -&amp;gt; [nothing]&lt;br /&gt;
 ''PartWord'' -&amp;gt; ''Letter'' ''PartWord''&lt;br /&gt;
 ''Letter''   -&amp;gt; '''a''', '''b''', ... '''z'''&lt;br /&gt;
&lt;br /&gt;
Note that ''PartWord'' is recursively defined, with the recursion stopping if it is transformed into [nothing].&lt;br /&gt;
&lt;br /&gt;
For one-letter words we expand as: &lt;br /&gt;
:''Word'' -&amp;gt; ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' [nothing] -&amp;gt; ''Letter''&lt;br /&gt;
&lt;br /&gt;
For two-letter words we expand as: &lt;br /&gt;
:''Word'' -&amp;gt; ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' ''Letter'' [nothing] -&amp;gt;  ''Letter'' ''Letter''&lt;br /&gt;
&lt;br /&gt;
Obviously, words of any length can be constructed, though they may well not actually be words from any language. &lt;br /&gt;
&lt;br /&gt;
====Discussion====&lt;br /&gt;
Trying to devise transformation rules to produce words which are more English-like is much more difficult - how do you insist on at least one vowel or on no more than 5 consecutive consonants (e.g. as in 'strengths').&lt;br /&gt;
&lt;br /&gt;
Further examples in [[Regular grammar]] show how numbers can be defined via a regular grammar, and also show how a hyphenated word could be defined.&lt;br /&gt;
&lt;br /&gt;
One of the limitations of a regular grammar is that it can't cope with nested matching brackets, so that it is impossible to write a regular grammar to describe an expression such as '''2 * (3+4)''' where that grammar is expected to allow brackets nested to any depth. A context-free grammar is needed for this, as described in the next section.&lt;br /&gt;
&lt;br /&gt;
Regular grammars or equivalent are widely used by [[compiler]]s in the lexical analysis of programming languages.&lt;br /&gt;
&lt;br /&gt;
===Level 2: context-free grammar===&lt;br /&gt;
The transformation rules for context-free grammars don't appear that much different from those for regular grammars. &lt;br /&gt;
*Only a single non-terminal item can appear on the left-hand side of a rule.&lt;br /&gt;
*The right-hand side of any rule must be one of:&lt;br /&gt;
**[nothing].&lt;br /&gt;
**any combination of terminal items and non-terminal items.&lt;br /&gt;
&lt;br /&gt;
The key difference is that in a regular grammar, any non-empty rule must effectively start with terminal item so that every rule transformation makes some immediate progress, while in a context-free grammar a rule could start with a non-terminal item which itself could be subject to arbitrary further transformations.&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
The following example shows how context-free grammars can cope with arithmetic expressions involving possibly nested brackets. Also an expression such as &amp;quot;2 + 3 * 4&amp;quot; could be interpreted as either &amp;quot;(2 + 3) * 4&amp;quot; = 20 or as &amp;quot;2 + (3 * 4)&amp;quot; = 14. The latter interpretation is that which is normally used - multiplication &amp;quot;*&amp;quot; is said to have a higher priority than addition &amp;quot;+&amp;quot; - so the grammar must incorporate this priority concept. Furthermore, consecutive operators of the same priority are normally applied from left to right, so that &amp;quot;8 - 2 + 3&amp;quot; is interpreted as &amp;quot;(8 - 2) + 3&amp;quot; = 9, rather than as &amp;quot;8 - (2 + 3)&amp;quot; = 3.  This ordering must also be built in to the grammar.&lt;br /&gt;
&lt;br /&gt;
To avoid distracting side-issues, this example only deals with numbers which consist solely of a single digit. The example is a simplified version of the definition of an arithmetic expression given in the Revised Algol 60 Report (Section 3.3.1).&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.masswerk.at/algol60/report.htm&lt;br /&gt;
| title = Revised Report on the Algorithmic Language Algol 60&lt;br /&gt;
| accessdate = 2012-04-22&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ''Expression'' -&amp;gt; ''Term''                        # an ''Expression'' is either a ''Term''&lt;br /&gt;
 ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''    #   or an ''Expression'' followed by '''+''' or '''-''' followed by a ''Term''&lt;br /&gt;
 ''Term''       -&amp;gt; ''Primary''                     # a ''Term'' is either a ''Primary''&lt;br /&gt;
 ''Term''       -&amp;gt; ''Term'' ''MulDivOp'' ''Primary''       #   or a ''Term'' followed by '''*''' or '''/''' followed by a ''Primary''&lt;br /&gt;
                                           #&lt;br /&gt;
 ''Primary''    -&amp;gt; ''Number''                      # a ''Primary'' is either a ''Number''&lt;br /&gt;
 ''Primary''    -&amp;gt; '''(''' ''Expression'' ''')'''              #   or an ''Expression'' enclosed in brackets&lt;br /&gt;
                                           #&lt;br /&gt;
 ''MulDivOp''   -&amp;gt; '''*'''. '''/'''                        # multiplication and division have the same priority&lt;br /&gt;
 ''AddSubOp''   -&amp;gt; '''+'''. '''-'''                        # addition and subtraction have the same priority&lt;br /&gt;
 ''Number''     -&amp;gt; '''0''', '''1''', ... '''9'''                 # this simple-minded definition of a ''Number'' is enough for this example&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
* Both ''Expression'' and ''Term'' are each defined via a left-recursive rule; this ensures that operators of the same priority are applied from left to right.&lt;br /&gt;
* The distinction between ''Expression'' and ''Term'' ensures that multiplication/division are applied before addition/subtraction.&lt;br /&gt;
* ''Expression'' is indirectly recursive via ''Term'' and ''Primary'' to allow bracketed sub-expressions to any depth.&lt;br /&gt;
&lt;br /&gt;
Example 1: generate 2 + 3 * 4&lt;br /&gt;
&lt;br /&gt;
  ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Term'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Primary'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' ''Term''                                 # '''+''' can not be applied until ''Term'' has been evaluated&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' ''Term'' ''MulDivOp'' ''Primary''&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' ''Primary'' ''MulDipOp'' ''Primary''&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' '''3''' '''*''' '''4'''&lt;br /&gt;
&lt;br /&gt;
Example 2: generate 2 * 3 + 4&lt;br /&gt;
&lt;br /&gt;
  ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Term'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Term'' ''MulDivOp'' ''Primary'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Primary'' ''MulDivOp'' ''Primary'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; '''2''' '''*''' '''3''' ''AddSubOp'' ''Term''                      # ''Term'' to left of ''AddSubOp'' is evaluated first&lt;br /&gt;
             -&amp;gt; '''2''' '''*''' '''3''' ''AddSubOp'' ''Primary''  &lt;br /&gt;
             -&amp;gt; '''2''' '''*''' '''3''' '''+''' '''4'''&lt;br /&gt;
&lt;br /&gt;
====Discussion====&lt;br /&gt;
Context-free grammars (or equivalent definitions using Backus-Naur-Form) are widely used both to define the syntax of programming languages and to (semi-automatically) generate parsers for these languages.&lt;br /&gt;
&lt;br /&gt;
A limitation/feature of both regular grammars and context-free grammars is that the left-hand side of any rule is always a single non-terminal item, so any transformation is applied regardless of the context in which that non-terminal item appears.  A simple example which depends on context is the use of singular and plural nouns and verbs in English.  We say: '''the man runs''' or '''the men run''', but neither of '''the man run''' nor '''the men runs'''.  Which form of verb to use depends on the noun, i.e. there is a context dependency.&lt;br /&gt;
&lt;br /&gt;
===Level 1: context-sensitive grammar===&lt;br /&gt;
For context-sensitive grammars the left-hand side of a rule may indicate the context in which that rule applies, so that the same non-terminal item may be transformed in different ways depending on the context in which it appears.&lt;br /&gt;
&lt;br /&gt;
There is only one transformation rule for context-sensitive grammars:&lt;br /&gt;
&lt;br /&gt;
 X [non-terminal] Y -&amp;gt; X [anything] Y&lt;br /&gt;
&lt;br /&gt;
where X and Y determine the context in which the [non-terminal] is transformed. Note that X and Y may each be terminals or non-terminals or [nothing]. When both X and Y are nothing there is no context and this reduces to a Level 2 or Level 3 grammar.&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
Taylor has provided several examples&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.divms.uiowa.edu/~fleck/taylor.pdf&lt;br /&gt;
| title = Context-sensitive Examples&lt;br /&gt;
| author = Taylor&lt;br /&gt;
| accessdate = 2012-04-26&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
and the following, inspired by his third example, is an extension of the original simple example above to handle singulars and plurals:&lt;br /&gt;
&lt;br /&gt;
 ''Sentence''                -&amp;gt;  ''NounPhrase'' ''VerbPhrase''            # simple sentence structure&lt;br /&gt;
 ''NounPhrase''              -&amp;gt;  ''Determiner'' ''Noun''                  # simple phrase structure&lt;br /&gt;
 ''VerbPhrase''              -&amp;gt;  ''Verb'' ''NounPhrase''                  # simple phrase structure&lt;br /&gt;
                                                              #&lt;br /&gt;
 ''Noun''                    -&amp;gt;  ''SingularNoun'', ''PluralNoun''         # nouns can be singular or plural &lt;br /&gt;
                                                              #&lt;br /&gt;
 ''Determiner'' ''SingularNoun'' -&amp;gt;  ''SingularDeterminer'' ''SingularNoun''  # context-sensitive:&lt;br /&gt;
 ''Determiner'' ''PluralNoun''   -&amp;gt;  ''PluralDeterminer'' ''PluralNoun''      #    determiner must agree with noun&lt;br /&gt;
                                                              #&lt;br /&gt;
 ''SingularNoun'' ''Verb''       -&amp;gt;  ''SingularNoun'' ''SingularVerb''        # context-sensitive: &lt;br /&gt;
 ''PluralNoun'' ''Verb''         -&amp;gt;  ''PluralNoun'' ''PluralVerb''            #    verb must agree with noun&lt;br /&gt;
                                                              #&lt;br /&gt;
 ''SingularDeterminer''      -&amp;gt;  '''a''', '''the'''                           # singular determiners&lt;br /&gt;
 ''PluralDeterminer''        -&amp;gt;  '''the'''                              # plural determiners&lt;br /&gt;
                                                              #&lt;br /&gt;
 ''SingularNoun''            -&amp;gt;  '''boy''', '''sheep''', '''dog'''                  # singular nouns&lt;br /&gt;
 ''PluralNoun''              -&amp;gt;  '''boys''', '''sheep''', '''dogs'''                # plural nouns&lt;br /&gt;
                                                              #&lt;br /&gt;
 ''SingularVerb''            -&amp;gt;  '''chases''', '''hears''', '''sees'''              # singular verbs&lt;br /&gt;
 ''PluralVerb''              -&amp;gt;  '''chase''', '''hear''', '''see'''                 # plural verbs&lt;br /&gt;
&lt;br /&gt;
The above grammar can generate sentences such as: '''a boy chases a dog''', '''the boys chase a dog''', etc. Because some words have the same form in both singular and plural, it can also generate meaningful (and grammatically-correct) sentences such as: '''the sheep sees the dog''', '''the sheep see the dog'''.&lt;br /&gt;
&lt;br /&gt;
But the above grammar can NOT generate sentences such as: '''a boys chases the sheep''', since this would violate the context-sensitive rules.&lt;br /&gt;
&lt;br /&gt;
===Level 0===&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[category:linguistics]]&lt;br /&gt;
[[Category:Computer Science]]&lt;/div&gt;</summary>
		<author><name>RolandPlankton</name></author>
	</entry>
	<entry>
		<id>https://www.conservapedia.com/index.php?title=Chomsky_hierarchy&amp;diff=979425</id>
		<title>Chomsky hierarchy</title>
		<link rel="alternate" type="text/html" href="https://www.conservapedia.com/index.php?title=Chomsky_hierarchy&amp;diff=979425"/>
		<updated>2012-05-03T21:21:35Z</updated>

		<summary type="html">&lt;p&gt;RolandPlankton: /* Chomsky hierarchy */ add context-sensitive example&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The '''Chomsky hierarchy''', sometimes known as the '''Chomsky-Schützenberger hierarchy''', is a hierarchy of formal grammatical systems for describing various classes of languages; the hierarchy can apply to both human and computer languages. This hierarchy was first published in 1956 by [[Noam Chomsky|Chomsky]].&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite journal &lt;br /&gt;
| title = Three models for the description of language &lt;br /&gt;
| year = 1956 &lt;br /&gt;
| last = Chomsky &lt;br /&gt;
| first = Noam &lt;br /&gt;
| journal = IRE Transactions on Information Theory &lt;br /&gt;
| volume = 2 &lt;br /&gt;
| pages = 113–124 &lt;br /&gt;
| url = http://www.chomsky.info/articles/195609--.pdf &lt;br /&gt;
| accessdate = 2012-04-08&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
These grammatical systems were referred to by Chomsky as ''transformational grammars''.  Other linguists have since developed a variety of similar grammars; together these are known as ''generative grammars''. &lt;br /&gt;
&lt;br /&gt;
The basic idea of a '''generative grammar''' is to provide a set of rules which are capable of generating all possible grammatical sentences in some language; the rules must constrain the generation so that only grammatical sentences are generated. The rules can also be used in reverse to parse a sentence and check if it is grammatical.&lt;br /&gt;
&lt;br /&gt;
In the late 1950's, [[John Backus]] and Peter Naur developed a notation for describing [[programming language]]s. This notation is known as [[Backus Naur Form]] (or BNF) and turns out to be equivalent to Chomsky's grammar number two (context-free grammar), although it was developed independently of Chomsky's work. Backus-Naur Form was first used in the Algol 60 Report to specify the syntax of [[Algol 60]], and has since been used for specifying the syntax of other programming languages. &lt;br /&gt;
&lt;br /&gt;
==Example of a very simple generative grammar==&lt;br /&gt;
This very simple example can handle only a tiny subset of English and should not be taken seriously as a guide to English grammar or vocabulary. It is based on an example by David Crystal&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite book &lt;br /&gt;
| last = Crystal &lt;br /&gt;
| first = David  &lt;br /&gt;
| title = The Cambridge Encyclopedia of Language &lt;br /&gt;
| publisher = Cambridge University Press &lt;br /&gt;
| year = 1987 &lt;br /&gt;
| isbn = 0-521-42443-7&lt;br /&gt;
| pages = page 97&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; and is a slight extension of an example on slide 9 of this lecture.&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.cs.princeton.edu/~rywang/99f126/slides/16th.pdf&lt;br /&gt;
| title = Lecture notes: Formal Languages&lt;br /&gt;
| accessdate = 2012-04-07}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase''         # A ''Sentence'' consists of a ''NounPhrase'' followed by a ''VerbPhrase''&lt;br /&gt;
 ''NounPhrase'' -&amp;gt;  ''Determiner'' ''Noun''               # A ''NounPhrase'' consists of a ''Determiner'' followed by a ''Noun''&lt;br /&gt;
 ''VerbPhrase'' -&amp;gt;  ''Verb'' ''NounPhrase''               # A ''VerbPhrase'' consists of a ''Verb'' followed by a ''NounPhrase''&lt;br /&gt;
 ''Determiner'' -&amp;gt;  '''a''', '''the'''                        # A ''Determiner''  is one of: '''a''' or '''the'''&lt;br /&gt;
 ''Noun''       -&amp;gt;  '''boy''', '''girl''', '''dog'''                # A ''Noun'' is one of: '''boy''' or '''girl''' or '''dog'''  &lt;br /&gt;
 ''Verb''       -&amp;gt;  '''chased''', '''heard''', '''saw'''            # A ''Verb'' is one of: '''chased''' or '''heard''' or '''saw'''&lt;br /&gt;
&lt;br /&gt;
Notation used above: &lt;br /&gt;
:The symbol &amp;quot;-&amp;gt;&amp;quot; means &amp;quot;can be replaced by&amp;quot;.  &lt;br /&gt;
:When there are several items on the right hand side separated by commas, just one of these items can be selected. &lt;br /&gt;
:The comments preceded by &amp;quot;#&amp;quot; are not part of the generative grammar, but hopefully will help folks understand the example a little better.&lt;br /&gt;
&lt;br /&gt;
By making appropriate substitutions we can generate such sentences as:&lt;br /&gt;
:The dog chased a girl.&lt;br /&gt;
:The girl heard the dog.&lt;br /&gt;
:The boy saw a girl.&lt;br /&gt;
&lt;br /&gt;
The stages in the generation of these examples are as follows:&lt;br /&gt;
:''Sentence''&lt;br /&gt;
:-&amp;gt; ''NounPhrase'' ''VerbPhrase''&lt;br /&gt;
:-&amp;gt; ''Determiner'' ''Noun'' ''Verb'' ''NounPhrase''&lt;br /&gt;
:-&amp;gt; ''Determiner'' ''Noun'' ''Verb'' ''Determiner'' ''Noun''&lt;br /&gt;
&lt;br /&gt;
By appropriate selection of words to substitute for ''Determiner'', ''Noun'', and ''Verb'' we can produce the 3 example sentences above.&lt;br /&gt;
&lt;br /&gt;
The simple grammar defines a few words which can be substituted for ''Determiner'', ''Noun'', and ''Verb''. There are two possibilities for ''Determiner'', three for ''Noun'', and three for ''Verb'', with both ''Determiner'' and ''Noun'' appearing twice in the expansion. Hence the total number of grammatical sentences which can be generated by this simple grammar is 108 (= 2 * 3 * 3 * 2 * 3). In this particular case the possible words have been carefully chosen so that all of these 108 sentences also actually mean something.&lt;br /&gt;
&lt;br /&gt;
Note that the use of ''italics'' and '''boldface''' in this example is merely a convenient way of indicating the difference between items which can be expanded further (e.g. concepts such as ''NounPhrase'') and items which can not be expanded further (e.g. words such as '''girl'''). In the linguistic literature, items which can be expanded further are referred to as 'non-terminal' items, while items which can't be expanded further are known as 'terminal' items.&lt;br /&gt;
&lt;br /&gt;
The 'comma' notation for alternatives is a form of shorthand. In some formulations this would be shown as several separate rules, so that:&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''a''', '''the''' &lt;br /&gt;
could be shown as two rules:&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''a'''&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''the''' &lt;br /&gt;
&lt;br /&gt;
==Caution==&lt;br /&gt;
While a generative grammar may produce sentences which are grammatically correct, there is no certainty that such sentences will actually mean anything. The classic example of such a meaningless sentence is from Chomsky's book&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite book &lt;br /&gt;
| last = Chomsky &lt;br /&gt;
| first = Noam &lt;br /&gt;
| title = Syntactic Structures &lt;br /&gt;
| year = 1957 &lt;br /&gt;
| publisher = Mouton &lt;br /&gt;
| location = The Hague/Paris &lt;br /&gt;
| pages = page 15 &lt;br /&gt;
| isbn = 3-11-017279-8&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; with the grammatically correct sentence:&lt;br /&gt;
&lt;br /&gt;
:&amp;quot;Colorless green ideas sleep furiously.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
:This example illustrates the difference between grammar/syntax and meaning/semantics.&lt;br /&gt;
&lt;br /&gt;
Another problem when analysing a sentence is that many English words have multiple meanings, so that there may be more than one way to interpret a sentence. A simple example is the sentence: &lt;br /&gt;
:&amp;quot;Time flies.&amp;quot; &lt;br /&gt;
:Is this an instruction to check how fast flies are flying, or an indication that time appears to be passing quickly? &lt;br /&gt;
:A varied and entertaining selection of such ambiguities has been compiled by Jeff Gray.&amp;lt;ref&amp;gt;{{Cite web &lt;br /&gt;
| title = Collection of Ambiguous or Inconsistent/Incomplete Statements  &lt;br /&gt;
| url = http://www.gray-area.org/Research/Ambig/ &lt;br /&gt;
| author = Jeff Gray&lt;br /&gt;
| accessdate = 2012-04-10&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Formal grammar==&lt;br /&gt;
'''Note''': this section and subsequent sections are, by necessity, slightly more technical/formal than the earlier parts of this article, though specialist notation has been largely avoided. Make sure that you understand the 'Simple example' above before proceeding further, since references will be made to that example to help explain the technicalities, and variations on that example will be used to illustrate new ideas. An attempt has been made to avoid formal linguistic abbreviations and unexplained jargon.&lt;br /&gt;
&lt;br /&gt;
A formal generative grammar has four components (see slide 19 of this lecture&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://adammikeal.org/courses/compute/Chomsky%20Presentation.pdf&lt;br /&gt;
| title = The Chomsky Hierarchy&lt;br /&gt;
| accessdate = 2012-04-06&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
):&lt;br /&gt;
# a finite number of non-terminal concepts (e.g. ''VerbPhrase'' in the example, or anything else in ''italics''),&lt;br /&gt;
# a finite number of terminal items (e.g. '''girl''' in the example, or anything else in '''bold-face''').&lt;br /&gt;
# a finite set of rules for transforming non-terminal items (e.g. the example has 6 rules).&lt;br /&gt;
# a single starting point (e.g. ''Sentence'' in the example).&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
:Any item which appears on the left-hand side of a transformation rule is non-terminal since it can be replaced by something else; apart from the starting point, all other non-terminals must also appear somewhere on the right-hand side of transformation rule.&lt;br /&gt;
:An item which appears only on the right-hand side of a transformation rule is a terminal item, since it can not be transformed further.&lt;br /&gt;
:A list of all the terminal items is effectively the vocabulary from which sentences are built.&lt;br /&gt;
:Linguists have developed various classes of grammars by using constraints to govern what sort of rules can be used for any particular grammar.&lt;br /&gt;
&lt;br /&gt;
===Changing the rules===&lt;br /&gt;
An relatively small change to even a single rule can make a large change in the language which can be generated. For example, change the first rule in the simple example to read:&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''NounPhrase'' ''VerbPhrase'' '''and''' ''NounPhrase'' ''VerbPhrase''&lt;br /&gt;
This means that a ''Sentence'' is either a ''NounPhrase'' followed by a ''VerbPhrase'' or a ''NounPhrase'' followed by a ''VerbPhrase'' followed by '''and''' followed by a ''NounPhrase'' followed by a ''VerbPhrase''. In addition to the shorter sentences already discussed, this could also generate a sentence such as: &amp;quot;A dog saw a girl and the dog chased the girl&amp;quot;. The total number of grammatically-correct sentences which can be generated by this modified grammar is now 11,772 (108 + 108*108), though some of these may not be very meaingful.&lt;br /&gt;
&lt;br /&gt;
===Towards infinity===&lt;br /&gt;
A significantly different rule change can have an astounding effect. Consider changing the first rule to read:&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''NounPhrase'' ''VerbPhrase'' '''and''' ''Sentence''&lt;br /&gt;
This can generate a potentially infinite number of sentences (any number of these five-word sentences linked by '''and'''). This is an example of what is known as a [[Recursion|recursive]] definition, whereby a ''Sentence'' is partially defined in terms of itself. In such a recursive rule there must be at least one transformation option which does not involve ''Sentence'', otherwise the transformation could never stop.&lt;br /&gt;
&lt;br /&gt;
The above change is known as right-recursive; a left-recursive formulation is also possible, and can in this example generate exactly the same sentences. As shown below  under 'Context-free grammar', there are situations where the choice of left- or right-recursive formulations can change the meaning. &lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''Sentence'' '''and''' ''NounPhrase'' ''VerbPhrase'' &lt;br /&gt;
&lt;br /&gt;
The distinction between left- and right-recursive grammars becomes important when trying to parse/analyse a sentence; some types of parser work best with left-recursive grammars, while other types work best with right-recursive grammars. This distinction is particularly relevant in connection with [[compiler|compiling or translating]] a program written in some high-level [[programming language]] so that it can be used on a [[computer]].&lt;br /&gt;
&lt;br /&gt;
==Chomsky hierarchy==&lt;br /&gt;
By imposing different constraints&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.cs.uaf.edu/2011/spring/cs331/lectures/cs331_20110124_grammar.html&lt;br /&gt;
| title = Lecture notes: Languages &amp;amp; Grammars&lt;br /&gt;
| accessdate = 2012-04-07&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; &lt;br /&gt;
as to what sort of transformation rules could be used, Chomsky was able to define four strictly nested transformational grammars, which he numbered from 0 to 3. As the grammar number increases, the generated language becomes simpler. As the grammar number decreases, parsing a sentence in that language becomes more difficult. The following table provides a summary, which is then explained further in the subsequent subsections.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!| Chomsky&amp;lt;br&amp;gt;number || linguistic name || Rule constraints || Recogniser+ || Notes &lt;br /&gt;
|-&lt;br /&gt;
| 0 || recursively enumerable || [anything] -&amp;gt; [anything] || Turing machine || most human languages &lt;br /&gt;
|-&lt;br /&gt;
| 1 || context-sensitive || X ''A'' Y -&amp;gt; X [anything] Y || linear bounded automaton || X and Y provide the context in which ''A'' can be transformed &lt;br /&gt;
|-&lt;br /&gt;
| 2 || context-free || ''A'' -&amp;gt; [anything] || non-deterministic push-down automaton || syntax analysis for most programming languages &lt;br /&gt;
|-&lt;br /&gt;
| 3 || regular || ''A'' -&amp;gt; [nothing]&amp;lt;br&amp;gt;''A'' -&amp;gt; '''xyz'''&amp;lt;br&amp;gt;''A'' -&amp;gt; '''xyz''' ''B'' || finite automaton&amp;lt;br&amp;gt;or finite state machine || lexical analysis (combining characters into words/tokens)  &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''+''' The '''recogniser''' column indicates the type of mathematical or computer science theoretical model needed to recognise that a sentence belongs to a language, essentially by applying the transformation rules in reverse to work backwards from the actual words in order to finish up with a ''sentence'' (in programming languages the starting concept is usually a ''program''). A finite automaton uses only a small fixed amount of memory, operates in time proportional to the length of the input, and always reaches a decision, while a Turing machine may use an infinite amount of memory and time and may fail to reach a decision (may never stop).&lt;br /&gt;
&lt;br /&gt;
In the linguistic literature, [nothing] is often represented by the symbol '''ε'''.&lt;br /&gt;
&lt;br /&gt;
The descriptions of the various Chomsky levels which follow are presented in reverse order, so as to work up from a simple case to a rather complicated case.&lt;br /&gt;
&lt;br /&gt;
===Level 3: regular grammar===&lt;br /&gt;
The transformation rules for regular grammars are required to be very simple. &lt;br /&gt;
*Only a single non-terminal item can appear on the left-hand side of a rule.&lt;br /&gt;
*The right-hand side of any rule must be one of:&lt;br /&gt;
**[nothing].&lt;br /&gt;
**a terminal item.&lt;br /&gt;
**a terminal item followed by a non-terminal item.&lt;br /&gt;
Note that instead of a terminal item we could have a non-terminal item whose transformation rule immediately resolves to a single terminal item, or to one of several terminal items.&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
Informally we can define a 'word' as a sequence of one or more ''Letter''s. The following regular grammar provides a more formal definition; for simplicity it is restricted to lower-case letters.&lt;br /&gt;
&lt;br /&gt;
 ''Word''     -&amp;gt; ''Letter'' ''PartWord''&lt;br /&gt;
 ''PartWord'' -&amp;gt; [nothing]&lt;br /&gt;
 ''PartWord'' -&amp;gt; ''Letter'' ''PartWord''&lt;br /&gt;
 ''Letter''   -&amp;gt; '''a''', '''b''', ... '''z'''&lt;br /&gt;
&lt;br /&gt;
Note that ''PartWord'' is recursively defined, with the recursion stopping if it is transformed into [nothing].&lt;br /&gt;
&lt;br /&gt;
For one-letter words we expand as: &lt;br /&gt;
:''Word'' -&amp;gt; ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' [nothing] -&amp;gt; ''Letter''&lt;br /&gt;
&lt;br /&gt;
For two-letter words we expand as: &lt;br /&gt;
:''Word'' -&amp;gt; ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' ''Letter'' [nothing] -&amp;gt;  ''Letter'' ''Letter''&lt;br /&gt;
&lt;br /&gt;
Obviously, words of any length can be constructed, though they may well not actually be words from any language. &lt;br /&gt;
&lt;br /&gt;
====Discussion====&lt;br /&gt;
Trying to devise transformation rules to produce words which are more English-like is much more difficult - how do you insist on at least one vowel or on no more than 5 consecutive consonants (e.g. as in 'strengths').&lt;br /&gt;
&lt;br /&gt;
Further examples in [[Regular grammar]] show how numbers can be defined via a regular grammar, and also show how a hyphenated word could be defined.&lt;br /&gt;
&lt;br /&gt;
One of the limitations of a regular grammar is that it can't cope with nested matching brackets, so that it is impossible to write a regular grammar to describe an expression such as '''2 * (3+4)''' where that grammar is expected to allow brackets nested to any depth. A context-free grammar is needed for this, as described in the next section.&lt;br /&gt;
&lt;br /&gt;
Regular grammars or equivalent are widely used by [[compiler]]s in the lexical analysis of programming languages.&lt;br /&gt;
&lt;br /&gt;
===Level 2: context-free grammar===&lt;br /&gt;
The transformation rules for context-free grammars don't appear that much different from those for regular grammars. &lt;br /&gt;
*Only a single non-terminal item can appear on the left-hand side of a rule.&lt;br /&gt;
*The right-hand side of any rule must be one of:&lt;br /&gt;
**[nothing].&lt;br /&gt;
**any combination of terminal items and non-terminal items.&lt;br /&gt;
&lt;br /&gt;
The key difference is that in a regular grammar, any non-empty rule must effectively start with terminal item so that every rule transformation makes some immediate progress, while in a context-free grammar a rule could start with a non-terminal item which itself could be subject to arbitrary further transformations.&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
The following example shows how context-free grammars can cope with arithmetic expressions involving possibly nested brackets. Also an expression such as &amp;quot;2 + 3 * 4&amp;quot; could be interpreted as either &amp;quot;(2 + 3) * 4&amp;quot; = 20 or as &amp;quot;2 + (3 * 4)&amp;quot; = 14. The latter interpretation is that which is normally used - multiplication &amp;quot;*&amp;quot; is said to have a higher priority than addition &amp;quot;+&amp;quot; - so the grammar must incorporate this priority concept. Furthermore, consecutive operators of the same priority are normally applied from left to right, so that &amp;quot;8 - 2 + 3&amp;quot; is interpreted as &amp;quot;(8 - 2) + 3&amp;quot; = 9, rather than as &amp;quot;8 - (2 + 3)&amp;quot; = 3.  This ordering must also be built in to the grammar.&lt;br /&gt;
&lt;br /&gt;
To avoid distracting side-issues, this example only deals with numbers which consist solely of a single digit. The example is a simplified version of the definition of an arithmetic expression given in the Revised Algol 60 Report (Section 3.3.1).&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.masswerk.at/algol60/report.htm&lt;br /&gt;
| title = Revised Report on the Algorithmic Language Algol 60&lt;br /&gt;
| accessdate = 2012-04-22&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ''Expression'' -&amp;gt; ''Term''                        # an ''Expression'' is either a ''Term''&lt;br /&gt;
 ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''    #   or an ''Expression'' followed by '''+''' or '''-''' followed by a ''Term''&lt;br /&gt;
 ''Term''       -&amp;gt; ''Primary''                     # a ''Term'' is either a ''Primary''&lt;br /&gt;
 ''Term''       -&amp;gt; ''Term'' ''MulDivOp'' ''Primary''       #   or a ''Term'' followed by '''*''' or '''/''' followed by a ''Primary''&lt;br /&gt;
                                           #&lt;br /&gt;
 ''Primary''    -&amp;gt; ''Number''                      # a ''Primary'' is either a ''Number''&lt;br /&gt;
 ''Primary''    -&amp;gt; '''(''' ''Expression'' ''')'''              #   or an ''Expression'' enclosed in brackets&lt;br /&gt;
                                           #&lt;br /&gt;
 ''MulDivOp''   -&amp;gt; '''*'''. '''/'''                        # multiplication and division have the same priority&lt;br /&gt;
 ''AddSubOp''   -&amp;gt; '''+'''. '''-'''                        # addition and subtraction have the same priority&lt;br /&gt;
 ''Number''     -&amp;gt; '''0''', '''1''', ... '''9'''                 # this simple-minded definition of a ''Number'' is enough for this example&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
* Both ''Expression'' and ''Term'' are each defined via a left-recursive rule; this ensures that operators of the same priority are applied from left to right.&lt;br /&gt;
* The distinction between ''Expression'' and ''Term'' ensures that multiplication/division are applied before addition/subtraction.&lt;br /&gt;
* ''Expression'' is indirectly recursive via ''Term'' and ''Primary'' to allow bracketed sub-expressions to any depth.&lt;br /&gt;
&lt;br /&gt;
Example 1: generate 2 + 3 * 4&lt;br /&gt;
&lt;br /&gt;
  ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Term'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Primary'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' ''Term''                                 # '''+''' can not be applied until ''Term'' has been evaluated&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' ''Term'' ''MulDivOp'' ''Primary''&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' ''Primary'' ''MulDipOp'' ''Primary''&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' '''3''' '''*''' '''4'''&lt;br /&gt;
&lt;br /&gt;
Example 2: generate 2 * 3 + 4&lt;br /&gt;
&lt;br /&gt;
  ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Term'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Term'' ''MulDivOp'' ''Primary'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Primary'' ''MulDivOp'' ''Primary'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; '''2''' '''*''' '''3''' ''AddSubOp'' ''Term''                      # ''Term'' to left of ''AddSubOp'' is evaluated first&lt;br /&gt;
             -&amp;gt; '''2''' '''*''' '''3''' ''AddSubOp'' ''Primary''  &lt;br /&gt;
             -&amp;gt; '''2''' '''*''' '''3''' '''+''' '''4'''&lt;br /&gt;
&lt;br /&gt;
====Discussion====&lt;br /&gt;
Context-free grammars (or equivalent definitions using Backus-Naur-Form) are widely used both to define the syntax of programming languages and to (semi-automatically) generate parsers for these languages.&lt;br /&gt;
&lt;br /&gt;
A limitation/feature of both regular grammars and context-free grammars is that the left-hand side of any rule is always a single non-terminal item, so any transformation is applied regardless of the context in which that non-terminal item appears.  A simple example which depends on context is the use of singular and plural nouns and verbs in English.  We say: '''the man runs''' or '''the men run''', but neither of '''the man run''' nor '''the men runs'''.  Which form of verb to use depends on the noun, i.e. there is a context dependency.&lt;br /&gt;
&lt;br /&gt;
===Level 1===&lt;br /&gt;
For context-sensitive grammars the left-hand side of a rule may indicate the context in which that rule applies, so that the same non-terminal item may be transformed in different ways depending on the context in which it appears.&lt;br /&gt;
&lt;br /&gt;
There is only one transformation rule for context-sensitive grammars:&lt;br /&gt;
&lt;br /&gt;
 X [non-terminal] Y -&amp;gt; X [anything] Y&lt;br /&gt;
&lt;br /&gt;
where X and Y determine the context in which the [non-terminal] is transformed. Note that X and Y may each be terminals or non-terminals or [nothing]. When both X and Y are nothing there is no context and this reduces to a Level 2 or Level 3 grammar.&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
Taylor has provided several examples&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.divms.uiowa.edu/~fleck/taylor.pdf&lt;br /&gt;
| title = Context-sensitive Examples&lt;br /&gt;
| author = Taylor&lt;br /&gt;
| accessdate = 2012-04-26&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
and the following, inspired by his third example, is an extension of the original simple example to handle singulars and plurals:&lt;br /&gt;
&lt;br /&gt;
 ''Sentence''                -&amp;gt;  ''NounPhrase'' ''VerbPhrase''            # simple sentence structure&lt;br /&gt;
 ''NounPhrase''              -&amp;gt;  ''Determiner'' ''Noun''                  # simple phrase structure&lt;br /&gt;
 ''VerbPhrase''              -&amp;gt;  ''Verb'' ''NounPhrase''                  # simple phrase structure&lt;br /&gt;
                                                              #&lt;br /&gt;
 ''Noun''                    -&amp;gt;  ''SingularNoun'', ''PluralNoun''         # nouns can be singular or plural &lt;br /&gt;
                                                              #&lt;br /&gt;
 ''Determiner'' ''SingularNoun'' -&amp;gt;  ''SingularDeterminer'' ''SingularNoun''  # determiner must agree with noun:&lt;br /&gt;
 ''Determiner'' ''PluralNoun''   -&amp;gt;  ''PluralDeterminer'' ''PluralNoun''      #&lt;br /&gt;
                                                              #&lt;br /&gt;
 ''SingularNoun'' ''Verb''       -&amp;gt;  ''SingularNoun'' ''SingularVerb''        # verb must agree with noun&lt;br /&gt;
 ''PluralNoun'' ''Verb''         -&amp;gt;  ''PluralNoun'' ''PluralVerb''            #&lt;br /&gt;
                                                              #&lt;br /&gt;
 ''SingularDeterminer''      -&amp;gt;  '''a''', '''the'''                           # singular determiners&lt;br /&gt;
 ''PluralDeterminer''        -&amp;gt;  '''the'''                              # plural determiners&lt;br /&gt;
                                                              #&lt;br /&gt;
 ''SingularNoun''            -&amp;gt;  '''boy''', '''sheep''', '''dog'''                  # singular nouns&lt;br /&gt;
 ''PluralNoun''              -&amp;gt;  '''boys''', '''sheep''', '''dogs'''                # plural nouns&lt;br /&gt;
                                                              #&lt;br /&gt;
 ''SingularVerb''            -&amp;gt;  '''chases''', '''hears''', '''sees'''              # singular verbs&lt;br /&gt;
 ''PluralVerb''              -&amp;gt;  '''chase''', '''hear''', '''see'''                 # plural verbs&lt;br /&gt;
&lt;br /&gt;
===Level 0===&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[category:linguistics]]&lt;br /&gt;
[[Category:Computer Science]]&lt;/div&gt;</summary>
		<author><name>RolandPlankton</name></author>
	</entry>
	<entry>
		<id>https://www.conservapedia.com/index.php?title=Chomsky_hierarchy&amp;diff=979411</id>
		<title>Chomsky hierarchy</title>
		<link rel="alternate" type="text/html" href="https://www.conservapedia.com/index.php?title=Chomsky_hierarchy&amp;diff=979411"/>
		<updated>2012-05-03T20:37:37Z</updated>

		<summary type="html">&lt;p&gt;RolandPlankton: /* Discussion */ simplify&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The '''Chomsky hierarchy''', sometimes known as the '''Chomsky-Schützenberger hierarchy''', is a hierarchy of formal grammatical systems for describing various classes of languages; the hierarchy can apply to both human and computer languages. This hierarchy was first published in 1956 by [[Noam Chomsky|Chomsky]].&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite journal &lt;br /&gt;
| title = Three models for the description of language &lt;br /&gt;
| year = 1956 &lt;br /&gt;
| last = Chomsky &lt;br /&gt;
| first = Noam &lt;br /&gt;
| journal = IRE Transactions on Information Theory &lt;br /&gt;
| volume = 2 &lt;br /&gt;
| pages = 113–124 &lt;br /&gt;
| url = http://www.chomsky.info/articles/195609--.pdf &lt;br /&gt;
| accessdate = 2012-04-08&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
These grammatical systems were referred to by Chomsky as ''transformational grammars''.  Other linguists have since developed a variety of similar grammars; together these are known as ''generative grammars''. &lt;br /&gt;
&lt;br /&gt;
The basic idea of a '''generative grammar''' is to provide a set of rules which are capable of generating all possible grammatical sentences in some language; the rules must constrain the generation so that only grammatical sentences are generated. The rules can also be used in reverse to parse a sentence and check if it is grammatical.&lt;br /&gt;
&lt;br /&gt;
In the late 1950's, [[John Backus]] and Peter Naur developed a notation for describing [[programming language]]s. This notation is known as [[Backus Naur Form]] (or BNF) and turns out to be equivalent to Chomsky's grammar number two (context-free grammar), although it was developed independently of Chomsky's work. Backus-Naur Form was first used in the Algol 60 Report to specify the syntax of [[Algol 60]], and has since been used for specifying the syntax of other programming languages. &lt;br /&gt;
&lt;br /&gt;
==Example of a very simple generative grammar==&lt;br /&gt;
This very simple example can handle only a tiny subset of English and should not be taken seriously as a guide to English grammar or vocabulary. It is based on an example by David Crystal&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite book &lt;br /&gt;
| last = Crystal &lt;br /&gt;
| first = David  &lt;br /&gt;
| title = The Cambridge Encyclopedia of Language &lt;br /&gt;
| publisher = Cambridge University Press &lt;br /&gt;
| year = 1987 &lt;br /&gt;
| isbn = 0-521-42443-7&lt;br /&gt;
| pages = page 97&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; and is a slight extension of an example on slide 9 of this lecture.&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.cs.princeton.edu/~rywang/99f126/slides/16th.pdf&lt;br /&gt;
| title = Lecture notes: Formal Languages&lt;br /&gt;
| accessdate = 2012-04-07}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase''         # A ''Sentence'' consists of a ''NounPhrase'' followed by a ''VerbPhrase''&lt;br /&gt;
 ''NounPhrase'' -&amp;gt;  ''Determiner'' ''Noun''               # A ''NounPhrase'' consists of a ''Determiner'' followed by a ''Noun''&lt;br /&gt;
 ''VerbPhrase'' -&amp;gt;  ''Verb'' ''NounPhrase''               # A ''VerbPhrase'' consists of a ''Verb'' followed by a ''NounPhrase''&lt;br /&gt;
 ''Determiner'' -&amp;gt;  '''a''', '''the'''                        # A ''Determiner''  is one of: '''a''' or '''the'''&lt;br /&gt;
 ''Noun''       -&amp;gt;  '''boy''', '''girl''', '''dog'''                # A ''Noun'' is one of: '''boy''' or '''girl''' or '''dog'''  &lt;br /&gt;
 ''Verb''       -&amp;gt;  '''chased''', '''heard''', '''saw'''            # A ''Verb'' is one of: '''chased''' or '''heard''' or '''saw'''&lt;br /&gt;
&lt;br /&gt;
Notation used above: &lt;br /&gt;
:The symbol &amp;quot;-&amp;gt;&amp;quot; means &amp;quot;can be replaced by&amp;quot;.  &lt;br /&gt;
:When there are several items on the right hand side separated by commas, just one of these items can be selected. &lt;br /&gt;
:The comments preceded by &amp;quot;#&amp;quot; are not part of the generative grammar, but hopefully will help folks understand the example a little better.&lt;br /&gt;
&lt;br /&gt;
By making appropriate substitutions we can generate such sentences as:&lt;br /&gt;
:The dog chased a girl.&lt;br /&gt;
:The girl heard the dog.&lt;br /&gt;
:The boy saw a girl.&lt;br /&gt;
&lt;br /&gt;
The stages in the generation of these examples are as follows:&lt;br /&gt;
:''Sentence''&lt;br /&gt;
:-&amp;gt; ''NounPhrase'' ''VerbPhrase''&lt;br /&gt;
:-&amp;gt; ''Determiner'' ''Noun'' ''Verb'' ''NounPhrase''&lt;br /&gt;
:-&amp;gt; ''Determiner'' ''Noun'' ''Verb'' ''Determiner'' ''Noun''&lt;br /&gt;
&lt;br /&gt;
By appropriate selection of words to substitute for ''Determiner'', ''Noun'', and ''Verb'' we can produce the 3 example sentences above.&lt;br /&gt;
&lt;br /&gt;
The simple grammar defines a few words which can be substituted for ''Determiner'', ''Noun'', and ''Verb''. There are two possibilities for ''Determiner'', three for ''Noun'', and three for ''Verb'', with both ''Determiner'' and ''Noun'' appearing twice in the expansion. Hence the total number of grammatical sentences which can be generated by this simple grammar is 108 (= 2 * 3 * 3 * 2 * 3). In this particular case the possible words have been carefully chosen so that all of these 108 sentences also actually mean something.&lt;br /&gt;
&lt;br /&gt;
Note that the use of ''italics'' and '''boldface''' in this example is merely a convenient way of indicating the difference between items which can be expanded further (e.g. concepts such as ''NounPhrase'') and items which can not be expanded further (e.g. words such as '''girl'''). In the linguistic literature, items which can be expanded further are referred to as 'non-terminal' items, while items which can't be expanded further are known as 'terminal' items.&lt;br /&gt;
&lt;br /&gt;
The 'comma' notation for alternatives is a form of shorthand. In some formulations this would be shown as several separate rules, so that:&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''a''', '''the''' &lt;br /&gt;
could be shown as two rules:&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''a'''&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''the''' &lt;br /&gt;
&lt;br /&gt;
==Caution==&lt;br /&gt;
While a generative grammar may produce sentences which are grammatically correct, there is no certainty that such sentences will actually mean anything. The classic example of such a meaningless sentence is from Chomsky's book&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite book &lt;br /&gt;
| last = Chomsky &lt;br /&gt;
| first = Noam &lt;br /&gt;
| title = Syntactic Structures &lt;br /&gt;
| year = 1957 &lt;br /&gt;
| publisher = Mouton &lt;br /&gt;
| location = The Hague/Paris &lt;br /&gt;
| pages = page 15 &lt;br /&gt;
| isbn = 3-11-017279-8&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; with the grammatically correct sentence:&lt;br /&gt;
&lt;br /&gt;
:&amp;quot;Colorless green ideas sleep furiously.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
:This example illustrates the difference between grammar/syntax and meaning/semantics.&lt;br /&gt;
&lt;br /&gt;
Another problem when analysing a sentence is that many English words have multiple meanings, so that there may be more than one way to interpret a sentence. A simple example is the sentence: &lt;br /&gt;
:&amp;quot;Time flies.&amp;quot; &lt;br /&gt;
:Is this an instruction to check how fast flies are flying, or an indication that time appears to be passing quickly? &lt;br /&gt;
:A varied and entertaining selection of such ambiguities has been compiled by Jeff Gray.&amp;lt;ref&amp;gt;{{Cite web &lt;br /&gt;
| title = Collection of Ambiguous or Inconsistent/Incomplete Statements  &lt;br /&gt;
| url = http://www.gray-area.org/Research/Ambig/ &lt;br /&gt;
| author = Jeff Gray&lt;br /&gt;
| accessdate = 2012-04-10&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Formal grammar==&lt;br /&gt;
'''Note''': this section and subsequent sections are, by necessity, slightly more technical/formal than the earlier parts of this article, though specialist notation has been largely avoided. Make sure that you understand the 'Simple example' above before proceeding further, since references will be made to that example to help explain the technicalities, and variations on that example will be used to illustrate new ideas. An attempt has been made to avoid formal linguistic abbreviations and unexplained jargon.&lt;br /&gt;
&lt;br /&gt;
A formal generative grammar has four components (see slide 19 of this lecture&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://adammikeal.org/courses/compute/Chomsky%20Presentation.pdf&lt;br /&gt;
| title = The Chomsky Hierarchy&lt;br /&gt;
| accessdate = 2012-04-06&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
):&lt;br /&gt;
# a finite number of non-terminal concepts (e.g. ''VerbPhrase'' in the example, or anything else in ''italics''),&lt;br /&gt;
# a finite number of terminal items (e.g. '''girl''' in the example, or anything else in '''bold-face''').&lt;br /&gt;
# a finite set of rules for transforming non-terminal items (e.g. the example has 6 rules).&lt;br /&gt;
# a single starting point (e.g. ''Sentence'' in the example).&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
:Any item which appears on the left-hand side of a transformation rule is non-terminal since it can be replaced by something else; apart from the starting point, all other non-terminals must also appear somewhere on the right-hand side of transformation rule.&lt;br /&gt;
:An item which appears only on the right-hand side of a transformation rule is a terminal item, since it can not be transformed further.&lt;br /&gt;
:A list of all the terminal items is effectively the vocabulary from which sentences are built.&lt;br /&gt;
:Linguists have developed various classes of grammars by using constraints to govern what sort of rules can be used for any particular grammar.&lt;br /&gt;
&lt;br /&gt;
===Changing the rules===&lt;br /&gt;
An relatively small change to even a single rule can make a large change in the language which can be generated. For example, change the first rule in the simple example to read:&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''NounPhrase'' ''VerbPhrase'' '''and''' ''NounPhrase'' ''VerbPhrase''&lt;br /&gt;
This means that a ''Sentence'' is either a ''NounPhrase'' followed by a ''VerbPhrase'' or a ''NounPhrase'' followed by a ''VerbPhrase'' followed by '''and''' followed by a ''NounPhrase'' followed by a ''VerbPhrase''. In addition to the shorter sentences already discussed, this could also generate a sentence such as: &amp;quot;A dog saw a girl and the dog chased the girl&amp;quot;. The total number of grammatically-correct sentences which can be generated by this modified grammar is now 11,772 (108 + 108*108), though some of these may not be very meaingful.&lt;br /&gt;
&lt;br /&gt;
===Towards infinity===&lt;br /&gt;
A significantly different rule change can have an astounding effect. Consider changing the first rule to read:&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''NounPhrase'' ''VerbPhrase'' '''and''' ''Sentence''&lt;br /&gt;
This can generate a potentially infinite number of sentences (any number of these five-word sentences linked by '''and'''). This is an example of what is known as a [[Recursion|recursive]] definition, whereby a ''Sentence'' is partially defined in terms of itself. In such a recursive rule there must be at least one transformation option which does not involve ''Sentence'', otherwise the transformation could never stop.&lt;br /&gt;
&lt;br /&gt;
The above change is known as right-recursive; a left-recursive formulation is also possible, and can in this example generate exactly the same sentences. As shown below  under 'Context-free grammar', there are situations where the choice of left- or right-recursive formulations can change the meaning. &lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''Sentence'' '''and''' ''NounPhrase'' ''VerbPhrase'' &lt;br /&gt;
&lt;br /&gt;
The distinction between left- and right-recursive grammars becomes important when trying to parse/analyse a sentence; some types of parser work best with left-recursive grammars, while other types work best with right-recursive grammars. This distinction is particularly relevant in connection with [[compiler|compiling or translating]] a program written in some high-level [[programming language]] so that it can be used on a [[computer]].&lt;br /&gt;
&lt;br /&gt;
==Chomsky hierarchy==&lt;br /&gt;
By imposing different constraints&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.cs.uaf.edu/2011/spring/cs331/lectures/cs331_20110124_grammar.html&lt;br /&gt;
| title = Lecture notes: Languages &amp;amp; Grammars&lt;br /&gt;
| accessdate = 2012-04-07&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; &lt;br /&gt;
as to what sort of transformation rules could be used, Chomsky was able to define four strictly nested transformational grammars, which he numbered from 0 to 3. As the grammar number increases, the generated language becomes simpler. As the grammar number decreases, parsing a sentence in that language becomes more difficult. The following table provides a summary, which is then explained further in the subsequent subsections.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!| Chomsky&amp;lt;br&amp;gt;number || linguistic name || Rule constraints || Recogniser+ || Notes &lt;br /&gt;
|-&lt;br /&gt;
| 0 || recursively enumerable || [anything] -&amp;gt; [anything] || Turing machine || most human languages &lt;br /&gt;
|-&lt;br /&gt;
| 1 || context-sensitive || X ''A'' Y -&amp;gt; X [anything] Y || linear bounded automaton || X and Y provide the context in which ''A'' can be transformed &lt;br /&gt;
|-&lt;br /&gt;
| 2 || context-free || ''A'' -&amp;gt; [anything] || non-deterministic push-down automaton || syntax analysis for most programming languages &lt;br /&gt;
|-&lt;br /&gt;
| 3 || regular || ''A'' -&amp;gt; [nothing]&amp;lt;br&amp;gt;''A'' -&amp;gt; '''xyz'''&amp;lt;br&amp;gt;''A'' -&amp;gt; '''xyz''' ''B'' || finite automaton&amp;lt;br&amp;gt;or finite state machine || lexical analysis (combining characters into words/tokens)  &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''+''' The '''recogniser''' column indicates the type of mathematical or computer science theoretical model needed to recognise that a sentence belongs to a language, essentially by applying the transformation rules in reverse to work backwards from the actual words in order to finish up with a ''sentence'' (in programming languages the starting concept is usually a ''program''). A finite automaton uses only a small fixed amount of memory, operates in time proportional to the length of the input, and always reaches a decision, while a Turing machine may use an infinite amount of memory and time and may fail to reach a decision (may never stop).&lt;br /&gt;
&lt;br /&gt;
In the linguistic literature, [nothing] is often represented by the symbol '''ε'''.&lt;br /&gt;
&lt;br /&gt;
The descriptions of the various Chomsky levels which follow are presented in reverse order, so as to work up from a simple case to a rather complicated case.&lt;br /&gt;
&lt;br /&gt;
===Level 3: regular grammar===&lt;br /&gt;
The transformation rules for regular grammars are required to be very simple. &lt;br /&gt;
*Only a single non-terminal item can appear on the left-hand side of a rule.&lt;br /&gt;
*The right-hand side of any rule must be one of:&lt;br /&gt;
**[nothing].&lt;br /&gt;
**a terminal item.&lt;br /&gt;
**a terminal item followed by a non-terminal item.&lt;br /&gt;
Note that instead of a terminal item we could have a non-terminal item whose transformation rule immediately resolves to a single terminal item, or to one of several terminal items.&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
Informally we can define a 'word' as a sequence of one or more ''Letter''s. The following regular grammar provides a more formal definition; for simplicity it is restricted to lower-case letters.&lt;br /&gt;
&lt;br /&gt;
 ''Word''     -&amp;gt; ''Letter'' ''PartWord''&lt;br /&gt;
 ''PartWord'' -&amp;gt; [nothing]&lt;br /&gt;
 ''PartWord'' -&amp;gt; ''Letter'' ''PartWord''&lt;br /&gt;
 ''Letter''   -&amp;gt; '''a''', '''b''', ... '''z'''&lt;br /&gt;
&lt;br /&gt;
Note that ''PartWord'' is recursively defined, with the recursion stopping if it is transformed into [nothing].&lt;br /&gt;
&lt;br /&gt;
For one-letter words we expand as: &lt;br /&gt;
:''Word'' -&amp;gt; ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' [nothing] -&amp;gt; ''Letter''&lt;br /&gt;
&lt;br /&gt;
For two-letter words we expand as: &lt;br /&gt;
:''Word'' -&amp;gt; ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' ''Letter'' [nothing] -&amp;gt;  ''Letter'' ''Letter''&lt;br /&gt;
&lt;br /&gt;
Obviously, words of any length can be constructed, though they may well not actually be words from any language. &lt;br /&gt;
&lt;br /&gt;
====Discussion====&lt;br /&gt;
Trying to devise transformation rules to produce words which are more English-like is much more difficult - how do you insist on at least one vowel or on no more than 5 consecutive consonants (e.g. as in 'strengths').&lt;br /&gt;
&lt;br /&gt;
Further examples in [[Regular grammar]] show how numbers can be defined via a regular grammar, and also show how a hyphenated word could be defined.&lt;br /&gt;
&lt;br /&gt;
One of the limitations of a regular grammar is that it can't cope with nested matching brackets, so that it is impossible to write a regular grammar to describe an expression such as '''2 * (3+4)''' where that grammar is expected to allow brackets nested to any depth. A context-free grammar is needed for this, as described in the next section.&lt;br /&gt;
&lt;br /&gt;
Regular grammars or equivalent are widely used by [[compiler]]s in the lexical analysis of programming languages.&lt;br /&gt;
&lt;br /&gt;
===Level 2: context-free grammar===&lt;br /&gt;
The transformation rules for context-free grammars don't appear that much different from those for regular grammars. &lt;br /&gt;
*Only a single non-terminal item can appear on the left-hand side of a rule.&lt;br /&gt;
*The right-hand side of any rule must be one of:&lt;br /&gt;
**[nothing].&lt;br /&gt;
**any combination of terminal items and non-terminal items.&lt;br /&gt;
&lt;br /&gt;
The key difference is that in a regular grammar, any non-empty rule must effectively start with terminal item so that every rule transformation makes some immediate progress, while in a context-free grammar a rule could start with a non-terminal item which itself could be subject to arbitrary further transformations.&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
The following example shows how context-free grammars can cope with arithmetic expressions involving possibly nested brackets. Also an expression such as &amp;quot;2 + 3 * 4&amp;quot; could be interpreted as either &amp;quot;(2 + 3) * 4&amp;quot; = 20 or as &amp;quot;2 + (3 * 4)&amp;quot; = 14. The latter interpretation is that which is normally used - multiplication &amp;quot;*&amp;quot; is said to have a higher priority than addition &amp;quot;+&amp;quot; - so the grammar must incorporate this priority concept. Furthermore, consecutive operators of the same priority are normally applied from left to right, so that &amp;quot;8 - 2 + 3&amp;quot; is interpreted as &amp;quot;(8 - 2) + 3&amp;quot; = 9, rather than as &amp;quot;8 - (2 + 3)&amp;quot; = 3.  This ordering must also be built in to the grammar.&lt;br /&gt;
&lt;br /&gt;
To avoid distracting side-issues, this example only deals with numbers which consist solely of a single digit. The example is a simplified version of the definition of an arithmetic expression given in the Revised Algol 60 Report (Section 3.3.1).&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.masswerk.at/algol60/report.htm&lt;br /&gt;
| title = Revised Report on the Algorithmic Language Algol 60&lt;br /&gt;
| accessdate = 2012-04-22&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ''Expression'' -&amp;gt; ''Term''                        # an ''Expression'' is either a ''Term''&lt;br /&gt;
 ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''    #   or an ''Expression'' followed by '''+''' or '''-''' followed by a ''Term''&lt;br /&gt;
 ''Term''       -&amp;gt; ''Primary''                     # a ''Term'' is either a ''Primary''&lt;br /&gt;
 ''Term''       -&amp;gt; ''Term'' ''MulDivOp'' ''Primary''       #   or a ''Term'' followed by '''*''' or '''/''' followed by a ''Primary''&lt;br /&gt;
                                           #&lt;br /&gt;
 ''Primary''    -&amp;gt; ''Number''                      # a ''Primary'' is either a ''Number''&lt;br /&gt;
 ''Primary''    -&amp;gt; '''(''' ''Expression'' ''')'''              #   or an ''Expression'' enclosed in brackets&lt;br /&gt;
                                           #&lt;br /&gt;
 ''MulDivOp''   -&amp;gt; '''*'''. '''/'''                        # multiplication and division have the same priority&lt;br /&gt;
 ''AddSubOp''   -&amp;gt; '''+'''. '''-'''                        # addition and subtraction have the same priority&lt;br /&gt;
 ''Number''     -&amp;gt; '''0''', '''1''', ... '''9'''                 # this simple-minded definition of a ''Number'' is enough for this example&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
* Both ''Expression'' and ''Term'' are each defined via a left-recursive rule; this ensures that operators of the same priority are applied from left to right.&lt;br /&gt;
* The distinction between ''Expression'' and ''Term'' ensures that multiplication/division are applied before addition/subtraction.&lt;br /&gt;
* ''Expression'' is indirectly recursive via ''Term'' and ''Primary'' to allow bracketed sub-expressions to any depth.&lt;br /&gt;
&lt;br /&gt;
Example 1: generate 2 + 3 * 4&lt;br /&gt;
&lt;br /&gt;
  ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Term'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Primary'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' ''Term''                                 # '''+''' can not be applied until ''Term'' has been evaluated&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' ''Term'' ''MulDivOp'' ''Primary''&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' ''Primary'' ''MulDipOp'' ''Primary''&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' '''3''' '''*''' '''4'''&lt;br /&gt;
&lt;br /&gt;
Example 2: generate 2 * 3 + 4&lt;br /&gt;
&lt;br /&gt;
  ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Term'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Term'' ''MulDivOp'' ''Primary'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Primary'' ''MulDivOp'' ''Primary'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; '''2''' '''*''' '''3''' ''AddSubOp'' ''Term''                      # ''Term'' to left of ''AddSubOp'' is evaluated first&lt;br /&gt;
             -&amp;gt; '''2''' '''*''' '''3''' ''AddSubOp'' ''Primary''  &lt;br /&gt;
             -&amp;gt; '''2''' '''*''' '''3''' '''+''' '''4'''&lt;br /&gt;
&lt;br /&gt;
====Discussion====&lt;br /&gt;
Context-free grammars (or equivalent definitions using Backus-Naur-Form) are widely used both to define the syntax of programming languages and to (semi-automatically) generate parsers for these languages.&lt;br /&gt;
&lt;br /&gt;
A limitation/feature of both regular grammars and context-free grammars is that the left-hand side of any rule is always a single non-terminal item, so any transformation is applied regardless of the context in which that non-terminal item appears.  A simple example which depends on context is the use of singular and plural nouns and verbs in English.  We say: '''the man runs''' or '''the men run''', but neither of '''the man run''' nor '''the men runs'''.  Which form of verb to use depends on the noun, i.e. there is a context dependency.&lt;br /&gt;
&lt;br /&gt;
===Level 1===&lt;br /&gt;
For context-sensitive grammars the left-hand side of a rule may indicate the context in which that rule applies, so that the same non-terminal item may be transformed in different ways depending on the context in which it appears.&lt;br /&gt;
&lt;br /&gt;
There is only one transformation rule for context-sensitive grammars:&lt;br /&gt;
&lt;br /&gt;
 X [non-terminal] Y -&amp;gt; X [anything] Y&lt;br /&gt;
&lt;br /&gt;
where X and Y determine the context in which the [non-terminal] is transformed. Note that X and Y may each be terminals or non-terminals or [nothing].&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
Several examples appear in these lecture notes.&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.divms.uiowa.edu/~fleck/taylor.pdf&lt;br /&gt;
| title = Context-sensitive Examples&lt;br /&gt;
| author = Taylor&lt;br /&gt;
| accessdate = 2012-04-26&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Level 0===&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[category:linguistics]]&lt;br /&gt;
[[Category:Computer Science]]&lt;/div&gt;</summary>
		<author><name>RolandPlankton</name></author>
	</entry>
	<entry>
		<id>https://www.conservapedia.com/index.php?title=Chomsky_hierarchy&amp;diff=979109</id>
		<title>Chomsky hierarchy</title>
		<link rel="alternate" type="text/html" href="https://www.conservapedia.com/index.php?title=Chomsky_hierarchy&amp;diff=979109"/>
		<updated>2012-05-01T20:48:23Z</updated>

		<summary type="html">&lt;p&gt;RolandPlankton: /* Chomsky hierarchy */ further discussion, rules for level 1 grammars&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The '''Chomsky hierarchy''', sometimes known as the '''Chomsky-Schützenberger hierarchy''', is a hierarchy of formal grammatical systems for describing various classes of languages; the hierarchy can apply to both human and computer languages. This hierarchy was first published in 1956 by [[Noam Chomsky|Chomsky]].&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite journal &lt;br /&gt;
| title = Three models for the description of language &lt;br /&gt;
| year = 1956 &lt;br /&gt;
| last = Chomsky &lt;br /&gt;
| first = Noam &lt;br /&gt;
| journal = IRE Transactions on Information Theory &lt;br /&gt;
| volume = 2 &lt;br /&gt;
| pages = 113–124 &lt;br /&gt;
| url = http://www.chomsky.info/articles/195609--.pdf &lt;br /&gt;
| accessdate = 2012-04-08&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
These grammatical systems were referred to by Chomsky as ''transformational grammars''.  Other linguists have since developed a variety of similar grammars; together these are known as ''generative grammars''. &lt;br /&gt;
&lt;br /&gt;
The basic idea of a '''generative grammar''' is to provide a set of rules which are capable of generating all possible grammatical sentences in some language; the rules must constrain the generation so that only grammatical sentences are generated. The rules can also be used in reverse to parse a sentence and check if it is grammatical.&lt;br /&gt;
&lt;br /&gt;
In the late 1950's, [[John Backus]] and Peter Naur developed a notation for describing [[programming language]]s. This notation is known as [[Backus Naur Form]] (or BNF) and turns out to be equivalent to Chomsky's grammar number two (context-free grammar), although it was developed independently of Chomsky's work. Backus-Naur Form was first used in the Algol 60 Report to specify the syntax of [[Algol 60]], and has since been used for specifying the syntax of other programming languages. &lt;br /&gt;
&lt;br /&gt;
==Example of a very simple generative grammar==&lt;br /&gt;
This very simple example can handle only a tiny subset of English and should not be taken seriously as a guide to English grammar or vocabulary. It is based on an example by David Crystal&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite book &lt;br /&gt;
| last = Crystal &lt;br /&gt;
| first = David  &lt;br /&gt;
| title = The Cambridge Encyclopedia of Language &lt;br /&gt;
| publisher = Cambridge University Press &lt;br /&gt;
| year = 1987 &lt;br /&gt;
| isbn = 0-521-42443-7&lt;br /&gt;
| pages = page 97&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; and is a slight extension of an example on slide 9 of this lecture.&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.cs.princeton.edu/~rywang/99f126/slides/16th.pdf&lt;br /&gt;
| title = Lecture notes: Formal Languages&lt;br /&gt;
| accessdate = 2012-04-07}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase''         # A ''Sentence'' consists of a ''NounPhrase'' followed by a ''VerbPhrase''&lt;br /&gt;
 ''NounPhrase'' -&amp;gt;  ''Determiner'' ''Noun''               # A ''NounPhrase'' consists of a ''Determiner'' followed by a ''Noun''&lt;br /&gt;
 ''VerbPhrase'' -&amp;gt;  ''Verb'' ''NounPhrase''               # A ''VerbPhrase'' consists of a ''Verb'' followed by a ''NounPhrase''&lt;br /&gt;
 ''Determiner'' -&amp;gt;  '''a''', '''the'''                        # A ''Determiner''  is one of: '''a''' or '''the'''&lt;br /&gt;
 ''Noun''       -&amp;gt;  '''boy''', '''girl''', '''dog'''                # A ''Noun'' is one of: '''boy''' or '''girl''' or '''dog'''  &lt;br /&gt;
 ''Verb''       -&amp;gt;  '''chased''', '''heard''', '''saw'''            # A ''Verb'' is one of: '''chased''' or '''heard''' or '''saw'''&lt;br /&gt;
&lt;br /&gt;
Notation used above: &lt;br /&gt;
:The symbol &amp;quot;-&amp;gt;&amp;quot; means &amp;quot;can be replaced by&amp;quot;.  &lt;br /&gt;
:When there are several items on the right hand side separated by commas, just one of these items can be selected. &lt;br /&gt;
:The comments preceded by &amp;quot;#&amp;quot; are not part of the generative grammar, but hopefully will help folks understand the example a little better.&lt;br /&gt;
&lt;br /&gt;
By making appropriate substitutions we can generate such sentences as:&lt;br /&gt;
:The dog chased a girl.&lt;br /&gt;
:The girl heard the dog.&lt;br /&gt;
:The boy saw a girl.&lt;br /&gt;
&lt;br /&gt;
The stages in the generation of these examples are as follows:&lt;br /&gt;
:''Sentence''&lt;br /&gt;
:-&amp;gt; ''NounPhrase'' ''VerbPhrase''&lt;br /&gt;
:-&amp;gt; ''Determiner'' ''Noun'' ''Verb'' ''NounPhrase''&lt;br /&gt;
:-&amp;gt; ''Determiner'' ''Noun'' ''Verb'' ''Determiner'' ''Noun''&lt;br /&gt;
&lt;br /&gt;
By appropriate selection of words to substitute for ''Determiner'', ''Noun'', and ''Verb'' we can produce the 3 example sentences above.&lt;br /&gt;
&lt;br /&gt;
The simple grammar defines a few words which can be substituted for ''Determiner'', ''Noun'', and ''Verb''. There are two possibilities for ''Determiner'', three for ''Noun'', and three for ''Verb'', with both ''Determiner'' and ''Noun'' appearing twice in the expansion. Hence the total number of grammatical sentences which can be generated by this simple grammar is 108 (= 2 * 3 * 3 * 2 * 3). In this particular case the possible words have been carefully chosen so that all of these 108 sentences also actually mean something.&lt;br /&gt;
&lt;br /&gt;
Note that the use of ''italics'' and '''boldface''' in this example is merely a convenient way of indicating the difference between items which can be expanded further (e.g. concepts such as ''NounPhrase'') and items which can not be expanded further (e.g. words such as '''girl'''). In the linguistic literature, items which can be expanded further are referred to as 'non-terminal' items, while items which can't be expanded further are known as 'terminal' items.&lt;br /&gt;
&lt;br /&gt;
The 'comma' notation for alternatives is a form of shorthand. In some formulations this would be shown as several separate rules, so that:&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''a''', '''the''' &lt;br /&gt;
could be shown as two rules:&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''a'''&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''the''' &lt;br /&gt;
&lt;br /&gt;
==Caution==&lt;br /&gt;
While a generative grammar may produce sentences which are grammatically correct, there is no certainty that such sentences will actually mean anything. The classic example of such a meaningless sentence is from Chomsky's book&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite book &lt;br /&gt;
| last = Chomsky &lt;br /&gt;
| first = Noam &lt;br /&gt;
| title = Syntactic Structures &lt;br /&gt;
| year = 1957 &lt;br /&gt;
| publisher = Mouton &lt;br /&gt;
| location = The Hague/Paris &lt;br /&gt;
| pages = page 15 &lt;br /&gt;
| isbn = 3-11-017279-8&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; with the grammatically correct sentence:&lt;br /&gt;
&lt;br /&gt;
:&amp;quot;Colorless green ideas sleep furiously.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
:This example illustrates the difference between grammar/syntax and meaning/semantics.&lt;br /&gt;
&lt;br /&gt;
Another problem when analysing a sentence is that many English words have multiple meanings, so that there may be more than one way to interpret a sentence. A simple example is the sentence: &lt;br /&gt;
:&amp;quot;Time flies.&amp;quot; &lt;br /&gt;
:Is this an instruction to check how fast flies are flying, or an indication that time appears to be passing quickly? &lt;br /&gt;
:A varied and entertaining selection of such ambiguities has been compiled by Jeff Gray.&amp;lt;ref&amp;gt;{{Cite web &lt;br /&gt;
| title = Collection of Ambiguous or Inconsistent/Incomplete Statements  &lt;br /&gt;
| url = http://www.gray-area.org/Research/Ambig/ &lt;br /&gt;
| author = Jeff Gray&lt;br /&gt;
| accessdate = 2012-04-10&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Formal grammar==&lt;br /&gt;
'''Note''': this section and subsequent sections are, by necessity, slightly more technical/formal than the earlier parts of this article, though specialist notation has been largely avoided. Make sure that you understand the 'Simple example' above before proceeding further, since references will be made to that example to help explain the technicalities, and variations on that example will be used to illustrate new ideas. An attempt has been made to avoid formal linguistic abbreviations and unexplained jargon.&lt;br /&gt;
&lt;br /&gt;
A formal generative grammar has four components (see slide 19 of this lecture&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://adammikeal.org/courses/compute/Chomsky%20Presentation.pdf&lt;br /&gt;
| title = The Chomsky Hierarchy&lt;br /&gt;
| accessdate = 2012-04-06&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
):&lt;br /&gt;
# a finite number of non-terminal concepts (e.g. ''VerbPhrase'' in the example, or anything else in ''italics''),&lt;br /&gt;
# a finite number of terminal items (e.g. '''girl''' in the example, or anything else in '''bold-face''').&lt;br /&gt;
# a finite set of rules for transforming non-terminal items (e.g. the example has 6 rules).&lt;br /&gt;
# a single starting point (e.g. ''Sentence'' in the example).&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
:Any item which appears on the left-hand side of a transformation rule is non-terminal since it can be replaced by something else; apart from the starting point, all other non-terminals must also appear somewhere on the right-hand side of transformation rule.&lt;br /&gt;
:An item which appears only on the right-hand side of a transformation rule is a terminal item, since it can not be transformed further.&lt;br /&gt;
:A list of all the terminal items is effectively the vocabulary from which sentences are built.&lt;br /&gt;
:Linguists have developed various classes of grammars by using constraints to govern what sort of rules can be used for any particular grammar.&lt;br /&gt;
&lt;br /&gt;
===Changing the rules===&lt;br /&gt;
An relatively small change to even a single rule can make a large change in the language which can be generated. For example, change the first rule in the simple example to read:&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''NounPhrase'' ''VerbPhrase'' '''and''' ''NounPhrase'' ''VerbPhrase''&lt;br /&gt;
This means that a ''Sentence'' is either a ''NounPhrase'' followed by a ''VerbPhrase'' or a ''NounPhrase'' followed by a ''VerbPhrase'' followed by '''and''' followed by a ''NounPhrase'' followed by a ''VerbPhrase''. In addition to the shorter sentences already discussed, this could also generate a sentence such as: &amp;quot;A dog saw a girl and the dog chased the girl&amp;quot;. The total number of grammatically-correct sentences which can be generated by this modified grammar is now 11,772 (108 + 108*108), though some of these may not be very meaingful.&lt;br /&gt;
&lt;br /&gt;
===Towards infinity===&lt;br /&gt;
A significantly different rule change can have an astounding effect. Consider changing the first rule to read:&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''NounPhrase'' ''VerbPhrase'' '''and''' ''Sentence''&lt;br /&gt;
This can generate a potentially infinite number of sentences (any number of these five-word sentences linked by '''and'''). This is an example of what is known as a [[Recursion|recursive]] definition, whereby a ''Sentence'' is partially defined in terms of itself. In such a recursive rule there must be at least one transformation option which does not involve ''Sentence'', otherwise the transformation could never stop.&lt;br /&gt;
&lt;br /&gt;
The above change is known as right-recursive; a left-recursive formulation is also possible, and can in this example generate exactly the same sentences. As shown below  under 'Context-free grammar', there are situations where the choice of left- or right-recursive formulations can change the meaning. &lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''Sentence'' '''and''' ''NounPhrase'' ''VerbPhrase'' &lt;br /&gt;
&lt;br /&gt;
The distinction between left- and right-recursive grammars becomes important when trying to parse/analyse a sentence; some types of parser work best with left-recursive grammars, while other types work best with right-recursive grammars. This distinction is particularly relevant in connection with [[compiler|compiling or translating]] a program written in some high-level [[programming language]] so that it can be used on a [[computer]].&lt;br /&gt;
&lt;br /&gt;
==Chomsky hierarchy==&lt;br /&gt;
By imposing different constraints&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.cs.uaf.edu/2011/spring/cs331/lectures/cs331_20110124_grammar.html&lt;br /&gt;
| title = Lecture notes: Languages &amp;amp; Grammars&lt;br /&gt;
| accessdate = 2012-04-07&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; &lt;br /&gt;
as to what sort of transformation rules could be used, Chomsky was able to define four strictly nested transformational grammars, which he numbered from 0 to 3. As the grammar number increases, the generated language becomes simpler. As the grammar number decreases, parsing a sentence in that language becomes more difficult. The following table provides a summary, which is then explained further in the subsequent subsections.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!| Chomsky&amp;lt;br&amp;gt;number || linguistic name || Rule constraints || Recogniser+ || Notes &lt;br /&gt;
|-&lt;br /&gt;
| 0 || recursively enumerable || [anything] -&amp;gt; [anything] || Turing machine || most human languages &lt;br /&gt;
|-&lt;br /&gt;
| 1 || context-sensitive || X ''A'' Y -&amp;gt; X [anything] Y || linear bounded automaton || X and Y provide the context in which ''A'' can be transformed &lt;br /&gt;
|-&lt;br /&gt;
| 2 || context-free || ''A'' -&amp;gt; [anything] || non-deterministic push-down automaton || syntax analysis for most programming languages &lt;br /&gt;
|-&lt;br /&gt;
| 3 || regular || ''A'' -&amp;gt; [nothing]&amp;lt;br&amp;gt;''A'' -&amp;gt; '''xyz'''&amp;lt;br&amp;gt;''A'' -&amp;gt; '''xyz''' ''B'' || finite automaton&amp;lt;br&amp;gt;or finite state machine || lexical analysis (combining characters into words/tokens)  &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''+''' The '''recogniser''' column indicates the type of mathematical or computer science theoretical model needed to recognise that a sentence belongs to a language, essentially by applying the transformation rules in reverse to work backwards from the actual words in order to finish up with a ''sentence'' (in programming languages the starting concept is usually a ''program''). A finite automaton uses only a small fixed amount of memory, operates in time proportional to the length of the input, and always reaches a decision, while a Turing machine may use an infinite amount of memory and time and may fail to reach a decision (may never stop).&lt;br /&gt;
&lt;br /&gt;
In the linguistic literature, [nothing] is often represented by the symbol '''ε'''.&lt;br /&gt;
&lt;br /&gt;
The descriptions of the various Chomsky levels which follow are presented in reverse order, so as to work up from a simple case to a rather complicated case.&lt;br /&gt;
&lt;br /&gt;
===Level 3: regular grammar===&lt;br /&gt;
The transformation rules for regular grammars are required to be very simple. &lt;br /&gt;
*Only a single non-terminal item can appear on the left-hand side of a rule.&lt;br /&gt;
*The right-hand side of any rule must be one of:&lt;br /&gt;
**[nothing].&lt;br /&gt;
**a terminal item.&lt;br /&gt;
**a terminal item followed by a non-terminal item.&lt;br /&gt;
Note that instead of a terminal item we could have a non-terminal item whose transformation rule immediately resolves to a single terminal item, or to one of several terminal items.&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
Informally we can define a 'word' as a sequence of one or more ''Letter''s. The following regular grammar provides a more formal definition; for simplicity it is restricted to lower-case letters.&lt;br /&gt;
&lt;br /&gt;
 ''Word''     -&amp;gt; ''Letter'' ''PartWord''&lt;br /&gt;
 ''PartWord'' -&amp;gt; [nothing]&lt;br /&gt;
 ''PartWord'' -&amp;gt; ''Letter'' ''PartWord''&lt;br /&gt;
 ''Letter''   -&amp;gt; '''a''', '''b''', ... '''z'''&lt;br /&gt;
&lt;br /&gt;
Note that ''PartWord'' is recursively defined, with the recursion stopping if it is transformed into [nothing].&lt;br /&gt;
&lt;br /&gt;
For one-letter words we expand as: &lt;br /&gt;
:''Word'' -&amp;gt; ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' [nothing] -&amp;gt; ''Letter''&lt;br /&gt;
&lt;br /&gt;
For two-letter words we expand as: &lt;br /&gt;
:''Word'' -&amp;gt; ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' ''Letter'' [nothing] -&amp;gt;  ''Letter'' ''Letter''&lt;br /&gt;
&lt;br /&gt;
Obviously, words of any length can be constructed, though they may well not actually be words from any language. &lt;br /&gt;
&lt;br /&gt;
====Discussion====&lt;br /&gt;
Trying to devise transformation rules to produce words which are more English-like is much more difficult - how do you insist on at least one vowel or on no more than 5 consecutive consonants (e.g. as in 'strengths').&lt;br /&gt;
&lt;br /&gt;
Further examples in [[Regular grammar]] show how numbers can be defined via a regular grammar, and also show how a hyphenated word could be defined.&lt;br /&gt;
&lt;br /&gt;
One of the limitations of a regular grammar is that it can't cope with nested matching brackets, so that it is impossible to write a regular grammar to describe an expression such as '''2 * (3+4)''' where that grammar is expected to allow brackets nested to any depth. A context-free grammar is needed for this, as described in the next section.&lt;br /&gt;
&lt;br /&gt;
Regular grammars or equivalent are widely used by [[compiler]]s in the lexical analysis of programming languages.&lt;br /&gt;
&lt;br /&gt;
===Level 2: context-free grammar===&lt;br /&gt;
The transformation rules for context-free grammars don't appear that much different from those for regular grammars. &lt;br /&gt;
*Only a single non-terminal item can appear on the left-hand side of a rule.&lt;br /&gt;
*The right-hand side of any rule must be one of:&lt;br /&gt;
**[nothing].&lt;br /&gt;
**any combination of terminal items and non-terminal items.&lt;br /&gt;
&lt;br /&gt;
The key difference is that in a regular grammar, any non-empty rule must effectively start with terminal item so that every rule transformation makes some immediate progress, while in a context-free grammar a rule could start with a non-terminal item which itself could be subject to arbitrary further transformations.&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
The following example shows how context-free grammars can cope with arithmetic expressions involving possibly nested brackets. Also an expression such as &amp;quot;2 + 3 * 4&amp;quot; could be interpreted as either &amp;quot;(2 + 3) * 4&amp;quot; = 20 or as &amp;quot;2 + (3 * 4)&amp;quot; = 14. The latter interpretation is that which is normally used - multiplication &amp;quot;*&amp;quot; is said to have a higher priority than addition &amp;quot;+&amp;quot; - so the grammar must incorporate this priority concept. Furthermore, consecutive operators of the same priority are normally applied from left to right, so that &amp;quot;8 - 2 + 3&amp;quot; is interpreted as &amp;quot;(8 - 2) + 3&amp;quot; = 9, rather than as &amp;quot;8 - (2 + 3)&amp;quot; = 3.  This ordering must also be built in to the grammar.&lt;br /&gt;
&lt;br /&gt;
To avoid distracting side-issues, this example only deals with numbers which consist solely of a single digit. The example is a simplified version of the definition of an arithmetic expression given in the Revised Algol 60 Report (Section 3.3.1).&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.masswerk.at/algol60/report.htm&lt;br /&gt;
| title = Revised Report on the Algorithmic Language Algol 60&lt;br /&gt;
| accessdate = 2012-04-22&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ''Expression'' -&amp;gt; ''Term''                        # an ''Expression'' is either a ''Term''&lt;br /&gt;
 ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''    #   or an ''Expression'' followed by '''+''' or '''-''' followed by a ''Term''&lt;br /&gt;
 ''Term''       -&amp;gt; ''Primary''                     # a ''Term'' is either a ''Primary''&lt;br /&gt;
 ''Term''       -&amp;gt; ''Term'' ''MulDivOp'' ''Primary''       #   or a ''Term'' followed by '''*''' or '''/''' followed by a ''Primary''&lt;br /&gt;
                                           #&lt;br /&gt;
 ''Primary''    -&amp;gt; ''Number''                      # a ''Primary'' is either a ''Number''&lt;br /&gt;
 ''Primary''    -&amp;gt; '''(''' ''Expression'' ''')'''              #   or an ''Expression'' enclosed in brackets&lt;br /&gt;
                                           #&lt;br /&gt;
 ''MulDivOp''   -&amp;gt; '''*'''. '''/'''                        # multiplication and division have the same priority&lt;br /&gt;
 ''AddSubOp''   -&amp;gt; '''+'''. '''-'''                        # addition and subtraction have the same priority&lt;br /&gt;
 ''Number''     -&amp;gt; '''0''', '''1''', ... '''9'''                 # this simple-minded definition of a ''Number'' is enough for this example&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
* Both ''Expression'' and ''Term'' are each defined via a left-recursive rule; this ensures that operators of the same priority are applied from left to right.&lt;br /&gt;
* The distinction between ''Expression'' and ''Term'' ensures that multiplication/division are applied before addition/subtraction.&lt;br /&gt;
* ''Expression'' is indirectly recursive via ''Term'' and ''Primary'' to allow bracketed sub-expressions to any depth.&lt;br /&gt;
&lt;br /&gt;
Example 1: generate 2 + 3 * 4&lt;br /&gt;
&lt;br /&gt;
  ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Term'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Primary'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' ''Term''                                 # '''+''' can not be applied until ''Term'' has been evaluated&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' ''Term'' ''MulDivOp'' ''Primary''&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' ''Primary'' ''MulDipOp'' ''Primary''&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' '''3''' '''*''' '''4'''&lt;br /&gt;
&lt;br /&gt;
Example 2: generate 2 * 3 + 4&lt;br /&gt;
&lt;br /&gt;
  ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Term'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Term'' ''MulDivOp'' ''Primary'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Primary'' ''MulDivOp'' ''Primary'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; '''2''' '''*''' '''3''' ''AddSubOp'' ''Term''                      # ''Term'' to left of ''AddSubOp'' is evaluated first&lt;br /&gt;
             -&amp;gt; '''2''' '''*''' '''3''' ''AddSubOp'' ''Primary''  &lt;br /&gt;
             -&amp;gt; '''2''' '''*''' '''3''' '''+''' '''4'''&lt;br /&gt;
&lt;br /&gt;
====Discussion====&lt;br /&gt;
Context-free grammars (or equivalent definitions using Backus-Naur-Form) are widely used both to define the syntax of programming languages and to (semi-automatically) generate parsers for these languages.&lt;br /&gt;
&lt;br /&gt;
A limitation/feature of both regular grammars and context-free grammars is that the left-hand side of any rule is always a single non-terminal item, so any transformation is applied regardless of the context in which that non-terminal item appears.  A simple example which depends on context is the use of singular and plural nouns and verbs in English.  We say: '''the man runs''' or '''the men run''', but not either of '''the man run''' or '''the men runs'''.  Which form of verb to use depends on the noun, i.e. there is a context dependency.&lt;br /&gt;
&lt;br /&gt;
===Level 1===&lt;br /&gt;
For context-sensitive grammars the left-hand side of a rule may indicate the context in which that rule applies, so that the same non-terminal item may be transformed in different ways depending on the context in which it appears.&lt;br /&gt;
&lt;br /&gt;
There is only one transformation rule for context-sensitive grammars:&lt;br /&gt;
&lt;br /&gt;
 X [non-terminal] Y -&amp;gt; X [anything] Y&lt;br /&gt;
&lt;br /&gt;
where X and Y determine the context in which the [non-terminal] is transformed. Note that X and Y may each be terminals or non-terminals or [nothing].&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
Several examples appear in these lecture notes.&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.divms.uiowa.edu/~fleck/taylor.pdf&lt;br /&gt;
| title = Context-sensitive Examples&lt;br /&gt;
| author = Taylor&lt;br /&gt;
| accessdate = 2012-04-26&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Level 0===&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[category:linguistics]]&lt;br /&gt;
[[Category:Computer Science]]&lt;/div&gt;</summary>
		<author><name>RolandPlankton</name></author>
	</entry>
	<entry>
		<id>https://www.conservapedia.com/index.php?title=Chomsky_hierarchy&amp;diff=978903</id>
		<title>Chomsky hierarchy</title>
		<link rel="alternate" type="text/html" href="https://www.conservapedia.com/index.php?title=Chomsky_hierarchy&amp;diff=978903"/>
		<updated>2012-04-30T13:23:35Z</updated>

		<summary type="html">&lt;p&gt;RolandPlankton: /* Discussion */ grammar&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The '''Chomsky hierarchy''', sometimes known as the '''Chomsky-Schützenberger hierarchy''', is a hierarchy of formal grammatical systems for describing various classes of languages; the hierarchy can apply to both human and computer languages. This hierarchy was first published in 1956 by [[Noam Chomsky|Chomsky]].&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite journal &lt;br /&gt;
| title = Three models for the description of language &lt;br /&gt;
| year = 1956 &lt;br /&gt;
| last = Chomsky &lt;br /&gt;
| first = Noam &lt;br /&gt;
| journal = IRE Transactions on Information Theory &lt;br /&gt;
| volume = 2 &lt;br /&gt;
| pages = 113–124 &lt;br /&gt;
| url = http://www.chomsky.info/articles/195609--.pdf &lt;br /&gt;
| accessdate = 2012-04-08&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
These grammatical systems were referred to by Chomsky as ''transformational grammars''.  Other linguists have since developed a variety of similar grammars; together these are known as ''generative grammars''. &lt;br /&gt;
&lt;br /&gt;
The basic idea of a '''generative grammar''' is to provide a set of rules which are capable of generating all possible grammatical sentences in some language; the rules must constrain the generation so that only grammatical sentences are generated. The rules can also be used in reverse to parse a sentence and check if it is grammatical.&lt;br /&gt;
&lt;br /&gt;
In the late 1950's, [[John Backus]] and Peter Naur developed a notation for describing [[programming language]]s. This notation is known as [[Backus Naur Form]] (or BNF) and turns out to be equivalent to Chomsky's grammar number two (context-free grammar), although it was developed independently of Chomsky's work. Backus-Naur Form was first used in the Algol 60 Report to specify the syntax of [[Algol 60]], and has since been used for specifying the syntax of other programming languages. &lt;br /&gt;
&lt;br /&gt;
==Example of a very simple generative grammar==&lt;br /&gt;
This very simple example can handle only a tiny subset of English and should not be taken seriously as a guide to English grammar or vocabulary. It is based on an example by David Crystal&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite book &lt;br /&gt;
| last = Crystal &lt;br /&gt;
| first = David  &lt;br /&gt;
| title = The Cambridge Encyclopedia of Language &lt;br /&gt;
| publisher = Cambridge University Press &lt;br /&gt;
| year = 1987 &lt;br /&gt;
| isbn = 0-521-42443-7&lt;br /&gt;
| pages = page 97&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; and is a slight extension of an example on slide 9 of this lecture.&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.cs.princeton.edu/~rywang/99f126/slides/16th.pdf&lt;br /&gt;
| title = Lecture notes: Formal Languages&lt;br /&gt;
| accessdate = 2012-04-07}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase''         # A ''Sentence'' consists of a ''NounPhrase'' followed by a ''VerbPhrase''&lt;br /&gt;
 ''NounPhrase'' -&amp;gt;  ''Determiner'' ''Noun''               # A ''NounPhrase'' consists of a ''Determiner'' followed by a ''Noun''&lt;br /&gt;
 ''VerbPhrase'' -&amp;gt;  ''Verb'' ''NounPhrase''               # A ''VerbPhrase'' consists of a ''Verb'' followed by a ''NounPhrase''&lt;br /&gt;
 ''Determiner'' -&amp;gt;  '''a''', '''the'''                        # A ''Determiner''  is one of: '''a''' or '''the'''&lt;br /&gt;
 ''Noun''       -&amp;gt;  '''boy''', '''girl''', '''dog'''                # A ''Noun'' is one of: '''boy''' or '''girl''' or '''dog'''  &lt;br /&gt;
 ''Verb''       -&amp;gt;  '''chased''', '''heard''', '''saw'''            # A ''Verb'' is one of: '''chased''' or '''heard''' or '''saw'''&lt;br /&gt;
&lt;br /&gt;
Notation used above: &lt;br /&gt;
:The symbol &amp;quot;-&amp;gt;&amp;quot; means &amp;quot;can be replaced by&amp;quot;.  &lt;br /&gt;
:When there are several items on the right hand side separated by commas, just one of these items can be selected. &lt;br /&gt;
:The comments preceded by &amp;quot;#&amp;quot; are not part of the generative grammar, but hopefully will help folks understand the example a little better.&lt;br /&gt;
&lt;br /&gt;
By making appropriate substitutions we can generate such sentences as:&lt;br /&gt;
:The dog chased a girl.&lt;br /&gt;
:The girl heard the dog.&lt;br /&gt;
:The boy saw a girl.&lt;br /&gt;
&lt;br /&gt;
The stages in the generation of these examples are as follows:&lt;br /&gt;
:''Sentence''&lt;br /&gt;
:-&amp;gt; ''NounPhrase'' ''VerbPhrase''&lt;br /&gt;
:-&amp;gt; ''Determiner'' ''Noun'' ''Verb'' ''NounPhrase''&lt;br /&gt;
:-&amp;gt; ''Determiner'' ''Noun'' ''Verb'' ''Determiner'' ''Noun''&lt;br /&gt;
&lt;br /&gt;
By appropriate selection of words to substitute for ''Determiner'', ''Noun'', and ''Verb'' we can produce the 3 example sentences above.&lt;br /&gt;
&lt;br /&gt;
The simple grammar defines a few words which can be substituted for ''Determiner'', ''Noun'', and ''Verb''. There are two possibilities for ''Determiner'', three for ''Noun'', and three for ''Verb'', with both ''Determiner'' and ''Noun'' appearing twice in the expansion. Hence the total number of grammatical sentences which can be generated by this simple grammar is 108 (= 2 * 3 * 3 * 2 * 3). In this particular case the possible words have been carefully chosen so that all of these 108 sentences also actually mean something.&lt;br /&gt;
&lt;br /&gt;
Note that the use of ''italics'' and '''boldface''' in this example is merely a convenient way of indicating the difference between items which can be expanded further (e.g. concepts such as ''NounPhrase'') and items which can not be expanded further (e.g. words such as '''girl'''). In the linguistic literature, items which can be expanded further are referred to as 'non-terminal' items, while items which can't be expanded further are known as 'terminal' items.&lt;br /&gt;
&lt;br /&gt;
The 'comma' notation for alternatives is a form of shorthand. In some formulations this would be shown as several separate rules, so that:&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''a''', '''the''' &lt;br /&gt;
could be shown as two rules:&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''a'''&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''the''' &lt;br /&gt;
&lt;br /&gt;
==Caution==&lt;br /&gt;
While a generative grammar may produce sentences which are grammatically correct, there is no certainty that such sentences will actually mean anything. The classic example of such a meaningless sentence is from Chomsky's book&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite book &lt;br /&gt;
| last = Chomsky &lt;br /&gt;
| first = Noam &lt;br /&gt;
| title = Syntactic Structures &lt;br /&gt;
| year = 1957 &lt;br /&gt;
| publisher = Mouton &lt;br /&gt;
| location = The Hague/Paris &lt;br /&gt;
| pages = page 15 &lt;br /&gt;
| isbn = 3-11-017279-8&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; with the grammatically correct sentence:&lt;br /&gt;
&lt;br /&gt;
:&amp;quot;Colorless green ideas sleep furiously.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
:This example illustrates the difference between grammar/syntax and meaning/semantics.&lt;br /&gt;
&lt;br /&gt;
Another problem when analysing a sentence is that many English words have multiple meanings, so that there may be more than one way to interpret a sentence. A simple example is the sentence: &lt;br /&gt;
:&amp;quot;Time flies.&amp;quot; &lt;br /&gt;
:Is this an instruction to check how fast flies are flying, or an indication that time appears to be passing quickly? &lt;br /&gt;
:A varied and entertaining selection of such ambiguities has been compiled by Jeff Gray.&amp;lt;ref&amp;gt;{{Cite web &lt;br /&gt;
| title = Collection of Ambiguous or Inconsistent/Incomplete Statements  &lt;br /&gt;
| url = http://www.gray-area.org/Research/Ambig/ &lt;br /&gt;
| author = Jeff Gray&lt;br /&gt;
| accessdate = 2012-04-10&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Formal grammar==&lt;br /&gt;
'''Note''': this section and subsequent sections are, by necessity, slightly more technical/formal than the earlier parts of this article, though specialist notation has been largely avoided. Make sure that you understand the 'Simple example' above before proceeding further, since references will be made to that example to help explain the technicalities, and variations on that example will be used to illustrate new ideas. An attempt has been made to avoid formal linguistic abbreviations and unexplained jargon.&lt;br /&gt;
&lt;br /&gt;
A formal generative grammar has four components (see slide 19 of this lecture&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://adammikeal.org/courses/compute/Chomsky%20Presentation.pdf&lt;br /&gt;
| title = The Chomsky Hierarchy&lt;br /&gt;
| accessdate = 2012-04-06&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
):&lt;br /&gt;
# a finite number of non-terminal concepts (e.g. ''VerbPhrase'' in the example, or anything else in ''italics''),&lt;br /&gt;
# a finite number of terminal items (e.g. '''girl''' in the example, or anything else in '''bold-face''').&lt;br /&gt;
# a finite set of rules for transforming non-terminal items (e.g. the example has 6 rules).&lt;br /&gt;
# a single starting point (e.g. ''Sentence'' in the example).&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
:Any item which appears on the left-hand side of a transformation rule is non-terminal since it can be replaced by something else; apart from the starting point, all other non-terminals must also appear somewhere on the right-hand side of transformation rule.&lt;br /&gt;
:An item which appears only on the right-hand side of a transformation rule is a terminal item, since it can not be transformed further.&lt;br /&gt;
:A list of all the terminal items is effectively the vocabulary from which sentences are built.&lt;br /&gt;
:Linguists have developed various classes of grammars by using constraints to govern what sort of rules can be used for any particular grammar.&lt;br /&gt;
&lt;br /&gt;
===Changing the rules===&lt;br /&gt;
An relatively small change to even a single rule can make a large change in the language which can be generated. For example, change the first rule in the simple example to read:&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''NounPhrase'' ''VerbPhrase'' '''and''' ''NounPhrase'' ''VerbPhrase''&lt;br /&gt;
This means that a ''Sentence'' is either a ''NounPhrase'' followed by a ''VerbPhrase'' or a ''NounPhrase'' followed by a ''VerbPhrase'' followed by '''and''' followed by a ''NounPhrase'' followed by a ''VerbPhrase''. In addition to the shorter sentences already discussed, this could also generate a sentence such as: &amp;quot;A dog saw a girl and the dog chased the girl&amp;quot;. The total number of grammatically-correct sentences which can be generated by this modified grammar is now 11,772 (108 + 108*108), though some of these may not be very meaingful.&lt;br /&gt;
&lt;br /&gt;
===Towards infinity===&lt;br /&gt;
A significantly different rule change can have an astounding effect. Consider changing the first rule to read:&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''NounPhrase'' ''VerbPhrase'' '''and''' ''Sentence''&lt;br /&gt;
This can generate a potentially infinite number of sentences (any number of these five-word sentences linked by '''and'''). This is an example of what is known as a [[Recursion|recursive]] definition, whereby a ''Sentence'' is partially defined in terms of itself. In such a recursive rule there must be at least one transformation option which does not involve ''Sentence'', otherwise the transformation could never stop.&lt;br /&gt;
&lt;br /&gt;
The above change is known as right-recursive; a left-recursive formulation is also possible, and can in this example generate exactly the same sentences. As shown below  under 'Context-free grammar', there are situations where the choice of left- or right-recursive formulations can change the meaning. &lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''Sentence'' '''and''' ''NounPhrase'' ''VerbPhrase'' &lt;br /&gt;
&lt;br /&gt;
The distinction between left- and right-recursive grammars becomes important when trying to parse/analyse a sentence; some types of parser work best with left-recursive grammars, while other types work best with right-recursive grammars. This distinction is particularly relevant in connection with [[compiler|compiling or translating]] a program written in some high-level [[programming language]] so that it can be used on a [[computer]].&lt;br /&gt;
&lt;br /&gt;
==Chomsky hierarchy==&lt;br /&gt;
By imposing different constraints&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.cs.uaf.edu/2011/spring/cs331/lectures/cs331_20110124_grammar.html&lt;br /&gt;
| title = Lecture notes: Languages &amp;amp; Grammars&lt;br /&gt;
| accessdate = 2012-04-07&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; &lt;br /&gt;
as to what sort of transformation rules could be used, Chomsky was able to define four strictly nested transformational grammars, which he numbered from 0 to 3. As the grammar number increases, the generated language becomes simpler. As the grammar number decreases, parsing a sentence in that language becomes more difficult. The following table provides a summary, which is then explained further in the subsequent subsections.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!| Chomsky&amp;lt;br&amp;gt;number || linguistic name || Rule constraints || Recogniser+ || Notes &lt;br /&gt;
|-&lt;br /&gt;
| 0 || recursively enumerable || [anything] -&amp;gt; [anything] || Turing machine || most human languages &lt;br /&gt;
|-&lt;br /&gt;
| 1 || context-sensitive || X ''A'' Y -&amp;gt; X [anything] Y || linear bounded automaton || X and Y provide the context in which ''A'' can be transformed &lt;br /&gt;
|-&lt;br /&gt;
| 2 || context-free || ''A'' -&amp;gt; [anything] || non-deterministic push-down automaton || syntax analysis for most programming languages &lt;br /&gt;
|-&lt;br /&gt;
| 3 || regular || ''A'' -&amp;gt; [nothing]&amp;lt;br&amp;gt;''A'' -&amp;gt; '''xyz'''&amp;lt;br&amp;gt;''A'' -&amp;gt; '''xyz''' ''B'' || finite automaton&amp;lt;br&amp;gt;or finite state machine || lexical analysis (combining characters into words/tokens)  &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''+''' The '''recogniser''' column indicates the type of mathematical or computer science theoretical model needed to recognise that a sentence belongs to a language, essentially by applying the transformation rules in reverse to work backwards from the actual words in order to finish up with a ''sentence'' (in programming languages the starting concept is usually a ''program''). A finite automaton uses only a small fixed amount of memory, operates in time proportional to the length of the input, and always reaches a decision, while a Turing machine may use an infinite amount of memory and time and may fail to reach a decision (may never stop).&lt;br /&gt;
&lt;br /&gt;
In the linguistic literature, [nothing] is often represented by the symbol '''ε'''.&lt;br /&gt;
&lt;br /&gt;
The descriptions of the various Chomsky levels which follow are presented in reverse order, so as to work up from a simple case to a rather complicated case.&lt;br /&gt;
&lt;br /&gt;
===Level 3: regular grammar===&lt;br /&gt;
The transformation rules for regular grammars are required to be very simple. &lt;br /&gt;
*Only a single non-terminal item can appear on the left-hand side of a rule.&lt;br /&gt;
*The right-hand side of any rule must be one of:&lt;br /&gt;
**[nothing].&lt;br /&gt;
**a terminal item.&lt;br /&gt;
**a terminal item followed by a non-terminal item.&lt;br /&gt;
Note that instead of a terminal item we could have a non-terminal item whose transformation rule immediately resolves to a single terminal item, or to one of several terminal items.&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
Informally we can define a 'word' as a sequence of one or more ''Letter''s. The following regular grammar provides a more formal definition; for simplicity it is restricted to lower-case letters.&lt;br /&gt;
&lt;br /&gt;
 ''Word''     -&amp;gt; ''Letter'' ''PartWord''&lt;br /&gt;
 ''PartWord'' -&amp;gt; [nothing]&lt;br /&gt;
 ''PartWord'' -&amp;gt; ''Letter'' ''PartWord''&lt;br /&gt;
 ''Letter''   -&amp;gt; '''a''', '''b''', ... '''z'''&lt;br /&gt;
&lt;br /&gt;
Note that ''PartWord'' is recursively defined, with the recursion stopping if it is transformed into [nothing].&lt;br /&gt;
&lt;br /&gt;
For one-letter words we expand as: &lt;br /&gt;
:''Word'' -&amp;gt; ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' [nothing] -&amp;gt; ''Letter''&lt;br /&gt;
&lt;br /&gt;
For two-letter words we expand as: &lt;br /&gt;
:''Word'' -&amp;gt; ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' ''Letter'' [nothing] -&amp;gt;  ''Letter'' ''Letter''&lt;br /&gt;
&lt;br /&gt;
Obviously, words of any length can be constructed, though they may well not actually be words from any language. &lt;br /&gt;
&lt;br /&gt;
====Discussion====&lt;br /&gt;
Trying to devise transformation rules to produce words which are more English-like is much more difficult - how do you insist on at least one vowel or on no more than 5 consecutive consonants (e.g. as in 'strengths').&lt;br /&gt;
&lt;br /&gt;
Further examples in [[Regular grammar]] show how numbers can be defined via a regular grammar, and also show how a hyphenated word could be defined.&lt;br /&gt;
&lt;br /&gt;
One of the limitations of a regular grammar is that it can't cope with nested matching brackets, so that it is impossible to write a regular grammar to describe an expression such as '''2 * (3+4)''' where that grammar is expected to allow brackets nested to any depth. A context-free grammar is needed for this, as described in the next section.&lt;br /&gt;
&lt;br /&gt;
Regular grammars or equivalent are widely used by [[compiler]]s in the lexical analysis of programming languages.&lt;br /&gt;
&lt;br /&gt;
===Level 2: context-free grammar===&lt;br /&gt;
The transformation rules for context-free grammars don't appear that much different from those for regular grammars. &lt;br /&gt;
*Only a single non-terminal item can appear on the left-hand side of a rule.&lt;br /&gt;
*The right-hand side of any rule must be one of:&lt;br /&gt;
**[nothing].&lt;br /&gt;
**any combination of terminal items and non-terminal items.&lt;br /&gt;
&lt;br /&gt;
The key difference is that in a regular grammar, any non-empty rule must effectively start with terminal item so that every rule transformation makes some immediate progress, while in a context-free grammar a rule could start with a non-terminal item which itself could be subject to arbitrary further transformations.&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
The following example shows how context-free grammars can cope with arithmetic expressions involving possibly nested brackets. Also an expression such as &amp;quot;2 + 3 * 4&amp;quot; could be interpreted as either &amp;quot;(2 + 3) * 4&amp;quot; = 20 or as &amp;quot;2 + (3 * 4)&amp;quot; = 14. The latter interpretation is that which is normally used - multiplication &amp;quot;*&amp;quot; is said to have a higher priority than addition &amp;quot;+&amp;quot; - so the grammar must incorporate this priority concept. Furthermore, consecutive operators of the same priority are normally applied from left to right, so that &amp;quot;8 - 2 + 3&amp;quot; is interpreted as &amp;quot;(8 - 2) + 3&amp;quot; = 9, rather than as &amp;quot;8 - (2 + 3)&amp;quot; = 3.  This ordering must also be built in to the grammar.&lt;br /&gt;
&lt;br /&gt;
To avoid distracting side-issues, this example only deals with numbers which consist solely of a single digit. The example is a simplified version of the definition of an arithmetic expression given in the Revised Algol 60 Report (Section 3.3.1).&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.masswerk.at/algol60/report.htm&lt;br /&gt;
| title = Revised Report on the Algorithmic Language Algol 60&lt;br /&gt;
| accessdate = 2012-04-22&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ''Expression'' -&amp;gt; ''Term''                        # an ''Expression'' is either a ''Term''&lt;br /&gt;
 ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''    #   or an ''Expression'' followed by '''+''' or '''-''' followed by a ''Term''&lt;br /&gt;
 ''Term''       -&amp;gt; ''Primary''                     # a ''Term'' is either a ''Primary''&lt;br /&gt;
 ''Term''       -&amp;gt; ''Term'' ''MulDivOp'' ''Primary''       #   or a ''Term'' followed by '''*''' or '''/''' followed by a ''Primary''&lt;br /&gt;
                                           #&lt;br /&gt;
 ''Primary''    -&amp;gt; ''Number''                      # a ''Primary'' is either a ''Number''&lt;br /&gt;
 ''Primary''    -&amp;gt; '''(''' ''Expression'' ''')'''              #   or an ''Expression'' enclosed in brackets&lt;br /&gt;
                                           #&lt;br /&gt;
 ''MulDivOp''   -&amp;gt; '''*'''. '''/'''                        # multiplication and division have the same priority&lt;br /&gt;
 ''AddSubOp''   -&amp;gt; '''+'''. '''-'''                        # addition and subtraction have the same priority&lt;br /&gt;
 ''Number''     -&amp;gt; '''0''', '''1''', ... '''9'''                 # this simple-minded definition of a ''Number'' is enough for this example&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
* Both ''Expression'' and ''Term'' are each defined via a left-recursive rule; this ensures that operators of the same priority are applied from left to right.&lt;br /&gt;
* The distinction between ''Expression'' and ''Term'' ensures that multiplication/division are applied before addition/subtraction.&lt;br /&gt;
* ''Expression'' is indirectly recursive via ''Term'' and ''Primary'' to allow bracketed sub-expressions to any depth.&lt;br /&gt;
&lt;br /&gt;
Example 1: generate 2 + 3 * 4&lt;br /&gt;
&lt;br /&gt;
  ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Term'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Primary'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' ''Term''                                 # '''+''' can not be applied until ''Term'' has been evaluated&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' ''Term'' ''MulDivOp'' ''Primary''&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' ''Primary'' ''MulDipOp'' ''Primary''&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' '''3''' '''*''' '''4'''&lt;br /&gt;
&lt;br /&gt;
Example 2: generate 2 * 3 + 4&lt;br /&gt;
&lt;br /&gt;
  ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Term'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Term'' ''MulDivOp'' ''Primary'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Primary'' ''MulDivOp'' ''Primary'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; '''2''' '''*''' '''3''' ''AddSubOp'' ''Term''                      # ''Term'' to left of ''AddSubOp'' is evaluated first&lt;br /&gt;
             -&amp;gt; '''2''' '''*''' '''3''' ''AddSubOp'' ''Primary''  &lt;br /&gt;
             -&amp;gt; '''2''' '''*''' '''3''' '''+''' '''4'''&lt;br /&gt;
&lt;br /&gt;
====Discussion====&lt;br /&gt;
Context-free grammars (or equivalent definitions using Backus-Naur-Form) are widely used both to define the syntax of programming languages and to (semi-automatically) generate parsers for these languages.&lt;br /&gt;
&lt;br /&gt;
===Level 1===&lt;br /&gt;
For both regular grammars and context-free grammars, the left-hand side of any rule is always a single non-terminal item, and any transformation is applied regardless of the context in which that non-terminal item appears.&lt;br /&gt;
&lt;br /&gt;
For context-sensitive grammars the left-hand side of a rule may indicate the context in which that rule applies, so that the same non-terminal item may be transformed in different ways depending on the context in which it appears. Several examples appear in these lecture notes.&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.divms.uiowa.edu/~fleck/taylor.pdf&lt;br /&gt;
| title = Context-sensitive Examples&lt;br /&gt;
| accessdate = 2012-04-26&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Level 0===&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[category:linguistics]]&lt;br /&gt;
[[Category:Computer Science]]&lt;/div&gt;</summary>
		<author><name>RolandPlankton</name></author>
	</entry>
	<entry>
		<id>https://www.conservapedia.com/index.php?title=Chomsky_hierarchy&amp;diff=978901</id>
		<title>Chomsky hierarchy</title>
		<link rel="alternate" type="text/html" href="https://www.conservapedia.com/index.php?title=Chomsky_hierarchy&amp;diff=978901"/>
		<updated>2012-04-30T13:20:34Z</updated>

		<summary type="html">&lt;p&gt;RolandPlankton: /* Chomsky hierarchy */ grammar&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The '''Chomsky hierarchy''', sometimes known as the '''Chomsky-Schützenberger hierarchy''', is a hierarchy of formal grammatical systems for describing various classes of languages; the hierarchy can apply to both human and computer languages. This hierarchy was first published in 1956 by [[Noam Chomsky|Chomsky]].&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite journal &lt;br /&gt;
| title = Three models for the description of language &lt;br /&gt;
| year = 1956 &lt;br /&gt;
| last = Chomsky &lt;br /&gt;
| first = Noam &lt;br /&gt;
| journal = IRE Transactions on Information Theory &lt;br /&gt;
| volume = 2 &lt;br /&gt;
| pages = 113–124 &lt;br /&gt;
| url = http://www.chomsky.info/articles/195609--.pdf &lt;br /&gt;
| accessdate = 2012-04-08&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
These grammatical systems were referred to by Chomsky as ''transformational grammars''.  Other linguists have since developed a variety of similar grammars; together these are known as ''generative grammars''. &lt;br /&gt;
&lt;br /&gt;
The basic idea of a '''generative grammar''' is to provide a set of rules which are capable of generating all possible grammatical sentences in some language; the rules must constrain the generation so that only grammatical sentences are generated. The rules can also be used in reverse to parse a sentence and check if it is grammatical.&lt;br /&gt;
&lt;br /&gt;
In the late 1950's, [[John Backus]] and Peter Naur developed a notation for describing [[programming language]]s. This notation is known as [[Backus Naur Form]] (or BNF) and turns out to be equivalent to Chomsky's grammar number two (context-free grammar), although it was developed independently of Chomsky's work. Backus-Naur Form was first used in the Algol 60 Report to specify the syntax of [[Algol 60]], and has since been used for specifying the syntax of other programming languages. &lt;br /&gt;
&lt;br /&gt;
==Example of a very simple generative grammar==&lt;br /&gt;
This very simple example can handle only a tiny subset of English and should not be taken seriously as a guide to English grammar or vocabulary. It is based on an example by David Crystal&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite book &lt;br /&gt;
| last = Crystal &lt;br /&gt;
| first = David  &lt;br /&gt;
| title = The Cambridge Encyclopedia of Language &lt;br /&gt;
| publisher = Cambridge University Press &lt;br /&gt;
| year = 1987 &lt;br /&gt;
| isbn = 0-521-42443-7&lt;br /&gt;
| pages = page 97&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; and is a slight extension of an example on slide 9 of this lecture.&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.cs.princeton.edu/~rywang/99f126/slides/16th.pdf&lt;br /&gt;
| title = Lecture notes: Formal Languages&lt;br /&gt;
| accessdate = 2012-04-07}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase''         # A ''Sentence'' consists of a ''NounPhrase'' followed by a ''VerbPhrase''&lt;br /&gt;
 ''NounPhrase'' -&amp;gt;  ''Determiner'' ''Noun''               # A ''NounPhrase'' consists of a ''Determiner'' followed by a ''Noun''&lt;br /&gt;
 ''VerbPhrase'' -&amp;gt;  ''Verb'' ''NounPhrase''               # A ''VerbPhrase'' consists of a ''Verb'' followed by a ''NounPhrase''&lt;br /&gt;
 ''Determiner'' -&amp;gt;  '''a''', '''the'''                        # A ''Determiner''  is one of: '''a''' or '''the'''&lt;br /&gt;
 ''Noun''       -&amp;gt;  '''boy''', '''girl''', '''dog'''                # A ''Noun'' is one of: '''boy''' or '''girl''' or '''dog'''  &lt;br /&gt;
 ''Verb''       -&amp;gt;  '''chased''', '''heard''', '''saw'''            # A ''Verb'' is one of: '''chased''' or '''heard''' or '''saw'''&lt;br /&gt;
&lt;br /&gt;
Notation used above: &lt;br /&gt;
:The symbol &amp;quot;-&amp;gt;&amp;quot; means &amp;quot;can be replaced by&amp;quot;.  &lt;br /&gt;
:When there are several items on the right hand side separated by commas, just one of these items can be selected. &lt;br /&gt;
:The comments preceded by &amp;quot;#&amp;quot; are not part of the generative grammar, but hopefully will help folks understand the example a little better.&lt;br /&gt;
&lt;br /&gt;
By making appropriate substitutions we can generate such sentences as:&lt;br /&gt;
:The dog chased a girl.&lt;br /&gt;
:The girl heard the dog.&lt;br /&gt;
:The boy saw a girl.&lt;br /&gt;
&lt;br /&gt;
The stages in the generation of these examples are as follows:&lt;br /&gt;
:''Sentence''&lt;br /&gt;
:-&amp;gt; ''NounPhrase'' ''VerbPhrase''&lt;br /&gt;
:-&amp;gt; ''Determiner'' ''Noun'' ''Verb'' ''NounPhrase''&lt;br /&gt;
:-&amp;gt; ''Determiner'' ''Noun'' ''Verb'' ''Determiner'' ''Noun''&lt;br /&gt;
&lt;br /&gt;
By appropriate selection of words to substitute for ''Determiner'', ''Noun'', and ''Verb'' we can produce the 3 example sentences above.&lt;br /&gt;
&lt;br /&gt;
The simple grammar defines a few words which can be substituted for ''Determiner'', ''Noun'', and ''Verb''. There are two possibilities for ''Determiner'', three for ''Noun'', and three for ''Verb'', with both ''Determiner'' and ''Noun'' appearing twice in the expansion. Hence the total number of grammatical sentences which can be generated by this simple grammar is 108 (= 2 * 3 * 3 * 2 * 3). In this particular case the possible words have been carefully chosen so that all of these 108 sentences also actually mean something.&lt;br /&gt;
&lt;br /&gt;
Note that the use of ''italics'' and '''boldface''' in this example is merely a convenient way of indicating the difference between items which can be expanded further (e.g. concepts such as ''NounPhrase'') and items which can not be expanded further (e.g. words such as '''girl'''). In the linguistic literature, items which can be expanded further are referred to as 'non-terminal' items, while items which can't be expanded further are known as 'terminal' items.&lt;br /&gt;
&lt;br /&gt;
The 'comma' notation for alternatives is a form of shorthand. In some formulations this would be shown as several separate rules, so that:&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''a''', '''the''' &lt;br /&gt;
could be shown as two rules:&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''a'''&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''the''' &lt;br /&gt;
&lt;br /&gt;
==Caution==&lt;br /&gt;
While a generative grammar may produce sentences which are grammatically correct, there is no certainty that such sentences will actually mean anything. The classic example of such a meaningless sentence is from Chomsky's book&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite book &lt;br /&gt;
| last = Chomsky &lt;br /&gt;
| first = Noam &lt;br /&gt;
| title = Syntactic Structures &lt;br /&gt;
| year = 1957 &lt;br /&gt;
| publisher = Mouton &lt;br /&gt;
| location = The Hague/Paris &lt;br /&gt;
| pages = page 15 &lt;br /&gt;
| isbn = 3-11-017279-8&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; with the grammatically correct sentence:&lt;br /&gt;
&lt;br /&gt;
:&amp;quot;Colorless green ideas sleep furiously.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
:This example illustrates the difference between grammar/syntax and meaning/semantics.&lt;br /&gt;
&lt;br /&gt;
Another problem when analysing a sentence is that many English words have multiple meanings, so that there may be more than one way to interpret a sentence. A simple example is the sentence: &lt;br /&gt;
:&amp;quot;Time flies.&amp;quot; &lt;br /&gt;
:Is this an instruction to check how fast flies are flying, or an indication that time appears to be passing quickly? &lt;br /&gt;
:A varied and entertaining selection of such ambiguities has been compiled by Jeff Gray.&amp;lt;ref&amp;gt;{{Cite web &lt;br /&gt;
| title = Collection of Ambiguous or Inconsistent/Incomplete Statements  &lt;br /&gt;
| url = http://www.gray-area.org/Research/Ambig/ &lt;br /&gt;
| author = Jeff Gray&lt;br /&gt;
| accessdate = 2012-04-10&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Formal grammar==&lt;br /&gt;
'''Note''': this section and subsequent sections are, by necessity, slightly more technical/formal than the earlier parts of this article, though specialist notation has been largely avoided. Make sure that you understand the 'Simple example' above before proceeding further, since references will be made to that example to help explain the technicalities, and variations on that example will be used to illustrate new ideas. An attempt has been made to avoid formal linguistic abbreviations and unexplained jargon.&lt;br /&gt;
&lt;br /&gt;
A formal generative grammar has four components (see slide 19 of this lecture&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://adammikeal.org/courses/compute/Chomsky%20Presentation.pdf&lt;br /&gt;
| title = The Chomsky Hierarchy&lt;br /&gt;
| accessdate = 2012-04-06&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
):&lt;br /&gt;
# a finite number of non-terminal concepts (e.g. ''VerbPhrase'' in the example, or anything else in ''italics''),&lt;br /&gt;
# a finite number of terminal items (e.g. '''girl''' in the example, or anything else in '''bold-face''').&lt;br /&gt;
# a finite set of rules for transforming non-terminal items (e.g. the example has 6 rules).&lt;br /&gt;
# a single starting point (e.g. ''Sentence'' in the example).&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
:Any item which appears on the left-hand side of a transformation rule is non-terminal since it can be replaced by something else; apart from the starting point, all other non-terminals must also appear somewhere on the right-hand side of transformation rule.&lt;br /&gt;
:An item which appears only on the right-hand side of a transformation rule is a terminal item, since it can not be transformed further.&lt;br /&gt;
:A list of all the terminal items is effectively the vocabulary from which sentences are built.&lt;br /&gt;
:Linguists have developed various classes of grammars by using constraints to govern what sort of rules can be used for any particular grammar.&lt;br /&gt;
&lt;br /&gt;
===Changing the rules===&lt;br /&gt;
An relatively small change to even a single rule can make a large change in the language which can be generated. For example, change the first rule in the simple example to read:&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''NounPhrase'' ''VerbPhrase'' '''and''' ''NounPhrase'' ''VerbPhrase''&lt;br /&gt;
This means that a ''Sentence'' is either a ''NounPhrase'' followed by a ''VerbPhrase'' or a ''NounPhrase'' followed by a ''VerbPhrase'' followed by '''and''' followed by a ''NounPhrase'' followed by a ''VerbPhrase''. In addition to the shorter sentences already discussed, this could also generate a sentence such as: &amp;quot;A dog saw a girl and the dog chased the girl&amp;quot;. The total number of grammatically-correct sentences which can be generated by this modified grammar is now 11,772 (108 + 108*108), though some of these may not be very meaingful.&lt;br /&gt;
&lt;br /&gt;
===Towards infinity===&lt;br /&gt;
A significantly different rule change can have an astounding effect. Consider changing the first rule to read:&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''NounPhrase'' ''VerbPhrase'' '''and''' ''Sentence''&lt;br /&gt;
This can generate a potentially infinite number of sentences (any number of these five-word sentences linked by '''and'''). This is an example of what is known as a [[Recursion|recursive]] definition, whereby a ''Sentence'' is partially defined in terms of itself. In such a recursive rule there must be at least one transformation option which does not involve ''Sentence'', otherwise the transformation could never stop.&lt;br /&gt;
&lt;br /&gt;
The above change is known as right-recursive; a left-recursive formulation is also possible, and can in this example generate exactly the same sentences. As shown below  under 'Context-free grammar', there are situations where the choice of left- or right-recursive formulations can change the meaning. &lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''Sentence'' '''and''' ''NounPhrase'' ''VerbPhrase'' &lt;br /&gt;
&lt;br /&gt;
The distinction between left- and right-recursive grammars becomes important when trying to parse/analyse a sentence; some types of parser work best with left-recursive grammars, while other types work best with right-recursive grammars. This distinction is particularly relevant in connection with [[compiler|compiling or translating]] a program written in some high-level [[programming language]] so that it can be used on a [[computer]].&lt;br /&gt;
&lt;br /&gt;
==Chomsky hierarchy==&lt;br /&gt;
By imposing different constraints&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.cs.uaf.edu/2011/spring/cs331/lectures/cs331_20110124_grammar.html&lt;br /&gt;
| title = Lecture notes: Languages &amp;amp; Grammars&lt;br /&gt;
| accessdate = 2012-04-07&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; &lt;br /&gt;
as to what sort of transformation rules could be used, Chomsky was able to define four strictly nested transformational grammars, which he numbered from 0 to 3. As the grammar number increases, the generated language becomes simpler. As the grammar number decreases, parsing a sentence in that language becomes more difficult. The following table provides a summary, which is then explained further in the subsequent subsections.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!| Chomsky&amp;lt;br&amp;gt;number || linguistic name || Rule constraints || Recogniser+ || Notes &lt;br /&gt;
|-&lt;br /&gt;
| 0 || recursively enumerable || [anything] -&amp;gt; [anything] || Turing machine || most human languages &lt;br /&gt;
|-&lt;br /&gt;
| 1 || context-sensitive || X ''A'' Y -&amp;gt; X [anything] Y || linear bounded automaton || X and Y provide the context in which ''A'' can be transformed &lt;br /&gt;
|-&lt;br /&gt;
| 2 || context-free || ''A'' -&amp;gt; [anything] || non-deterministic push-down automaton || syntax analysis for most programming languages &lt;br /&gt;
|-&lt;br /&gt;
| 3 || regular || ''A'' -&amp;gt; [nothing]&amp;lt;br&amp;gt;''A'' -&amp;gt; '''xyz'''&amp;lt;br&amp;gt;''A'' -&amp;gt; '''xyz''' ''B'' || finite automaton&amp;lt;br&amp;gt;or finite state machine || lexical analysis (combining characters into words/tokens)  &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''+''' The '''recogniser''' column indicates the type of mathematical or computer science theoretical model needed to recognise that a sentence belongs to a language, essentially by applying the transformation rules in reverse to work backwards from the actual words in order to finish up with a ''sentence'' (in programming languages the starting concept is usually a ''program''). A finite automaton uses only a small fixed amount of memory, operates in time proportional to the length of the input, and always reaches a decision, while a Turing machine may use an infinite amount of memory and time and may fail to reach a decision (may never stop).&lt;br /&gt;
&lt;br /&gt;
In the linguistic literature, [nothing] is often represented by the symbol '''ε'''.&lt;br /&gt;
&lt;br /&gt;
The descriptions of the various Chomsky levels which follow are presented in reverse order, so as to work up from a simple case to a rather complicated case.&lt;br /&gt;
&lt;br /&gt;
===Level 3: regular grammar===&lt;br /&gt;
The transformation rules for regular grammars are required to be very simple. &lt;br /&gt;
*Only a single non-terminal item can appear on the left-hand side of a rule.&lt;br /&gt;
*The right-hand side of any rule must be one of:&lt;br /&gt;
**[nothing].&lt;br /&gt;
**a terminal item.&lt;br /&gt;
**a terminal item followed by a non-terminal item.&lt;br /&gt;
Note that instead of a terminal item we could have a non-terminal item whose transformation rule immediately resolves to a single terminal item, or to one of several terminal items.&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
Informally we can define a 'word' as a sequence of one or more ''Letter''s. The following regular grammar provides a more formal definition; for simplicity it is restricted to lower-case letters.&lt;br /&gt;
&lt;br /&gt;
 ''Word''     -&amp;gt; ''Letter'' ''PartWord''&lt;br /&gt;
 ''PartWord'' -&amp;gt; [nothing]&lt;br /&gt;
 ''PartWord'' -&amp;gt; ''Letter'' ''PartWord''&lt;br /&gt;
 ''Letter''   -&amp;gt; '''a''', '''b''', ... '''z'''&lt;br /&gt;
&lt;br /&gt;
Note that ''PartWord'' is recursively defined, with the recursion stopping if it is transformed into [nothing].&lt;br /&gt;
&lt;br /&gt;
For one-letter words we expand as: &lt;br /&gt;
:''Word'' -&amp;gt; ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' [nothing] -&amp;gt; ''Letter''&lt;br /&gt;
&lt;br /&gt;
For two-letter words we expand as: &lt;br /&gt;
:''Word'' -&amp;gt; ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' ''Letter'' [nothing] -&amp;gt;  ''Letter'' ''Letter''&lt;br /&gt;
&lt;br /&gt;
Obviously, words of any length can be constructed, though they may well not actually be words from any language. &lt;br /&gt;
&lt;br /&gt;
====Discussion====&lt;br /&gt;
Trying to devise transformation rules to produce words which are more English-like is much more difficult - how do you insist on at least one vowel or on no more than 5 consecutive consonants (e.g. as in 'strengths').&lt;br /&gt;
&lt;br /&gt;
Further examples in [[Regular grammar]] show how numbers can be defined via a regular grammar, and also show how a hyphenated word could be defined.&lt;br /&gt;
&lt;br /&gt;
One of the limitations of a regular grammar is that it can't cope with nested matching brackets, so that it is impossible to write a regular grammar to describe an expression such as '''2 * (3+4)''' where that grammar is expected to allow brackets nested to any depth. A context-free grammar is needed for this, as described in the next section.&lt;br /&gt;
&lt;br /&gt;
Regular grammars or equivalent are widely used by [[compiler]]s in the lexical analysis of programming languages.&lt;br /&gt;
&lt;br /&gt;
===Level 2: context-free grammar===&lt;br /&gt;
The transformation rules for context-free grammars don't appear that much different from those for regular grammars. &lt;br /&gt;
*Only a single non-terminal item can appear on the left-hand side of a rule.&lt;br /&gt;
*The right-hand side of any rule must be one of:&lt;br /&gt;
**[nothing].&lt;br /&gt;
**any combination of terminal items and non-terminal items.&lt;br /&gt;
&lt;br /&gt;
The key difference is that in a regular grammar, any non-empty rule must effectively start with terminal item so that every rule transformation makes some immediate progress, while in a context-free grammar a rule could start with a non-terminal item which itself could be subject to arbitrary further transformations.&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
The following example shows how context-free grammars can cope with arithmetic expressions involving possibly nested brackets. Also an expression such as &amp;quot;2 + 3 * 4&amp;quot; could be interpreted as either &amp;quot;(2 + 3) * 4&amp;quot; = 20 or as &amp;quot;2 + (3 * 4)&amp;quot; = 14. The latter interpretation is that which is normally used - multiplication &amp;quot;*&amp;quot; is said to have a higher priority than addition &amp;quot;+&amp;quot; - so the grammar must incorporate this priority concept. Furthermore, consecutive operators of the same priority are normally applied from left to right, so that &amp;quot;8 - 2 + 3&amp;quot; is interpreted as &amp;quot;(8 - 2) + 3&amp;quot; = 9, rather than as &amp;quot;8 - (2 + 3)&amp;quot; = 3.  This ordering must also be built in to the grammar.&lt;br /&gt;
&lt;br /&gt;
To avoid distracting side-issues, this example only deals with numbers which consist solely of a single digit. The example is a simplified version of the definition of an arithmetic expression given in the Revised Algol 60 Report (Section 3.3.1).&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.masswerk.at/algol60/report.htm&lt;br /&gt;
| title = Revised Report on the Algorithmic Language Algol 60&lt;br /&gt;
| accessdate = 2012-04-22&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ''Expression'' -&amp;gt; ''Term''                        # an ''Expression'' is either a ''Term''&lt;br /&gt;
 ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''    #   or an ''Expression'' followed by '''+''' or '''-''' followed by a ''Term''&lt;br /&gt;
 ''Term''       -&amp;gt; ''Primary''                     # a ''Term'' is either a ''Primary''&lt;br /&gt;
 ''Term''       -&amp;gt; ''Term'' ''MulDivOp'' ''Primary''       #   or a ''Term'' followed by '''*''' or '''/''' followed by a ''Primary''&lt;br /&gt;
                                           #&lt;br /&gt;
 ''Primary''    -&amp;gt; ''Number''                      # a ''Primary'' is either a ''Number''&lt;br /&gt;
 ''Primary''    -&amp;gt; '''(''' ''Expression'' ''')'''              #   or an ''Expression'' enclosed in brackets&lt;br /&gt;
                                           #&lt;br /&gt;
 ''MulDivOp''   -&amp;gt; '''*'''. '''/'''                        # multiplication and division have the same priority&lt;br /&gt;
 ''AddSubOp''   -&amp;gt; '''+'''. '''-'''                        # addition and subtraction have the same priority&lt;br /&gt;
 ''Number''     -&amp;gt; '''0''', '''1''', ... '''9'''                 # this simple-minded definition of a ''Number'' is enough for this example&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
* Both ''Expression'' and ''Term'' are each defined via a left-recursive rule; this ensures that operators of the same priority are applied from left to right.&lt;br /&gt;
* The distinction between ''Expression'' and ''Term'' ensures that multiplication/division are applied before addition/subtraction.&lt;br /&gt;
* ''Expression'' is indirectly recursive via ''Term'' and ''Primary'' to allow bracketed sub-expressions to any depth.&lt;br /&gt;
&lt;br /&gt;
Example 1: generate 2 + 3 * 4&lt;br /&gt;
&lt;br /&gt;
  ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Term'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Primary'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' ''Term''                                 # '''+''' can not be applied until ''Term'' has been evaluated&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' ''Term'' ''MulDivOp'' ''Primary''&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' ''Primary'' ''MulDipOp'' ''Primary''&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' '''3''' '''*''' '''4'''&lt;br /&gt;
&lt;br /&gt;
Example 2: generate 2 * 3 + 4&lt;br /&gt;
&lt;br /&gt;
  ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Term'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Term'' ''MulDivOp'' ''Primary'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Primary'' ''MulDivOp'' ''Primary'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; '''2''' '''*''' '''3''' ''AddSubOp'' ''Term''                      # ''Term'' to left of ''AddSubOp'' is evaluated first&lt;br /&gt;
             -&amp;gt; '''2''' '''*''' '''3''' ''AddSubOp'' ''Primary''  &lt;br /&gt;
             -&amp;gt; '''2''' '''*''' '''3''' '''+''' '''4'''&lt;br /&gt;
&lt;br /&gt;
====Discussion====&lt;br /&gt;
Context-free grammars (or an equivalent definition using Backus-Naur-Form) are widely used both to define the syntax of programming languages and to (semi-automatically) generate parsers for these languages.&lt;br /&gt;
&lt;br /&gt;
===Level 1===&lt;br /&gt;
For both regular grammars and context-free grammars, the left-hand side of any rule is always a single non-terminal item, and any transformation is applied regardless of the context in which that non-terminal item appears.&lt;br /&gt;
&lt;br /&gt;
For context-sensitive grammars the left-hand side of a rule may indicate the context in which that rule applies, so that the same non-terminal item may be transformed in different ways depending on the context in which it appears. Several examples appear in these lecture notes.&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.divms.uiowa.edu/~fleck/taylor.pdf&lt;br /&gt;
| title = Context-sensitive Examples&lt;br /&gt;
| accessdate = 2012-04-26&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Level 0===&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[category:linguistics]]&lt;br /&gt;
[[Category:Computer Science]]&lt;/div&gt;</summary>
		<author><name>RolandPlankton</name></author>
	</entry>
	<entry>
		<id>https://www.conservapedia.com/index.php?title=Chomsky_hierarchy&amp;diff=978676</id>
		<title>Chomsky hierarchy</title>
		<link rel="alternate" type="text/html" href="https://www.conservapedia.com/index.php?title=Chomsky_hierarchy&amp;diff=978676"/>
		<updated>2012-04-29T14:42:50Z</updated>

		<summary type="html">&lt;p&gt;RolandPlankton: /* Level 2: context-free grammar */ add some discussion&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The '''Chomsky hierarchy''', sometimes known as the '''Chomsky-Schützenberger hierarchy''', is a hierarchy of formal grammatical systems for describing various classes of languages; the hierarchy can apply to both human and computer languages. This hierarchy was first published in 1956 by [[Noam Chomsky|Chomsky]].&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite journal &lt;br /&gt;
| title = Three models for the description of language &lt;br /&gt;
| year = 1956 &lt;br /&gt;
| last = Chomsky &lt;br /&gt;
| first = Noam &lt;br /&gt;
| journal = IRE Transactions on Information Theory &lt;br /&gt;
| volume = 2 &lt;br /&gt;
| pages = 113–124 &lt;br /&gt;
| url = http://www.chomsky.info/articles/195609--.pdf &lt;br /&gt;
| accessdate = 2012-04-08&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
These grammatical systems were referred to by Chomsky as ''transformational grammars''.  Other linguists have since developed a variety of similar grammars; together these are known as ''generative grammars''. &lt;br /&gt;
&lt;br /&gt;
The basic idea of a '''generative grammar''' is to provide a set of rules which are capable of generating all possible grammatical sentences in some language; the rules must constrain the generation so that only grammatical sentences are generated. The rules can also be used in reverse to parse a sentence and check if it is grammatical.&lt;br /&gt;
&lt;br /&gt;
In the late 1950's, [[John Backus]] and Peter Naur developed a notation for describing [[programming language]]s. This notation is known as [[Backus Naur Form]] (or BNF) and turns out to be equivalent to Chomsky's grammar number two (context-free grammar), although it was developed independently of Chomsky's work. Backus-Naur Form was first used in the Algol 60 Report to specify the syntax of [[Algol 60]], and has since been used for specifying the syntax of other programming languages. &lt;br /&gt;
&lt;br /&gt;
==Example of a very simple generative grammar==&lt;br /&gt;
This very simple example can handle only a tiny subset of English and should not be taken seriously as a guide to English grammar or vocabulary. It is based on an example by David Crystal&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite book &lt;br /&gt;
| last = Crystal &lt;br /&gt;
| first = David  &lt;br /&gt;
| title = The Cambridge Encyclopedia of Language &lt;br /&gt;
| publisher = Cambridge University Press &lt;br /&gt;
| year = 1987 &lt;br /&gt;
| isbn = 0-521-42443-7&lt;br /&gt;
| pages = page 97&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; and is a slight extension of an example on slide 9 of this lecture.&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.cs.princeton.edu/~rywang/99f126/slides/16th.pdf&lt;br /&gt;
| title = Lecture notes: Formal Languages&lt;br /&gt;
| accessdate = 2012-04-07}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase''         # A ''Sentence'' consists of a ''NounPhrase'' followed by a ''VerbPhrase''&lt;br /&gt;
 ''NounPhrase'' -&amp;gt;  ''Determiner'' ''Noun''               # A ''NounPhrase'' consists of a ''Determiner'' followed by a ''Noun''&lt;br /&gt;
 ''VerbPhrase'' -&amp;gt;  ''Verb'' ''NounPhrase''               # A ''VerbPhrase'' consists of a ''Verb'' followed by a ''NounPhrase''&lt;br /&gt;
 ''Determiner'' -&amp;gt;  '''a''', '''the'''                        # A ''Determiner''  is one of: '''a''' or '''the'''&lt;br /&gt;
 ''Noun''       -&amp;gt;  '''boy''', '''girl''', '''dog'''                # A ''Noun'' is one of: '''boy''' or '''girl''' or '''dog'''  &lt;br /&gt;
 ''Verb''       -&amp;gt;  '''chased''', '''heard''', '''saw'''            # A ''Verb'' is one of: '''chased''' or '''heard''' or '''saw'''&lt;br /&gt;
&lt;br /&gt;
Notation used above: &lt;br /&gt;
:The symbol &amp;quot;-&amp;gt;&amp;quot; means &amp;quot;can be replaced by&amp;quot;.  &lt;br /&gt;
:When there are several items on the right hand side separated by commas, just one of these items can be selected. &lt;br /&gt;
:The comments preceded by &amp;quot;#&amp;quot; are not part of the generative grammar, but hopefully will help folks understand the example a little better.&lt;br /&gt;
&lt;br /&gt;
By making appropriate substitutions we can generate such sentences as:&lt;br /&gt;
:The dog chased a girl.&lt;br /&gt;
:The girl heard the dog.&lt;br /&gt;
:The boy saw a girl.&lt;br /&gt;
&lt;br /&gt;
The stages in the generation of these examples are as follows:&lt;br /&gt;
:''Sentence''&lt;br /&gt;
:-&amp;gt; ''NounPhrase'' ''VerbPhrase''&lt;br /&gt;
:-&amp;gt; ''Determiner'' ''Noun'' ''Verb'' ''NounPhrase''&lt;br /&gt;
:-&amp;gt; ''Determiner'' ''Noun'' ''Verb'' ''Determiner'' ''Noun''&lt;br /&gt;
&lt;br /&gt;
By appropriate selection of words to substitute for ''Determiner'', ''Noun'', and ''Verb'' we can produce the 3 example sentences above.&lt;br /&gt;
&lt;br /&gt;
The simple grammar defines a few words which can be substituted for ''Determiner'', ''Noun'', and ''Verb''. There are two possibilities for ''Determiner'', three for ''Noun'', and three for ''Verb'', with both ''Determiner'' and ''Noun'' appearing twice in the expansion. Hence the total number of grammatical sentences which can be generated by this simple grammar is 108 (= 2 * 3 * 3 * 2 * 3). In this particular case the possible words have been carefully chosen so that all of these 108 sentences also actually mean something.&lt;br /&gt;
&lt;br /&gt;
Note that the use of ''italics'' and '''boldface''' in this example is merely a convenient way of indicating the difference between items which can be expanded further (e.g. concepts such as ''NounPhrase'') and items which can not be expanded further (e.g. words such as '''girl'''). In the linguistic literature, items which can be expanded further are referred to as 'non-terminal' items, while items which can't be expanded further are known as 'terminal' items.&lt;br /&gt;
&lt;br /&gt;
The 'comma' notation for alternatives is a form of shorthand. In some formulations this would be shown as several separate rules, so that:&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''a''', '''the''' &lt;br /&gt;
could be shown as two rules:&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''a'''&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''the''' &lt;br /&gt;
&lt;br /&gt;
==Caution==&lt;br /&gt;
While a generative grammar may produce sentences which are grammatically correct, there is no certainty that such sentences will actually mean anything. The classic example of such a meaningless sentence is from Chomsky's book&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite book &lt;br /&gt;
| last = Chomsky &lt;br /&gt;
| first = Noam &lt;br /&gt;
| title = Syntactic Structures &lt;br /&gt;
| year = 1957 &lt;br /&gt;
| publisher = Mouton &lt;br /&gt;
| location = The Hague/Paris &lt;br /&gt;
| pages = page 15 &lt;br /&gt;
| isbn = 3-11-017279-8&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; with the grammatically correct sentence:&lt;br /&gt;
&lt;br /&gt;
:&amp;quot;Colorless green ideas sleep furiously.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
:This example illustrates the difference between grammar/syntax and meaning/semantics.&lt;br /&gt;
&lt;br /&gt;
Another problem when analysing a sentence is that many English words have multiple meanings, so that there may be more than one way to interpret a sentence. A simple example is the sentence: &lt;br /&gt;
:&amp;quot;Time flies.&amp;quot; &lt;br /&gt;
:Is this an instruction to check how fast flies are flying, or an indication that time appears to be passing quickly? &lt;br /&gt;
:A varied and entertaining selection of such ambiguities has been compiled by Jeff Gray.&amp;lt;ref&amp;gt;{{Cite web &lt;br /&gt;
| title = Collection of Ambiguous or Inconsistent/Incomplete Statements  &lt;br /&gt;
| url = http://www.gray-area.org/Research/Ambig/ &lt;br /&gt;
| author = Jeff Gray&lt;br /&gt;
| accessdate = 2012-04-10&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Formal grammar==&lt;br /&gt;
'''Note''': this section and subsequent sections are, by necessity, slightly more technical/formal than the earlier parts of this article, though specialist notation has been largely avoided. Make sure that you understand the 'Simple example' above before proceeding further, since references will be made to that example to help explain the technicalities, and variations on that example will be used to illustrate new ideas. An attempt has been made to avoid formal linguistic abbreviations and unexplained jargon.&lt;br /&gt;
&lt;br /&gt;
A formal generative grammar has four components (see slide 19 of this lecture&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://adammikeal.org/courses/compute/Chomsky%20Presentation.pdf&lt;br /&gt;
| title = The Chomsky Hierarchy&lt;br /&gt;
| accessdate = 2012-04-06&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
):&lt;br /&gt;
# a finite number of non-terminal concepts (e.g. ''VerbPhrase'' in the example, or anything else in ''italics''),&lt;br /&gt;
# a finite number of terminal items (e.g. '''girl''' in the example, or anything else in '''bold-face''').&lt;br /&gt;
# a finite set of rules for transforming non-terminal items (e.g. the example has 6 rules).&lt;br /&gt;
# a single starting point (e.g. ''Sentence'' in the example).&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
:Any item which appears on the left-hand side of a transformation rule is non-terminal since it can be replaced by something else; apart from the starting point, all other non-terminals must also appear somewhere on the right-hand side of transformation rule.&lt;br /&gt;
:An item which appears only on the right-hand side of a transformation rule is a terminal item, since it can not be transformed further.&lt;br /&gt;
:A list of all the terminal items is effectively the vocabulary from which sentences are built.&lt;br /&gt;
:Linguists have developed various classes of grammars by using constraints to govern what sort of rules can be used for any particular grammar.&lt;br /&gt;
&lt;br /&gt;
===Changing the rules===&lt;br /&gt;
An relatively small change to even a single rule can make a large change in the language which can be generated. For example, change the first rule in the simple example to read:&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''NounPhrase'' ''VerbPhrase'' '''and''' ''NounPhrase'' ''VerbPhrase''&lt;br /&gt;
This means that a ''Sentence'' is either a ''NounPhrase'' followed by a ''VerbPhrase'' or a ''NounPhrase'' followed by a ''VerbPhrase'' followed by '''and''' followed by a ''NounPhrase'' followed by a ''VerbPhrase''. In addition to the shorter sentences already discussed, this could also generate a sentence such as: &amp;quot;A dog saw a girl and the dog chased the girl&amp;quot;. The total number of grammatically-correct sentences which can be generated by this modified grammar is now 11,772 (108 + 108*108), though some of these may not be very meaingful.&lt;br /&gt;
&lt;br /&gt;
===Towards infinity===&lt;br /&gt;
A significantly different rule change can have an astounding effect. Consider changing the first rule to read:&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''NounPhrase'' ''VerbPhrase'' '''and''' ''Sentence''&lt;br /&gt;
This can generate a potentially infinite number of sentences (any number of these five-word sentences linked by '''and'''). This is an example of what is known as a [[Recursion|recursive]] definition, whereby a ''Sentence'' is partially defined in terms of itself. In such a recursive rule there must be at least one transformation option which does not involve ''Sentence'', otherwise the transformation could never stop.&lt;br /&gt;
&lt;br /&gt;
The above change is known as right-recursive; a left-recursive formulation is also possible, and can in this example generate exactly the same sentences. As shown below  under 'Context-free grammar', there are situations where the choice of left- or right-recursive formulations can change the meaning. &lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''Sentence'' '''and''' ''NounPhrase'' ''VerbPhrase'' &lt;br /&gt;
&lt;br /&gt;
The distinction between left- and right-recursive grammars becomes important when trying to parse/analyse a sentence; some types of parser work best with left-recursive grammars, while other types work best with right-recursive grammars. This distinction is particularly relevant in connection with [[compiler|compiling or translating]] a program written in some high-level [[programming language]] so that it can be used on a [[computer]].&lt;br /&gt;
&lt;br /&gt;
==Chomsky hierarchy==&lt;br /&gt;
By imposing different constraints&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.cs.uaf.edu/2011/spring/cs331/lectures/cs331_20110124_grammar.html&lt;br /&gt;
| title = Lecture notes: Languages &amp;amp; Grammars&lt;br /&gt;
| accessdate = 2012-04-07&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; &lt;br /&gt;
as to what sort of transformation rules could be used, Chomsky was able to define four strictly nested transformational grammars, which he numbered from 0 to 3. As the grammar number increases, the generated language becomes simpler. As the grammar number decreases, parsing a sentence in that language becomes more difficult. The following table provides a summary, which is then explained further in the subsequent subsections.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!| Chomsky&amp;lt;br&amp;gt;number || linguistic name || Rule constraints || Recogniser+ || Notes &lt;br /&gt;
|-&lt;br /&gt;
| 0 || recursively enumerable || [anything] -&amp;gt; [anything] || Turing machine || most human languages &lt;br /&gt;
|-&lt;br /&gt;
| 1 || context-sensitive || X ''A'' Y -&amp;gt; X [anything] Y || linear bounded automaton || X and Y provide the context in which ''A'' can be transformed &lt;br /&gt;
|-&lt;br /&gt;
| 2 || context-free || ''A'' -&amp;gt; [anything] || non-deterministic push-down automaton || syntax analysis for most programming languages &lt;br /&gt;
|-&lt;br /&gt;
| 3 || regular || ''A'' -&amp;gt; [nothing]&amp;lt;br&amp;gt;''A'' -&amp;gt; '''xyz'''&amp;lt;br&amp;gt;''A'' -&amp;gt; '''xyz''' ''B'' || finite automaton&amp;lt;br&amp;gt;or finite state machine || lexical analysis (combining characters into words/tokens)  &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''+''' The '''recogniser''' column indicates the type of mathematical or computer science theoretical model needed to recognise that a sentence belongs to a language, essentially by applying the transformation rules in reverse to work backwards from the actual words in order to finish up with a ''sentence'' (in programming languages the starting concept is usually a ''program''). A finite automaton uses only a small fixed amount of memory, operates in time proportional to the length of the input, and always reaches a decision, while a Turing machine may use an infinite amount of memory and time and may fail to reach a decision (may never stop).&lt;br /&gt;
&lt;br /&gt;
In the linguistic literature, [nothing] is often represented by the symbol '''ε'''.&lt;br /&gt;
&lt;br /&gt;
The descriptions of the various Chomsky levels which follows are presented in reverse order, so as to work up from a simple case to a rather complicated case.&lt;br /&gt;
&lt;br /&gt;
===Level 3: regular grammar===&lt;br /&gt;
The transformation rules for regular grammars are required to be very simple. &lt;br /&gt;
*Only a single non-terminal item can appear on the left-hand side of a rule.&lt;br /&gt;
*The right-hand side of any rule must be one of:&lt;br /&gt;
**[nothing].&lt;br /&gt;
**a terminal item.&lt;br /&gt;
**a terminal item followed by a non-terminal item.&lt;br /&gt;
Note that instead of a terminal item we could have a non-terminal item whose transformation rule immediately resolves to a single terminal item, or to one of several terminal items.&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
Informally we can define a 'word' as a sequence of one or more ''Letter''s. The following regular grammar provides a more formal definition; for simplicity it is restricted to lower-case letters.&lt;br /&gt;
&lt;br /&gt;
 ''Word''     -&amp;gt; ''Letter'' ''PartWord''&lt;br /&gt;
 ''PartWord'' -&amp;gt; [nothing]&lt;br /&gt;
 ''PartWord'' -&amp;gt; ''Letter'' ''PartWord''&lt;br /&gt;
 ''Letter''   -&amp;gt; '''a''', '''b''', ... '''z'''&lt;br /&gt;
&lt;br /&gt;
Note that ''PartWord'' is recursively defined, with the recursion stopping if it is transformed into [nothing].&lt;br /&gt;
&lt;br /&gt;
For one-letter words we expand as: &lt;br /&gt;
:''Word'' -&amp;gt; ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' [nothing] -&amp;gt; ''Letter''&lt;br /&gt;
&lt;br /&gt;
For two-letter words we expand as: &lt;br /&gt;
:''Word'' -&amp;gt; ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' ''Letter'' [nothing] -&amp;gt;  ''Letter'' ''Letter''&lt;br /&gt;
&lt;br /&gt;
Obviously, words of any length can be constructed, though they may well not actually be words from any language. &lt;br /&gt;
&lt;br /&gt;
====Discussion====&lt;br /&gt;
Trying to devise transformation rules to produce words which are more English-like is much more difficult - how do you insist on at least one vowel or on no more than 5 consecutive consonants (e.g. as in 'strengths').&lt;br /&gt;
&lt;br /&gt;
Further examples in [[Regular grammar]] show how numbers can be defined via a regular grammar, and also show how a hyphenated word could be defined.&lt;br /&gt;
&lt;br /&gt;
One of the limitations of a regular grammar is that it can't cope with nested matching brackets, so that it is impossible to write a regular grammar to describe an expression such as '''2 * (3+4)''' where that grammar is expected to allow brackets nested to any depth. A context-free grammar is needed for this, as described in the next section.&lt;br /&gt;
&lt;br /&gt;
Regular grammars or equivalent are widely used by [[compiler]]s in the lexical analysis of programming languages.&lt;br /&gt;
&lt;br /&gt;
===Level 2: context-free grammar===&lt;br /&gt;
The transformation rules for context-free grammars don't appear that much different from those for regular grammars. &lt;br /&gt;
*Only a single non-terminal item can appear on the left-hand side of a rule.&lt;br /&gt;
*The right-hand side of any rule must be one of:&lt;br /&gt;
**[nothing].&lt;br /&gt;
**any combination of terminal items and non-terminal items.&lt;br /&gt;
&lt;br /&gt;
The key difference is that in a regular grammar, any non-empty rule must effectively start with terminal item so that every rule transformation makes some immediate progress, while in a context-free grammar a rule could start with a non-terminal item which itself could be subject to arbitrary further transformations.&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
The following example shows how context-free grammars can cope with arithmetic expressions involving possibly nested brackets. Also an expression such as &amp;quot;2 + 3 * 4&amp;quot; could be interpreted as either &amp;quot;(2 + 3) * 4&amp;quot; = 20 or as &amp;quot;2 + (3 * 4)&amp;quot; = 14. The latter interpretation is that which is normally used - multiplication &amp;quot;*&amp;quot; is said to have a higher priority than addition &amp;quot;+&amp;quot; - so the grammar must incorporate this priority concept. Furthermore, consecutive operators of the same priority are normally applied from left to right, so that &amp;quot;8 - 2 + 3&amp;quot; is interpreted as &amp;quot;(8 - 2) + 3&amp;quot; = 9, rather than as &amp;quot;8 - (2 + 3)&amp;quot; = 3.  This ordering must also be built in to the grammar.&lt;br /&gt;
&lt;br /&gt;
To avoid distracting side-issues, this example only deals with numbers which consist solely of a single digit. The example is a simplified version of the definition of an arithmetic expression given in the Revised Algol 60 Report (Section 3.3.1).&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.masswerk.at/algol60/report.htm&lt;br /&gt;
| title = Revised Report on the Algorithmic Language Algol 60&lt;br /&gt;
| accessdate = 2012-04-22&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ''Expression'' -&amp;gt; ''Term''                        # an ''Expression'' is either a ''Term''&lt;br /&gt;
 ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''    #   or an ''Expression'' followed by '''+''' or '''-''' followed by a ''Term''&lt;br /&gt;
 ''Term''       -&amp;gt; ''Primary''                     # a ''Term'' is either a ''Primary''&lt;br /&gt;
 ''Term''       -&amp;gt; ''Term'' ''MulDivOp'' ''Primary''       #   or a ''Term'' followed by '''*''' or '''/''' followed by a ''Primary''&lt;br /&gt;
                                           #&lt;br /&gt;
 ''Primary''    -&amp;gt; ''Number''                      # a ''Primary'' is either a ''Number''&lt;br /&gt;
 ''Primary''    -&amp;gt; '''(''' ''Expression'' ''')'''              #   or an ''Expression'' enclosed in brackets&lt;br /&gt;
                                           #&lt;br /&gt;
 ''MulDivOp''   -&amp;gt; '''*'''. '''/'''                        # multiplication and division have the same priority&lt;br /&gt;
 ''AddSubOp''   -&amp;gt; '''+'''. '''-'''                        # addition and subtraction have the same priority&lt;br /&gt;
 ''Number''     -&amp;gt; '''0''', '''1''', ... '''9'''                 # this simple-minded definition of a ''Number'' is enough for this example&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
* Both ''Expression'' and ''Term'' are each defined via a left-recursive rule; this ensures that operators of the same priority are applied from left to right.&lt;br /&gt;
* The distinction between ''Expression'' and ''Term'' ensures that multiplication/division are applied before addition/subtraction.&lt;br /&gt;
* ''Expression'' is indirectly recursive via ''Term'' and ''Primary'' to allow bracketed sub-expressions to any depth.&lt;br /&gt;
&lt;br /&gt;
Example 1: generate 2 + 3 * 4&lt;br /&gt;
&lt;br /&gt;
  ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Term'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Primary'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' ''Term''                                 # '''+''' can not be applied until ''Term'' has been evaluated&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' ''Term'' ''MulDivOp'' ''Primary''&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' ''Primary'' ''MulDipOp'' ''Primary''&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' '''3''' '''*''' '''4'''&lt;br /&gt;
&lt;br /&gt;
Example 2: generate 2 * 3 + 4&lt;br /&gt;
&lt;br /&gt;
  ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Term'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Term'' ''MulDivOp'' ''Primary'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Primary'' ''MulDivOp'' ''Primary'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; '''2''' '''*''' '''3''' ''AddSubOp'' ''Term''                      # ''Term'' to left of ''AddSubOp'' is evaluated first&lt;br /&gt;
             -&amp;gt; '''2''' '''*''' '''3''' ''AddSubOp'' ''Primary''  &lt;br /&gt;
             -&amp;gt; '''2''' '''*''' '''3''' '''+''' '''4'''&lt;br /&gt;
&lt;br /&gt;
====Discussion====&lt;br /&gt;
Context-free grammars (or an equivalent definition using Backus-Naur-Form) are widely used both to define the syntax of programming languages and to (semi-automatically) generate parsers for these languages.&lt;br /&gt;
&lt;br /&gt;
===Level 1===&lt;br /&gt;
For both regular grammars and context-free grammars, the left-hand side of any rule is always a single non-terminal item, and any transformation is applied regardless of the context in which that non-terminal item appears.&lt;br /&gt;
&lt;br /&gt;
For context-sensitive grammars the left-hand side of a rule may indicate the context in which that rule applies, so that the same non-terminal item may be transformed in different ways depending on the context in which it appears. Several examples appear in these lecture notes.&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.divms.uiowa.edu/~fleck/taylor.pdf&lt;br /&gt;
| title = Context-sensitive Examples&lt;br /&gt;
| accessdate = 2012-04-26&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Level 0===&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[category:linguistics]]&lt;br /&gt;
[[Category:Computer Science]]&lt;/div&gt;</summary>
		<author><name>RolandPlankton</name></author>
	</entry>
	<entry>
		<id>https://www.conservapedia.com/index.php?title=Chomsky_hierarchy&amp;diff=978288</id>
		<title>Chomsky hierarchy</title>
		<link rel="alternate" type="text/html" href="https://www.conservapedia.com/index.php?title=Chomsky_hierarchy&amp;diff=978288"/>
		<updated>2012-04-27T15:48:06Z</updated>

		<summary type="html">&lt;p&gt;RolandPlankton: /* Example */ minor rephrasing&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The '''Chomsky hierarchy''', sometimes known as the '''Chomsky-Schützenberger hierarchy''', is a hierarchy of formal grammatical systems for describing various classes of languages; the hierarchy can apply to both human and computer languages. This hierarchy was first published in 1956 by [[Noam Chomsky|Chomsky]].&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite journal &lt;br /&gt;
| title = Three models for the description of language &lt;br /&gt;
| year = 1956 &lt;br /&gt;
| last = Chomsky &lt;br /&gt;
| first = Noam &lt;br /&gt;
| journal = IRE Transactions on Information Theory &lt;br /&gt;
| volume = 2 &lt;br /&gt;
| pages = 113–124 &lt;br /&gt;
| url = http://www.chomsky.info/articles/195609--.pdf &lt;br /&gt;
| accessdate = 2012-04-08&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
These grammatical systems were referred to by Chomsky as ''transformational grammars''.  Other linguists have since developed a variety of similar grammars; together these are known as ''generative grammars''. &lt;br /&gt;
&lt;br /&gt;
The basic idea of a '''generative grammar''' is to provide a set of rules which are capable of generating all possible grammatical sentences in some language; the rules must constrain the generation so that only grammatical sentences are generated. The rules can also be used in reverse to parse a sentence and check if it is grammatical.&lt;br /&gt;
&lt;br /&gt;
In the late 1950's, [[John Backus]] and Peter Naur developed a notation for describing [[programming language]]s. This notation is known as [[Backus Naur Form]] (or BNF) and turns out to be equivalent to Chomsky's grammar number two (context-free grammar), although it was developed independently of Chomsky's work. Backus-Naur Form was first used in the Algol 60 Report to specify the syntax of [[Algol 60]], and has since been used for specifying the syntax of other programming languages. &lt;br /&gt;
&lt;br /&gt;
==Example of a very simple generative grammar==&lt;br /&gt;
This very simple example can handle only a tiny subset of English and should not be taken seriously as a guide to English grammar or vocabulary. It is based on an example by David Crystal&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite book &lt;br /&gt;
| last = Crystal &lt;br /&gt;
| first = David  &lt;br /&gt;
| title = The Cambridge Encyclopedia of Language &lt;br /&gt;
| publisher = Cambridge University Press &lt;br /&gt;
| year = 1987 &lt;br /&gt;
| isbn = 0-521-42443-7&lt;br /&gt;
| pages = page 97&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; and is a slight extension of an example on slide 9 of this lecture.&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.cs.princeton.edu/~rywang/99f126/slides/16th.pdf&lt;br /&gt;
| title = Lecture notes: Formal Languages&lt;br /&gt;
| accessdate = 2012-04-07}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase''         # A ''Sentence'' consists of a ''NounPhrase'' followed by a ''VerbPhrase''&lt;br /&gt;
 ''NounPhrase'' -&amp;gt;  ''Determiner'' ''Noun''               # A ''NounPhrase'' consists of a ''Determiner'' followed by a ''Noun''&lt;br /&gt;
 ''VerbPhrase'' -&amp;gt;  ''Verb'' ''NounPhrase''               # A ''VerbPhrase'' consists of a ''Verb'' followed by a ''NounPhrase''&lt;br /&gt;
 ''Determiner'' -&amp;gt;  '''a''', '''the'''                        # A ''Determiner''  is one of: '''a''' or '''the'''&lt;br /&gt;
 ''Noun''       -&amp;gt;  '''boy''', '''girl''', '''dog'''                # A ''Noun'' is one of: '''boy''' or '''girl''' or '''dog'''  &lt;br /&gt;
 ''Verb''       -&amp;gt;  '''chased''', '''heard''', '''saw'''            # A ''Verb'' is one of: '''chased''' or '''heard''' or '''saw'''&lt;br /&gt;
&lt;br /&gt;
Notation used above: &lt;br /&gt;
:The symbol &amp;quot;-&amp;gt;&amp;quot; means &amp;quot;can be replaced by&amp;quot;.  &lt;br /&gt;
:When there are several items on the right hand side separated by commas, just one of these items can be selected. &lt;br /&gt;
:The comments preceded by &amp;quot;#&amp;quot; are not part of the generative grammar, but hopefully will help folks understand the example a little better.&lt;br /&gt;
&lt;br /&gt;
By making appropriate substitutions we can generate such sentences as:&lt;br /&gt;
:The dog chased a girl.&lt;br /&gt;
:The girl heard the dog.&lt;br /&gt;
:The boy saw a girl.&lt;br /&gt;
&lt;br /&gt;
The stages in the generation of these examples are as follows:&lt;br /&gt;
:''Sentence''&lt;br /&gt;
:-&amp;gt; ''NounPhrase'' ''VerbPhrase''&lt;br /&gt;
:-&amp;gt; ''Determiner'' ''Noun'' ''Verb'' ''NounPhrase''&lt;br /&gt;
:-&amp;gt; ''Determiner'' ''Noun'' ''Verb'' ''Determiner'' ''Noun''&lt;br /&gt;
&lt;br /&gt;
By appropriate selection of words to substitute for ''Determiner'', ''Noun'', and ''Verb'' we can produce the 3 example sentences above.&lt;br /&gt;
&lt;br /&gt;
The simple grammar defines a few words which can be substituted for ''Determiner'', ''Noun'', and ''Verb''. There are two possibilities for ''Determiner'', three for ''Noun'', and three for ''Verb'', with both ''Determiner'' and ''Noun'' appearing twice in the expansion. Hence the total number of grammatical sentences which can be generated by this simple grammar is 108 (= 2 * 3 * 3 * 2 * 3). In this particular case the possible words have been carefully chosen so that all of these 108 sentences also actually mean something.&lt;br /&gt;
&lt;br /&gt;
Note that the use of ''italics'' and '''boldface''' in this example is merely a convenient way of indicating the difference between items which can be expanded further (e.g. concepts such as ''NounPhrase'') and items which can not be expanded further (e.g. words such as '''girl'''). In the linguistic literature, items which can be expanded further are referred to as 'non-terminal' items, while items which can't be expanded further are known as 'terminal' items.&lt;br /&gt;
&lt;br /&gt;
The 'comma' notation for alternatives is a form of shorthand. In some formulations this would be shown as several separate rules, so that:&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''a''', '''the''' &lt;br /&gt;
could be shown as two rules:&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''a'''&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''the''' &lt;br /&gt;
&lt;br /&gt;
==Caution==&lt;br /&gt;
While a generative grammar may produce sentences which are grammatically correct, there is no certainty that such sentences will actually mean anything. The classic example of such a meaningless sentence is from Chomsky's book&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite book &lt;br /&gt;
| last = Chomsky &lt;br /&gt;
| first = Noam &lt;br /&gt;
| title = Syntactic Structures &lt;br /&gt;
| year = 1957 &lt;br /&gt;
| publisher = Mouton &lt;br /&gt;
| location = The Hague/Paris &lt;br /&gt;
| pages = page 15 &lt;br /&gt;
| isbn = 3-11-017279-8&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; with the grammatically correct sentence:&lt;br /&gt;
&lt;br /&gt;
:&amp;quot;Colorless green ideas sleep furiously.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
:This example illustrates the difference between grammar/syntax and meaning/semantics.&lt;br /&gt;
&lt;br /&gt;
Another problem when analysing a sentence is that many English words have multiple meanings, so that there may be more than one way to interpret a sentence. A simple example is the sentence: &lt;br /&gt;
:&amp;quot;Time flies.&amp;quot; &lt;br /&gt;
:Is this an instruction to check how fast flies are flying, or an indication that time appears to be passing quickly? &lt;br /&gt;
:A varied and entertaining selection of such ambiguities has been compiled by Jeff Gray.&amp;lt;ref&amp;gt;{{Cite web &lt;br /&gt;
| title = Collection of Ambiguous or Inconsistent/Incomplete Statements  &lt;br /&gt;
| url = http://www.gray-area.org/Research/Ambig/ &lt;br /&gt;
| author = Jeff Gray&lt;br /&gt;
| accessdate = 2012-04-10&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Formal grammar==&lt;br /&gt;
'''Note''': this section and subsequent sections are, by necessity, slightly more technical/formal than the earlier parts of this article, though specialist notation has been largely avoided. Make sure that you understand the 'Simple example' above before proceeding further, since references will be made to that example to help explain the technicalities, and variations on that example will be used to illustrate new ideas. An attempt has been made to avoid formal linguistic abbreviations and unexplained jargon.&lt;br /&gt;
&lt;br /&gt;
A formal generative grammar has four components (see slide 19 of this lecture&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://adammikeal.org/courses/compute/Chomsky%20Presentation.pdf&lt;br /&gt;
| title = The Chomsky Hierarchy&lt;br /&gt;
| accessdate = 2012-04-06&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
):&lt;br /&gt;
# a finite number of non-terminal concepts (e.g. ''VerbPhrase'' in the example, or anything else in ''italics''),&lt;br /&gt;
# a finite number of terminal items (e.g. '''girl''' in the example, or anything else in '''bold-face''').&lt;br /&gt;
# a finite set of rules for transforming non-terminal items (e.g. the example has 6 rules).&lt;br /&gt;
# a single starting point (e.g. ''Sentence'' in the example).&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
:Any item which appears on the left-hand side of a transformation rule is non-terminal since it can be replaced by something else; apart from the starting point, all other non-terminals must also appear somewhere on the right-hand side of transformation rule.&lt;br /&gt;
:An item which appears only on the right-hand side of a transformation rule is a terminal item, since it can not be transformed further.&lt;br /&gt;
:A list of all the terminal items is effectively the vocabulary from which sentences are built.&lt;br /&gt;
:Linguists have developed various classes of grammars by using constraints to govern what sort of rules can be used for any particular grammar.&lt;br /&gt;
&lt;br /&gt;
===Changing the rules===&lt;br /&gt;
An relatively small change to even a single rule can make a large change in the language which can be generated. For example, change the first rule in the simple example to read:&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''NounPhrase'' ''VerbPhrase'' '''and''' ''NounPhrase'' ''VerbPhrase''&lt;br /&gt;
This means that a ''Sentence'' is either a ''NounPhrase'' followed by a ''VerbPhrase'' or a ''NounPhrase'' followed by a ''VerbPhrase'' followed by '''and''' followed by a ''NounPhrase'' followed by a ''VerbPhrase''. In addition to the shorter sentences already discussed, this could also generate a sentence such as: &amp;quot;A dog saw a girl and the dog chased the girl&amp;quot;. The total number of grammatically-correct sentences which can be generated by this modified grammar is now 11,772 (108 + 108*108), though some of these may not be very meaingful.&lt;br /&gt;
&lt;br /&gt;
===Towards infinity===&lt;br /&gt;
A significantly different rule change can have an astounding effect. Consider changing the first rule to read:&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''NounPhrase'' ''VerbPhrase'' '''and''' ''Sentence''&lt;br /&gt;
This can generate a potentially infinite number of sentences (any number of these five-word sentences linked by '''and'''). This is an example of what is known as a [[Recursion|recursive]] definition, whereby a ''Sentence'' is partially defined in terms of itself. In such a recursive rule there must be at least one transformation option which does not involve ''Sentence'', otherwise the transformation could never stop.&lt;br /&gt;
&lt;br /&gt;
The above change is known as right-recursive; a left-recursive formulation is also possible, and can in this example generate exactly the same sentences. As shown below  under 'Context-free grammar', there are situations where the choice of left- or right-recursive formulations can change the meaning. &lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''Sentence'' '''and''' ''NounPhrase'' ''VerbPhrase'' &lt;br /&gt;
&lt;br /&gt;
The distinction between left- and right-recursive grammars becomes important when trying to parse/analyse a sentence; some types of parser work best with left-recursive grammars, while other types work best with right-recursive grammars. This distinction is particularly relevant in connection with [[compiler|compiling or translating]] a program written in some high-level [[programming language]] so that it can be used on a [[computer]].&lt;br /&gt;
&lt;br /&gt;
==Chomsky hierarchy==&lt;br /&gt;
By imposing different constraints&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.cs.uaf.edu/2011/spring/cs331/lectures/cs331_20110124_grammar.html&lt;br /&gt;
| title = Lecture notes: Languages &amp;amp; Grammars&lt;br /&gt;
| accessdate = 2012-04-07&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; &lt;br /&gt;
as to what sort of transformation rules could be used, Chomsky was able to define four strictly nested transformational grammars, which he numbered from 0 to 3. As the grammar number increases, the generated language becomes simpler. As the grammar number decreases, parsing a sentence in that language becomes more difficult. The following table provides a summary, which is then explained further in the subsequent subsections.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!| Chomsky&amp;lt;br&amp;gt;number || linguistic name || Rule constraints || Recogniser+ || Notes &lt;br /&gt;
|-&lt;br /&gt;
| 0 || recursively enumerable || [anything] -&amp;gt; [anything] || Turing machine || most human languages &lt;br /&gt;
|-&lt;br /&gt;
| 1 || context-sensitive || X ''A'' Y -&amp;gt; X [anything] Y || linear bounded automaton || X and Y provide the context in which ''A'' can be transformed &lt;br /&gt;
|-&lt;br /&gt;
| 2 || context-free || ''A'' -&amp;gt; [anything] || non-deterministic push-down automaton || syntax analysis for most programming languages &lt;br /&gt;
|-&lt;br /&gt;
| 3 || regular || ''A'' -&amp;gt; [nothing]&amp;lt;br&amp;gt;''A'' -&amp;gt; '''xyz'''&amp;lt;br&amp;gt;''A'' -&amp;gt; '''xyz''' ''B'' || finite automaton&amp;lt;br&amp;gt;or finite state machine || lexical analysis (combining characters into words/tokens)  &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''+''' The '''recogniser''' column indicates the type of mathematical or computer science theoretical model needed to recognise that a sentence belongs to a language, essentially by applying the transformation rules in reverse to work backwards from the actual words in order to finish up with a ''sentence'' (in programming languages the starting concept is usually a ''program''). A finite automaton uses only a small fixed amount of memory, operates in time proportional to the length of the input, and always reaches a decision, while a Turing machine may use an infinite amount of memory and time and may fail to reach a decision (may never stop).&lt;br /&gt;
&lt;br /&gt;
In the linguistic literature, [nothing] is often represented by the symbol '''ε'''.&lt;br /&gt;
&lt;br /&gt;
The descriptions of the various Chomsky levels which follows are presented in reverse order, so as to work up from a simple case to a rather complicated case.&lt;br /&gt;
&lt;br /&gt;
===Level 3: regular grammar===&lt;br /&gt;
The transformation rules for regular grammars are required to be very simple. &lt;br /&gt;
*Only a single non-terminal item can appear on the left-hand side of a rule.&lt;br /&gt;
*The right-hand side of any rule must be one of:&lt;br /&gt;
**[nothing].&lt;br /&gt;
**a terminal item.&lt;br /&gt;
**a terminal item followed by a non-terminal item.&lt;br /&gt;
Note that instead of a terminal item we could have a non-terminal item whose transformation rule immediately resolves to a single terminal item, or to one of several terminal items.&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
Informally we can define a 'word' as a sequence of one or more ''Letter''s. The following regular grammar provides a more formal definition; for simplicity it is restricted to lower-case letters.&lt;br /&gt;
&lt;br /&gt;
 ''Word''     -&amp;gt; ''Letter'' ''PartWord''&lt;br /&gt;
 ''PartWord'' -&amp;gt; [nothing]&lt;br /&gt;
 ''PartWord'' -&amp;gt; ''Letter'' ''PartWord''&lt;br /&gt;
 ''Letter''   -&amp;gt; '''a''', '''b''', ... '''z'''&lt;br /&gt;
&lt;br /&gt;
Note that ''PartWord'' is recursively defined, with the recursion stopping if it is transformed into [nothing].&lt;br /&gt;
&lt;br /&gt;
For one-letter words we expand as: &lt;br /&gt;
:''Word'' -&amp;gt; ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' [nothing] -&amp;gt; ''Letter''&lt;br /&gt;
&lt;br /&gt;
For two-letter words we expand as: &lt;br /&gt;
:''Word'' -&amp;gt; ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' ''Letter'' [nothing] -&amp;gt;  ''Letter'' ''Letter''&lt;br /&gt;
&lt;br /&gt;
Obviously, words of any length can be constructed, though they may well not actually be words from any language. &lt;br /&gt;
&lt;br /&gt;
====Discussion====&lt;br /&gt;
Trying to devise transformation rules to produce words which are more English-like is much more difficult - how do you insist on at least one vowel or on no more than 5 consecutive consonants (e.g. as in 'strengths').&lt;br /&gt;
&lt;br /&gt;
Further examples in [[Regular grammar]] show how numbers can be defined via a regular grammar, and also show how a hyphenated word could be defined.&lt;br /&gt;
&lt;br /&gt;
One of the limitations of a regular grammar is that it can't cope with nested matching brackets, so that it is impossible to write a regular grammar to describe an expression such as '''2 * (3+4)''' where that grammar is expected to allow brackets nested to any depth. A context-free grammar is needed for this, as described in the next section.&lt;br /&gt;
&lt;br /&gt;
Regular grammars or equivalent are widely used by [[compiler]]s in the lexical analysis of programming languages.&lt;br /&gt;
&lt;br /&gt;
===Level 2: context-free grammar===&lt;br /&gt;
The transformation rules for context-free grammars don't appear that much different from those for regular grammars. &lt;br /&gt;
*Only a single non-terminal item can appear on the left-hand side of a rule.&lt;br /&gt;
*The right-hand side of any rule must be one of:&lt;br /&gt;
**[nothing].&lt;br /&gt;
**any combination of terminal items and non-terminal items.&lt;br /&gt;
&lt;br /&gt;
The key difference is that in a regular grammar, any non-empty rule must effectively start with terminal item so that every rule transformation makes some immediate progress, while in a context-free grammar a rule could start with a non-terminal item which itself could be subject to arbitrary further transformations.&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
The following example shows how context-free grammars can cope with arithmetic expressions involving possibly nested brackets. Also an expression such as &amp;quot;2 + 3 * 4&amp;quot; could be interpreted as either &amp;quot;(2 + 3) * 4&amp;quot; = 20 or as &amp;quot;2 + (3 * 4)&amp;quot; = 14. The latter interpretation is that which is normally used - multiplication &amp;quot;*&amp;quot; is said to have a higher priority than addition &amp;quot;+&amp;quot; - so the grammar must incorporate this priority concept. Furthermore, consecutive operators of the same priority are normally applied from left to right, so that &amp;quot;8 - 2 + 3&amp;quot; is interpreted as &amp;quot;(8 - 2) + 3&amp;quot; = 9, rather than as &amp;quot;8 - (2 + 3)&amp;quot; = 3.  This ordering must also be built in to the grammar.&lt;br /&gt;
&lt;br /&gt;
To avoid distracting side-issues, this example only deals with numbers which consist solely of a single digit. The example is a simplified version of the definition of an arithmetic expression given in the Revised Algol 60 Report (Section 3.3.1).&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.masswerk.at/algol60/report.htm&lt;br /&gt;
| title = Revised Report on the Algorithmic Language Algol 60&lt;br /&gt;
| accessdate = 2012-04-22&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ''Expression'' -&amp;gt; ''Term''                        # an ''Expression'' is either a ''Term''&lt;br /&gt;
 ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''    #   or an ''Expression'' followed by '''+''' or '''-''' followed by a ''Term''&lt;br /&gt;
 ''Term''       -&amp;gt; ''Primary''                     # a ''Term'' is either a ''Primary''&lt;br /&gt;
 ''Term''       -&amp;gt; ''Term'' ''MulDivOp'' ''Primary''       #   or a ''Term'' followed by '''*''' or '''/''' followed by a ''Primary''&lt;br /&gt;
                                           #&lt;br /&gt;
 ''Primary''    -&amp;gt; ''Number''                      # a ''Primary'' is either a ''Number''&lt;br /&gt;
 ''Primary''    -&amp;gt; '''(''' ''Expression'' ''')'''              #   or an ''Expression'' enclosed in brackets&lt;br /&gt;
                                           #&lt;br /&gt;
 ''MulDivOp''   -&amp;gt; '''*'''. '''/'''                        # multiplication and division have the same priority&lt;br /&gt;
 ''AddSubOp''   -&amp;gt; '''+'''. '''-'''                        # addition and subtraction have the same priority&lt;br /&gt;
 ''Number''     -&amp;gt; '''0''', '''1''', ... '''9'''                 # this simple-minded definition of a ''Number'' is enough for this example&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
* Both ''Expression'' and ''Term'' are each defined via a left-recursive rule; this ensures that operators of the same priority are applied from left to right.&lt;br /&gt;
* The distinction between ''Expression'' and ''Term'' ensures that multiplication/division are applied before addition/subtraction.&lt;br /&gt;
* ''Expression'' is indirectly recursive via ''Term'' and ''Primary'' to allow bracketed sub-expressions to any depth.&lt;br /&gt;
&lt;br /&gt;
Example 1: generate 2 + 3 * 4&lt;br /&gt;
&lt;br /&gt;
  ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Term'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Primary'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' ''Term''                                 # '''+''' can not be applied until ''Term'' has been evaluated&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' ''Term'' ''MulDivOp'' ''Primary''&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' ''Primary'' ''MulDipOp'' ''Primary''&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' '''3''' '''*''' '''4'''&lt;br /&gt;
&lt;br /&gt;
Example 2: generate 2 * 3 + 4&lt;br /&gt;
&lt;br /&gt;
  ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Term'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Term'' ''MulDivOp'' ''Primary'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Primary'' ''MulDivOp'' ''Primary'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; '''2''' '''*''' '''3''' ''AddSubOp'' ''Term''                      # ''Term'' to left of ''AddSubOp'' is evaluated first&lt;br /&gt;
             -&amp;gt; '''2''' '''*''' '''3''' ''AddSubOp'' ''Primary''  &lt;br /&gt;
             -&amp;gt; '''2''' '''*''' '''3''' '''+''' '''4'''&lt;br /&gt;
&lt;br /&gt;
===Level 1===&lt;br /&gt;
For both regular grammars and context-free grammars, the left-hand side of any rule is always a single non-terminal item, and any transformation is applied regardless of the context in which that non-terminal item appears.&lt;br /&gt;
&lt;br /&gt;
For context-sensitive grammars the left-hand side of a rule may indicate the context in which that rule applies, so that the same non-terminal item may be transformed in different ways depending on the context in which it appears. Several examples appear in these lecture notes.&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.divms.uiowa.edu/~fleck/taylor.pdf&lt;br /&gt;
| title = Context-sensitive Examples&lt;br /&gt;
| accessdate = 2012-04-26&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Level 0===&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[category:linguistics]]&lt;br /&gt;
[[Category:Computer Science]]&lt;/div&gt;</summary>
		<author><name>RolandPlankton</name></author>
	</entry>
	<entry>
		<id>https://www.conservapedia.com/index.php?title=Chomsky_hierarchy&amp;diff=978112</id>
		<title>Chomsky hierarchy</title>
		<link rel="alternate" type="text/html" href="https://www.conservapedia.com/index.php?title=Chomsky_hierarchy&amp;diff=978112"/>
		<updated>2012-04-26T21:12:57Z</updated>

		<summary type="html">&lt;p&gt;RolandPlankton: add reference; further expansion and examples still to come&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The '''Chomsky hierarchy''', sometimes known as the '''Chomsky-Schützenberger hierarchy''', is a hierarchy of formal grammatical systems for describing various classes of languages; the hierarchy can apply to both human and computer languages. This hierarchy was first published in 1956 by [[Noam Chomsky|Chomsky]].&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite journal &lt;br /&gt;
| title = Three models for the description of language &lt;br /&gt;
| year = 1956 &lt;br /&gt;
| last = Chomsky &lt;br /&gt;
| first = Noam &lt;br /&gt;
| journal = IRE Transactions on Information Theory &lt;br /&gt;
| volume = 2 &lt;br /&gt;
| pages = 113–124 &lt;br /&gt;
| url = http://www.chomsky.info/articles/195609--.pdf &lt;br /&gt;
| accessdate = 2012-04-08&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
These grammatical systems were referred to by Chomsky as ''transformational grammars''.  Other linguists have since developed a variety of similar grammars; together these are known as ''generative grammars''. &lt;br /&gt;
&lt;br /&gt;
The basic idea of a '''generative grammar''' is to provide a set of rules which are capable of generating all possible grammatical sentences in some language; the rules must constrain the generation so that only grammatical sentences are generated. The rules can also be used in reverse to parse a sentence and check if it is grammatical.&lt;br /&gt;
&lt;br /&gt;
In the late 1950's, [[John Backus]] and Peter Naur developed a notation for describing [[programming language]]s. This notation is known as [[Backus Naur Form]] (or BNF) and turns out to be equivalent to Chomsky's grammar number two (context-free grammar), although it was developed independently of Chomsky's work. Backus-Naur Form was first used in the Algol 60 Report to specify the syntax of [[Algol 60]], and has since been used for specifying the syntax of other programming languages. &lt;br /&gt;
&lt;br /&gt;
==Example of a very simple generative grammar==&lt;br /&gt;
This very simple example can handle only a tiny subset of English and should not be taken seriously as a guide to English grammar or vocabulary. It is based on an example by David Crystal&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite book &lt;br /&gt;
| last = Crystal &lt;br /&gt;
| first = David  &lt;br /&gt;
| title = The Cambridge Encyclopedia of Language &lt;br /&gt;
| publisher = Cambridge University Press &lt;br /&gt;
| year = 1987 &lt;br /&gt;
| isbn = 0-521-42443-7&lt;br /&gt;
| pages = page 97&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; and is a slight extension of an example on slide 9 of this lecture.&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.cs.princeton.edu/~rywang/99f126/slides/16th.pdf&lt;br /&gt;
| title = Lecture notes: Formal Languages&lt;br /&gt;
| accessdate = 2012-04-07}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase''         # A ''Sentence'' consists of a ''NounPhrase'' followed by a ''VerbPhrase''&lt;br /&gt;
 ''NounPhrase'' -&amp;gt;  ''Determiner'' ''Noun''               # A ''NounPhrase'' consists of a ''Determiner'' followed by a ''Noun''&lt;br /&gt;
 ''VerbPhrase'' -&amp;gt;  ''Verb'' ''NounPhrase''               # A ''VerbPhrase'' consists of a ''Verb'' followed by a ''NounPhrase''&lt;br /&gt;
 ''Determiner'' -&amp;gt;  '''a''', '''the'''                        # A ''Determiner''  is one of: '''a''' or '''the'''&lt;br /&gt;
 ''Noun''       -&amp;gt;  '''boy''', '''girl''', '''dog'''                # A ''Noun'' is one of: '''boy''' or '''girl''' or '''dog'''  &lt;br /&gt;
 ''Verb''       -&amp;gt;  '''chased''', '''heard''', '''saw'''            # A ''Verb'' is one of: '''chased''' or '''heard''' or '''saw'''&lt;br /&gt;
&lt;br /&gt;
Notation used above: &lt;br /&gt;
:The symbol &amp;quot;-&amp;gt;&amp;quot; means &amp;quot;can be replaced by&amp;quot;.  &lt;br /&gt;
:When there are several items on the right hand side separated by commas, just one of these items can be selected. &lt;br /&gt;
:The comments preceded by &amp;quot;#&amp;quot; are not part of the generative grammar, but hopefully will help folks understand the example a little better.&lt;br /&gt;
&lt;br /&gt;
By making appropriate substitutions we can generate such sentences as:&lt;br /&gt;
:The dog chased a girl.&lt;br /&gt;
:The girl heard the dog.&lt;br /&gt;
:The boy saw a girl.&lt;br /&gt;
&lt;br /&gt;
The stages in the generation of these examples are as follows:&lt;br /&gt;
:''Sentence''&lt;br /&gt;
:-&amp;gt; ''NounPhrase'' ''VerbPhrase''&lt;br /&gt;
:-&amp;gt; ''Determiner'' ''Noun'' ''Verb'' ''NounPhrase''&lt;br /&gt;
:-&amp;gt; ''Determiner'' ''Noun'' ''Verb'' ''Determiner'' ''Noun''&lt;br /&gt;
&lt;br /&gt;
By appropriate selection of words to substitute for ''Determiner'', ''Noun'', and ''Verb'' we can produce the 3 example sentences above.&lt;br /&gt;
&lt;br /&gt;
The simple grammar defines a few words which can be substituted for ''Determiner'', ''Noun'', and ''Verb''. There are two possibilities for ''Determiner'', three for ''Noun'', and three for ''Verb'', with both ''Determiner'' and ''Noun'' appearing twice in the expansion. Hence the total number of grammatical sentences which can be generated by this simple grammar is 108 (= 2 * 3 * 3 * 2 * 3). In this particular case the possible words have been carefully chosen so that all of these 108 sentences also actually mean something.&lt;br /&gt;
&lt;br /&gt;
Note that the use of ''italics'' and '''boldface''' in this example is merely a convenient way of indicating the difference between items which can be expanded further (e.g. concepts such as ''NounPhrase'') and items which can not be expanded further (e.g. words such as '''girl'''). In the linguistic literature, items which can be expanded further are referred to as 'non-terminal' items, while items which can't be expanded further are known as 'terminal' items.&lt;br /&gt;
&lt;br /&gt;
The 'comma' notation for alternatives is a form of shorthand. In some formulations this would be shown as several separate rules, so that:&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''a''', '''the''' &lt;br /&gt;
could be shown as two rules:&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''a'''&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''the''' &lt;br /&gt;
&lt;br /&gt;
==Caution==&lt;br /&gt;
While a generative grammar may produce sentences which are grammatically correct, there is no certainty that such sentences will actually mean anything. The classic example of such a meaningless sentence is from Chomsky's book&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite book &lt;br /&gt;
| last = Chomsky &lt;br /&gt;
| first = Noam &lt;br /&gt;
| title = Syntactic Structures &lt;br /&gt;
| year = 1957 &lt;br /&gt;
| publisher = Mouton &lt;br /&gt;
| location = The Hague/Paris &lt;br /&gt;
| pages = page 15 &lt;br /&gt;
| isbn = 3-11-017279-8&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; with the grammatically correct sentence:&lt;br /&gt;
&lt;br /&gt;
:&amp;quot;Colorless green ideas sleep furiously.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
:This example illustrates the difference between grammar/syntax and meaning/semantics.&lt;br /&gt;
&lt;br /&gt;
Another problem when analysing a sentence is that many English words have multiple meanings, so that there may be more than one way to interpret a sentence. A simple example is the sentence: &lt;br /&gt;
:&amp;quot;Time flies.&amp;quot; &lt;br /&gt;
:Is this an instruction to check how fast flies are flying, or an indication that time appears to be passing quickly? &lt;br /&gt;
:A varied and entertaining selection of such ambiguities has been compiled by Jeff Gray.&amp;lt;ref&amp;gt;{{Cite web &lt;br /&gt;
| title = Collection of Ambiguous or Inconsistent/Incomplete Statements  &lt;br /&gt;
| url = http://www.gray-area.org/Research/Ambig/ &lt;br /&gt;
| author = Jeff Gray&lt;br /&gt;
| accessdate = 2012-04-10&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Formal grammar==&lt;br /&gt;
'''Note''': this section and subsequent sections are, by necessity, slightly more technical/formal than the earlier parts of this article, though specialist notation has been largely avoided. Make sure that you understand the 'Simple example' above before proceeding further, since references will be made to that example to help explain the technicalities, and variations on that example will be used to illustrate new ideas. An attempt has been made to avoid formal linguistic abbreviations and unexplained jargon.&lt;br /&gt;
&lt;br /&gt;
A formal generative grammar has four components (see slide 19 of this lecture&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://adammikeal.org/courses/compute/Chomsky%20Presentation.pdf&lt;br /&gt;
| title = The Chomsky Hierarchy&lt;br /&gt;
| accessdate = 2012-04-06&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
):&lt;br /&gt;
# a finite number of non-terminal concepts (e.g. ''VerbPhrase'' in the example, or anything else in ''italics''),&lt;br /&gt;
# a finite number of terminal items (e.g. '''girl''' in the example, or anything else in '''bold-face''').&lt;br /&gt;
# a finite set of rules for transforming non-terminal items (e.g. the example has 6 rules).&lt;br /&gt;
# a single starting point (e.g. ''Sentence'' in the example).&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
:Any item which appears on the left-hand side of a transformation rule is non-terminal since it can be replaced by something else; apart from the starting point, all other non-terminals must also appear somewhere on the right-hand side of transformation rule.&lt;br /&gt;
:An item which appears only on the right-hand side of a transformation rule is a terminal item, since it can not be transformed further.&lt;br /&gt;
:A list of all the terminal items is effectively the vocabulary from which sentences are built.&lt;br /&gt;
:Linguists have developed various classes of grammars by using constraints to govern what sort of rules can be used for any particular grammar.&lt;br /&gt;
&lt;br /&gt;
===Changing the rules===&lt;br /&gt;
An relatively small change to even a single rule can make a large change in the language which can be generated. For example, change the first rule in the simple example to read:&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''NounPhrase'' ''VerbPhrase'' '''and''' ''NounPhrase'' ''VerbPhrase''&lt;br /&gt;
This means that a ''Sentence'' is either a ''NounPhrase'' followed by a ''VerbPhrase'' or a ''NounPhrase'' followed by a ''VerbPhrase'' followed by '''and''' followed by a ''NounPhrase'' followed by a ''VerbPhrase''. In addition to the shorter sentences already discussed, this could also generate a sentence such as: &amp;quot;A dog saw a girl and the dog chased the girl&amp;quot;. The total number of grammatically-correct sentences which can be generated by this modified grammar is now 11,772 (108 + 108*108), though some of these may not be very meaingful.&lt;br /&gt;
&lt;br /&gt;
===Towards infinity===&lt;br /&gt;
A significantly different rule change can have an astounding effect. Consider changing the first rule to read:&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''NounPhrase'' ''VerbPhrase'' '''and''' ''Sentence''&lt;br /&gt;
This can generate a potentially infinite number of sentences (any number of these five-word sentences linked by '''and'''). This is an example of what is known as a [[Recursion|recursive]] definition, whereby a ''Sentence'' is partially defined in terms of itself. In such a recursive rule there must be at least one transformation option which does not involve ''Sentence'', otherwise the transformation could never stop.&lt;br /&gt;
&lt;br /&gt;
The above change is known as right-recursive; a left-recursive formulation is also possible, and can in this example generate exactly the same sentences. As shown below  under 'Context-free grammar', there are situations where the choice of left- or right-recursive formulations can change the meaning. &lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''Sentence'' '''and''' ''NounPhrase'' ''VerbPhrase'' &lt;br /&gt;
&lt;br /&gt;
The distinction between left- and right-recursive grammars becomes important when trying to parse/analyse a sentence; some types of parser work best with left-recursive grammars, while other types work best with right-recursive grammars. This distinction is particularly relevant in connection with [[compiler|compiling or translating]] a program written in some high-level [[programming language]] so that it can be used on a [[computer]].&lt;br /&gt;
&lt;br /&gt;
==Chomsky hierarchy==&lt;br /&gt;
By imposing different constraints&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.cs.uaf.edu/2011/spring/cs331/lectures/cs331_20110124_grammar.html&lt;br /&gt;
| title = Lecture notes: Languages &amp;amp; Grammars&lt;br /&gt;
| accessdate = 2012-04-07&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; &lt;br /&gt;
as to what sort of transformation rules could be used, Chomsky was able to define four strictly nested transformational grammars, which he numbered from 0 to 3. As the grammar number increases, the generated language becomes simpler. As the grammar number decreases, parsing a sentence in that language becomes more difficult. The following table provides a summary, which is then explained further in the subsequent subsections.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!| Chomsky&amp;lt;br&amp;gt;number || linguistic name || Rule constraints || Recogniser+ || Notes &lt;br /&gt;
|-&lt;br /&gt;
| 0 || recursively enumerable || [anything] -&amp;gt; [anything] || Turing machine || most human languages &lt;br /&gt;
|-&lt;br /&gt;
| 1 || context-sensitive || X ''A'' Y -&amp;gt; X [anything] Y || linear bounded automaton || X and Y provide the context in which ''A'' can be transformed &lt;br /&gt;
|-&lt;br /&gt;
| 2 || context-free || ''A'' -&amp;gt; [anything] || non-deterministic push-down automaton || syntax analysis for most programming languages &lt;br /&gt;
|-&lt;br /&gt;
| 3 || regular || ''A'' -&amp;gt; [nothing]&amp;lt;br&amp;gt;''A'' -&amp;gt; '''xyz'''&amp;lt;br&amp;gt;''A'' -&amp;gt; '''xyz''' ''B'' || finite automaton&amp;lt;br&amp;gt;or finite state machine || lexical analysis (combining characters into words/tokens)  &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''+''' The '''recogniser''' column indicates the type of mathematical or computer science theoretical model needed to recognise that a sentence belongs to a language, essentially by applying the transformation rules in reverse to work backwards from the actual words in order to finish up with a ''sentence'' (in programming languages the starting concept is usually a ''program''). A finite automaton uses only a small fixed amount of memory, operates in time proportional to the length of the input, and always reaches a decision, while a Turing machine may use an infinite amount of memory and time and may fail to reach a decision (may never stop).&lt;br /&gt;
&lt;br /&gt;
In the linguistic literature, [nothing] is often represented by the symbol '''ε'''.&lt;br /&gt;
&lt;br /&gt;
The descriptions of the various Chomsky levels which follows are presented in reverse order, so as to work up from a simple case to a rather complicated case.&lt;br /&gt;
&lt;br /&gt;
===Level 3: regular grammar===&lt;br /&gt;
The transformation rules for regular grammars are required to be very simple. &lt;br /&gt;
*Only a single non-terminal item can appear on the left-hand side of a rule.&lt;br /&gt;
*The right-hand side of any rule must be one of:&lt;br /&gt;
**[nothing].&lt;br /&gt;
**a terminal item.&lt;br /&gt;
**a terminal item followed by a non-terminal item.&lt;br /&gt;
Note that instead of a terminal item we could have a non-terminal item whose transformation rule immediately resolves to a single terminal item, or to one of several terminal items.&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
Informally we can define a 'word' as a sequence of one or more ''Letter''s. The following regular grammar provides a more formal definition; for simplicity it is restricted to lower-case letters.&lt;br /&gt;
&lt;br /&gt;
 ''Word''     -&amp;gt; ''Letter'' ''PartWord''&lt;br /&gt;
 ''PartWord'' -&amp;gt; [nothing]&lt;br /&gt;
 ''PartWord'' -&amp;gt; ''Letter'' ''PartWord''&lt;br /&gt;
 ''Letter''   -&amp;gt; '''a''', '''b''', ... '''z'''&lt;br /&gt;
&lt;br /&gt;
Note that ''PartWord'' is recursively defined, with the recursion stopping if it is transformed into [nothing].&lt;br /&gt;
&lt;br /&gt;
For one-letter words we expand as: &lt;br /&gt;
:''Word'' -&amp;gt; ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' [nothing] -&amp;gt; ''Letter''&lt;br /&gt;
&lt;br /&gt;
For two-letter words we expand as: &lt;br /&gt;
:''Word'' -&amp;gt; ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' ''Letter'' [nothing] -&amp;gt;  ''Letter'' ''Letter''&lt;br /&gt;
&lt;br /&gt;
Obviously, words of any length can be constructed, though they may well not actually be words from any language. &lt;br /&gt;
&lt;br /&gt;
====Discussion====&lt;br /&gt;
Trying to devise transformation rules to produce words which are more English-like is much more difficult - how do you insist on at least one vowel or on no more than 5 consecutive consonants (e.g. as in 'strengths').&lt;br /&gt;
&lt;br /&gt;
Further examples in [[Regular grammar]] show how numbers can be defined via a regular grammar, and also show how a hyphenated word could be defined.&lt;br /&gt;
&lt;br /&gt;
One of the limitations of a regular grammar is that it can't cope with nested matching brackets, so that it is impossible to write a regular grammar to describe an expression such as '''2 * (3+4)''' where that grammar is expected to allow brackets nested to any depth. A context-free grammar is needed for this, as described in the next section.&lt;br /&gt;
&lt;br /&gt;
Regular grammars or equivalent are widely used by [[compiler]]s in the lexical analysis of programming languages.&lt;br /&gt;
&lt;br /&gt;
===Level 2: context-free grammar===&lt;br /&gt;
The transformation rules for context-free grammars don't appear that much different from those for regular grammars. &lt;br /&gt;
*Only a single non-terminal item can appear on the left-hand side of a rule.&lt;br /&gt;
*The right-hand side of any rule must be one of:&lt;br /&gt;
**[nothing].&lt;br /&gt;
**any combination of terminal items and non-terminal items.&lt;br /&gt;
&lt;br /&gt;
The key difference is that in a regular grammar, any non-empty rule must effectively start with terminal item so that every rule transformation makes some immediate progress, while in a context-free grammar a rule could start with a non-terminal item which itself could be subject to arbitrary further transformations.&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
The following example shows how context-free grammars can cope with arithmetic expressions involving possibly nested brackets. Also an expression such as &amp;quot;2 + 3 * 4&amp;quot; could be interpreted as either &amp;quot;(2 + 3) * 4&amp;quot; or as &amp;quot;2 + (3 * 4)&amp;quot;. The latter interpretation is that which is normally used - multiplication &amp;quot;*&amp;quot; is said to have a higher priority than addition &amp;quot;+&amp;quot; - so the example also needs to incorporate this priority concept into the grammar. Furthermore, consecutive operators of the same priority are applied from left to right, so that &amp;quot;8 - 2 + 3&amp;quot; is normally interpreted as &amp;quot;(8 - 2) + 3&amp;quot; = 9, rather than as &amp;quot;8 - (2 + 3)&amp;quot; = 3.  This ordering must also be built in to the grammar.&lt;br /&gt;
&lt;br /&gt;
To avoid distracting side-issues, this example only deals with numbers which consist solely of a single digit. The example is a simplified version of the definition of an arithmetic expression given in the Revised Algol 60 Report (Section 3.3.1).&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.masswerk.at/algol60/report.htm&lt;br /&gt;
| title = Revised Report on the Algorithmic Language Algol 60&lt;br /&gt;
| accessdate = 2012-04-22&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ''Expression'' -&amp;gt; ''Term''                        # an ''Expression'' is either a ''Term''&lt;br /&gt;
 ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''    #   or an ''Expression'' followed by '''+''' or '''-''' followed by a ''Term''&lt;br /&gt;
 ''Term''       -&amp;gt; ''Primary''                     # a ''Term'' is either a ''Primary''&lt;br /&gt;
 ''Term''       -&amp;gt; ''Term'' ''MulDivOp'' ''Primary''       #   or a ''Term'' followed by '''*''' or '''/''' followed by a ''Primary''&lt;br /&gt;
                                           #&lt;br /&gt;
 ''Primary''    -&amp;gt; ''Number''                      # a ''Primary'' is either a ''Number''&lt;br /&gt;
 ''Primary''    -&amp;gt; '''(''' ''Expression'' ''')'''              #   or an ''Expression'' enclosed in brackets&lt;br /&gt;
                                           #&lt;br /&gt;
 ''MulDivOp''   -&amp;gt; '''*'''. '''/'''                        # multiplication and division have the same priority&lt;br /&gt;
 ''AddSubOp''   -&amp;gt; '''+'''. '''-'''                        # addition and subtraction have the same priority&lt;br /&gt;
 ''Number''     -&amp;gt; '''0''', '''1''', ... '''9'''                 # this simple-minded definition of a ''Number'' is enough for this example&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
* Both ''Expression'' and ''Term'' are each defined via a left-recursive rule; this ensures that operators of the same priority are applied from left to right.&lt;br /&gt;
* The distinction between ''Expression'' and ''Term'' ensures that multiplication/division are applied before addition/subtraction.&lt;br /&gt;
* ''Expression'' is indirectly recursive via ''Term'' and ''Primary'' to allow bracketed sub-expressions to any depth.&lt;br /&gt;
&lt;br /&gt;
Example 1: generate 2 + 3 * 4&lt;br /&gt;
&lt;br /&gt;
  ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Term'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Primary'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' ''Term''                                 # '''+''' can not be applied until ''Term'' has been evaluated&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' ''Term'' ''MulDivOp'' ''Primary''&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' ''Primary'' ''MulDipOp'' ''Primary''&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' '''3''' '''*''' '''4'''&lt;br /&gt;
&lt;br /&gt;
Example 2: generate 2 * 3 + 4&lt;br /&gt;
&lt;br /&gt;
  ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Term'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Term'' ''MulDivOp'' ''Primary'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Primary'' ''MulDivOp'' ''Primary'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; '''2''' '''*''' '''3''' ''AddSubOp'' ''Term''                      # ''Term'' to left of ''AddSubOp'' is evaluated first&lt;br /&gt;
             -&amp;gt; '''2''' '''*''' '''3''' ''AddSubOp'' ''Primary''  &lt;br /&gt;
             -&amp;gt; '''2''' '''*''' '''3''' '''+''' '''4'''&lt;br /&gt;
&lt;br /&gt;
===Level 1===&lt;br /&gt;
For both regular grammars and context-free grammars, the left-hand side of any rule is always a single non-terminal item, and any transformation is applied regardless of the context in which that non-terminal item appears.&lt;br /&gt;
&lt;br /&gt;
For context-sensitive grammars the left-hand side of a rule may indicate the context in which that rule applies, so that the same non-terminal item may be transformed in different ways depending on the context in which it appears. Several examples appear in these lecture notes.&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.divms.uiowa.edu/~fleck/taylor.pdf&lt;br /&gt;
| title = Context-sensitive Examples&lt;br /&gt;
| accessdate = 2012-04-26&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Level 0===&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[category:linguistics]]&lt;br /&gt;
[[Category:Computer Science]]&lt;/div&gt;</summary>
		<author><name>RolandPlankton</name></author>
	</entry>
	<entry>
		<id>https://www.conservapedia.com/index.php?title=Chomsky_hierarchy&amp;diff=978107</id>
		<title>Chomsky hierarchy</title>
		<link rel="alternate" type="text/html" href="https://www.conservapedia.com/index.php?title=Chomsky_hierarchy&amp;diff=978107"/>
		<updated>2012-04-26T21:07:11Z</updated>

		<summary type="html">&lt;p&gt;RolandPlankton: /* Level 1 */ add introductory sentences&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The '''Chomsky hierarchy''', sometimes known as the '''Chomsky-Schützenberger hierarchy''', is a hierarchy of formal grammatical systems for describing various classes of languages; the hierarchy can apply to both human and computer languages. This hierarchy was first published in 1956 by [[Noam Chomsky|Chomsky]].&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite journal &lt;br /&gt;
| title = Three models for the description of language &lt;br /&gt;
| year = 1956 &lt;br /&gt;
| last = Chomsky &lt;br /&gt;
| first = Noam &lt;br /&gt;
| journal = IRE Transactions on Information Theory &lt;br /&gt;
| volume = 2 &lt;br /&gt;
| pages = 113–124 &lt;br /&gt;
| url = http://www.chomsky.info/articles/195609--.pdf &lt;br /&gt;
| accessdate = 2012-04-08&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
These grammatical systems were referred to by Chomsky as ''transformational grammars''.  Other linguists have since developed a variety of similar grammars; together these are known as ''generative grammars''. &lt;br /&gt;
&lt;br /&gt;
The basic idea of a '''generative grammar''' is to provide a set of rules which are capable of generating all possible grammatical sentences in some language; the rules must constrain the generation so that only grammatical sentences are generated. The rules can also be used in reverse to parse a sentence and check if it is grammatical.&lt;br /&gt;
&lt;br /&gt;
In the late 1950's, [[John Backus]] and Peter Naur developed a notation for describing [[programming language]]s. This notation is known as [[Backus Naur Form]] (or BNF) and turns out to be equivalent to Chomsky's grammar number two (context-free grammar), although it was developed independently of Chomsky's work. Backus-Naur Form was first used in the Algol 60 Report to specify the syntax of [[Algol 60]], and has since been used for specifying the syntax of other programming languages. &lt;br /&gt;
&lt;br /&gt;
==Example of a very simple generative grammar==&lt;br /&gt;
This very simple example can handle only a tiny subset of English and should not be taken seriously as a guide to English grammar or vocabulary. It is based on an example by David Crystal&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite book &lt;br /&gt;
| last = Crystal &lt;br /&gt;
| first = David  &lt;br /&gt;
| title = The Cambridge Encyclopedia of Language &lt;br /&gt;
| publisher = Cambridge University Press &lt;br /&gt;
| year = 1987 &lt;br /&gt;
| isbn = 0-521-42443-7&lt;br /&gt;
| pages = page 97&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; and is a slight extension of an example on slide 9 of this lecture.&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.cs.princeton.edu/~rywang/99f126/slides/16th.pdf&lt;br /&gt;
| title = Lecture notes: Formal Languages&lt;br /&gt;
| accessdate = 2012-04-07}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase''         # A ''Sentence'' consists of a ''NounPhrase'' followed by a ''VerbPhrase''&lt;br /&gt;
 ''NounPhrase'' -&amp;gt;  ''Determiner'' ''Noun''               # A ''NounPhrase'' consists of a ''Determiner'' followed by a ''Noun''&lt;br /&gt;
 ''VerbPhrase'' -&amp;gt;  ''Verb'' ''NounPhrase''               # A ''VerbPhrase'' consists of a ''Verb'' followed by a ''NounPhrase''&lt;br /&gt;
 ''Determiner'' -&amp;gt;  '''a''', '''the'''                        # A ''Determiner''  is one of: '''a''' or '''the'''&lt;br /&gt;
 ''Noun''       -&amp;gt;  '''boy''', '''girl''', '''dog'''                # A ''Noun'' is one of: '''boy''' or '''girl''' or '''dog'''  &lt;br /&gt;
 ''Verb''       -&amp;gt;  '''chased''', '''heard''', '''saw'''            # A ''Verb'' is one of: '''chased''' or '''heard''' or '''saw'''&lt;br /&gt;
&lt;br /&gt;
Notation used above: &lt;br /&gt;
:The symbol &amp;quot;-&amp;gt;&amp;quot; means &amp;quot;can be replaced by&amp;quot;.  &lt;br /&gt;
:When there are several items on the right hand side separated by commas, just one of these items can be selected. &lt;br /&gt;
:The comments preceded by &amp;quot;#&amp;quot; are not part of the generative grammar, but hopefully will help folks understand the example a little better.&lt;br /&gt;
&lt;br /&gt;
By making appropriate substitutions we can generate such sentences as:&lt;br /&gt;
:The dog chased a girl.&lt;br /&gt;
:The girl heard the dog.&lt;br /&gt;
:The boy saw a girl.&lt;br /&gt;
&lt;br /&gt;
The stages in the generation of these examples are as follows:&lt;br /&gt;
:''Sentence''&lt;br /&gt;
:-&amp;gt; ''NounPhrase'' ''VerbPhrase''&lt;br /&gt;
:-&amp;gt; ''Determiner'' ''Noun'' ''Verb'' ''NounPhrase''&lt;br /&gt;
:-&amp;gt; ''Determiner'' ''Noun'' ''Verb'' ''Determiner'' ''Noun''&lt;br /&gt;
&lt;br /&gt;
By appropriate selection of words to substitute for ''Determiner'', ''Noun'', and ''Verb'' we can produce the 3 example sentences above.&lt;br /&gt;
&lt;br /&gt;
The simple grammar defines a few words which can be substituted for ''Determiner'', ''Noun'', and ''Verb''. There are two possibilities for ''Determiner'', three for ''Noun'', and three for ''Verb'', with both ''Determiner'' and ''Noun'' appearing twice in the expansion. Hence the total number of grammatical sentences which can be generated by this simple grammar is 108 (= 2 * 3 * 3 * 2 * 3). In this particular case the possible words have been carefully chosen so that all of these 108 sentences also actually mean something.&lt;br /&gt;
&lt;br /&gt;
Note that the use of ''italics'' and '''boldface''' in this example is merely a convenient way of indicating the difference between items which can be expanded further (e.g. concepts such as ''NounPhrase'') and items which can not be expanded further (e.g. words such as '''girl'''). In the linguistic literature, items which can be expanded further are referred to as 'non-terminal' items, while items which can't be expanded further are known as 'terminal' items.&lt;br /&gt;
&lt;br /&gt;
The 'comma' notation for alternatives is a form of shorthand. In some formulations this would be shown as several separate rules, so that:&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''a''', '''the''' &lt;br /&gt;
could be shown as two rules:&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''a'''&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''the''' &lt;br /&gt;
&lt;br /&gt;
==Caution==&lt;br /&gt;
While a generative grammar may produce sentences which are grammatically correct, there is no certainty that such sentences will actually mean anything. The classic example of such a meaningless sentence is from Chomsky's book&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite book &lt;br /&gt;
| last = Chomsky &lt;br /&gt;
| first = Noam &lt;br /&gt;
| title = Syntactic Structures &lt;br /&gt;
| year = 1957 &lt;br /&gt;
| publisher = Mouton &lt;br /&gt;
| location = The Hague/Paris &lt;br /&gt;
| pages = page 15 &lt;br /&gt;
| isbn = 3-11-017279-8&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; with the grammatically correct sentence:&lt;br /&gt;
&lt;br /&gt;
:&amp;quot;Colorless green ideas sleep furiously.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
:This example illustrates the difference between grammar/syntax and meaning/semantics.&lt;br /&gt;
&lt;br /&gt;
Another problem when analysing a sentence is that many English words have multiple meanings, so that there may be more than one way to interpret a sentence. A simple example is the sentence: &lt;br /&gt;
:&amp;quot;Time flies.&amp;quot; &lt;br /&gt;
:Is this an instruction to check how fast flies are flying, or an indication that time appears to be passing quickly? &lt;br /&gt;
:A varied and entertaining selection of such ambiguities has been compiled by Jeff Gray.&amp;lt;ref&amp;gt;{{Cite web &lt;br /&gt;
| title = Collection of Ambiguous or Inconsistent/Incomplete Statements  &lt;br /&gt;
| url = http://www.gray-area.org/Research/Ambig/ &lt;br /&gt;
| author = Jeff Gray&lt;br /&gt;
| accessdate = 2012-04-10&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Formal grammar==&lt;br /&gt;
'''Note''': this section and subsequent sections are, by necessity, slightly more technical/formal than the earlier parts of this article, though specialist notation has been largely avoided. Make sure that you understand the 'Simple example' above before proceeding further, since references will be made to that example to help explain the technicalities, and variations on that example will be used to illustrate new ideas. An attempt has been made to avoid formal linguistic abbreviations and unexplained jargon.&lt;br /&gt;
&lt;br /&gt;
A formal generative grammar has four components (see slide 19 of this lecture&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://adammikeal.org/courses/compute/Chomsky%20Presentation.pdf&lt;br /&gt;
| title = The Chomsky Hierarchy&lt;br /&gt;
| accessdate = 2012-04-06&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
):&lt;br /&gt;
# a finite number of non-terminal concepts (e.g. ''VerbPhrase'' in the example, or anything else in ''italics''),&lt;br /&gt;
# a finite number of terminal items (e.g. '''girl''' in the example, or anything else in '''bold-face''').&lt;br /&gt;
# a finite set of rules for transforming non-terminal items (e.g. the example has 6 rules).&lt;br /&gt;
# a single starting point (e.g. ''Sentence'' in the example).&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
:Any item which appears on the left-hand side of a transformation rule is non-terminal since it can be replaced by something else; apart from the starting point, all other non-terminals must also appear somewhere on the right-hand side of transformation rule.&lt;br /&gt;
:An item which appears only on the right-hand side of a transformation rule is a terminal item, since it can not be transformed further.&lt;br /&gt;
:A list of all the terminal items is effectively the vocabulary from which sentences are built.&lt;br /&gt;
:Linguists have developed various classes of grammars by using constraints to govern what sort of rules can be used for any particular grammar.&lt;br /&gt;
&lt;br /&gt;
===Changing the rules===&lt;br /&gt;
An relatively small change to even a single rule can make a large change in the language which can be generated. For example, change the first rule in the simple example to read:&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''NounPhrase'' ''VerbPhrase'' '''and''' ''NounPhrase'' ''VerbPhrase''&lt;br /&gt;
This means that a ''Sentence'' is either a ''NounPhrase'' followed by a ''VerbPhrase'' or a ''NounPhrase'' followed by a ''VerbPhrase'' followed by '''and''' followed by a ''NounPhrase'' followed by a ''VerbPhrase''. In addition to the shorter sentences already discussed, this could also generate a sentence such as: &amp;quot;A dog saw a girl and the dog chased the girl&amp;quot;. The total number of grammatically-correct sentences which can be generated by this modified grammar is now 11,772 (108 + 108*108), though some of these may not be very meaingful.&lt;br /&gt;
&lt;br /&gt;
===Towards infinity===&lt;br /&gt;
A significantly different rule change can have an astounding effect. Consider changing the first rule to read:&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''NounPhrase'' ''VerbPhrase'' '''and''' ''Sentence''&lt;br /&gt;
This can generate a potentially infinite number of sentences (any number of these five-word sentences linked by '''and'''). This is an example of what is known as a [[Recursion|recursive]] definition, whereby a ''Sentence'' is partially defined in terms of itself. In such a recursive rule there must be at least one transformation option which does not involve ''Sentence'', otherwise the transformation could never stop.&lt;br /&gt;
&lt;br /&gt;
The above change is known as right-recursive; a left-recursive formulation is also possible, and can in this example generate exactly the same sentences. As shown below  under 'Context-free grammar', there are situations where the choice of left- or right-recursive formulations can change the meaning. &lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''Sentence'' '''and''' ''NounPhrase'' ''VerbPhrase'' &lt;br /&gt;
&lt;br /&gt;
The distinction between left- and right-recursive grammars becomes important when trying to parse/analyse a sentence; some types of parser work best with left-recursive grammars, while other types work best with right-recursive grammars. This distinction is particularly relevant in connection with [[compiler|compiling or translating]] a program written in some high-level [[programming language]] so that it can be used on a [[computer]].&lt;br /&gt;
&lt;br /&gt;
==Chomsky hierarchy==&lt;br /&gt;
By imposing different constraints&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.cs.uaf.edu/2011/spring/cs331/lectures/cs331_20110124_grammar.html&lt;br /&gt;
| title = Lecture notes: Languages &amp;amp; Grammars&lt;br /&gt;
| accessdate = 2012-04-07&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; &lt;br /&gt;
as to what sort of transformation rules could be used, Chomsky was able to define four strictly nested transformational grammars, which he numbered from 0 to 3. As the grammar number increases, the generated language becomes simpler. As the grammar number decreases, parsing a sentence in that language becomes more difficult. The following table provides a summary, which is then explained further in the subsequent subsections.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!| Chomsky&amp;lt;br&amp;gt;number || linguistic name || Rule constraints || Recogniser+ || Notes &lt;br /&gt;
|-&lt;br /&gt;
| 0 || recursively enumerable || [anything] -&amp;gt; [anything] || Turing machine || most human languages &lt;br /&gt;
|-&lt;br /&gt;
| 1 || context-sensitive || X ''A'' Y -&amp;gt; X [anything] Y || linear bounded automaton || X and Y provide the context in which ''A'' can be transformed &lt;br /&gt;
|-&lt;br /&gt;
| 2 || context-free || ''A'' -&amp;gt; [anything] || non-deterministic push-down automaton || syntax analysis for most programming languages &lt;br /&gt;
|-&lt;br /&gt;
| 3 || regular || ''A'' -&amp;gt; [nothing]&amp;lt;br&amp;gt;''A'' -&amp;gt; '''xyz'''&amp;lt;br&amp;gt;''A'' -&amp;gt; '''xyz''' ''B'' || finite automaton&amp;lt;br&amp;gt;or finite state machine || lexical analysis (combining characters into words/tokens)  &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''+''' The '''recogniser''' column indicates the type of mathematical or computer science theoretical model needed to recognise that a sentence belongs to a language, essentially by applying the transformation rules in reverse to work backwards from the actual words in order to finish up with a ''sentence'' (in programming languages the starting concept is usually a ''program''). A finite automaton uses only a small fixed amount of memory, operates in time proportional to the length of the input, and always reaches a decision, while a Turing machine may use an infinite amount of memory and time and may fail to reach a decision (may never stop).&lt;br /&gt;
&lt;br /&gt;
In the linguistic literature, [nothing] is often represented by the symbol '''ε'''.&lt;br /&gt;
&lt;br /&gt;
The descriptions of the various Chomsky levels which follows are presented in reverse order, so as to work up from a simple case to a rather complicated case.&lt;br /&gt;
&lt;br /&gt;
===Level 3: regular grammar===&lt;br /&gt;
The transformation rules for regular grammars are required to be very simple. &lt;br /&gt;
*Only a single non-terminal item can appear on the left-hand side of a rule.&lt;br /&gt;
*The right-hand side of any rule must be one of:&lt;br /&gt;
**[nothing].&lt;br /&gt;
**a terminal item.&lt;br /&gt;
**a terminal item followed by a non-terminal item.&lt;br /&gt;
Note that instead of a terminal item we could have a non-terminal item whose transformation rule immediately resolves to a single terminal item, or to one of several terminal items.&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
Informally we can define a 'word' as a sequence of one or more ''Letter''s. The following regular grammar provides a more formal definition; for simplicity it is restricted to lower-case letters.&lt;br /&gt;
&lt;br /&gt;
 ''Word''     -&amp;gt; ''Letter'' ''PartWord''&lt;br /&gt;
 ''PartWord'' -&amp;gt; [nothing]&lt;br /&gt;
 ''PartWord'' -&amp;gt; ''Letter'' ''PartWord''&lt;br /&gt;
 ''Letter''   -&amp;gt; '''a''', '''b''', ... '''z'''&lt;br /&gt;
&lt;br /&gt;
Note that ''PartWord'' is recursively defined, with the recursion stopping if it is transformed into [nothing].&lt;br /&gt;
&lt;br /&gt;
For one-letter words we expand as: &lt;br /&gt;
:''Word'' -&amp;gt; ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' [nothing] -&amp;gt; ''Letter''&lt;br /&gt;
&lt;br /&gt;
For two-letter words we expand as: &lt;br /&gt;
:''Word'' -&amp;gt; ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' ''Letter'' [nothing] -&amp;gt;  ''Letter'' ''Letter''&lt;br /&gt;
&lt;br /&gt;
Obviously, words of any length can be constructed, though they may well not actually be words from any language. &lt;br /&gt;
&lt;br /&gt;
====Discussion====&lt;br /&gt;
Trying to devise transformation rules to produce words which are more English-like is much more difficult - how do you insist on at least one vowel or on no more than 5 consecutive consonants (e.g. as in 'strengths').&lt;br /&gt;
&lt;br /&gt;
Further examples in [[Regular grammar]] show how numbers can be defined via a regular grammar, and also show how a hyphenated word could be defined.&lt;br /&gt;
&lt;br /&gt;
One of the limitations of a regular grammar is that it can't cope with nested matching brackets, so that it is impossible to write a regular grammar to describe an expression such as '''2 * (3+4)''' where that grammar is expected to allow brackets nested to any depth. A context-free grammar is needed for this, as described in the next section.&lt;br /&gt;
&lt;br /&gt;
Regular grammars or equivalent are widely used by [[compiler]]s in the lexical analysis of programming languages.&lt;br /&gt;
&lt;br /&gt;
===Level 2: context-free grammar===&lt;br /&gt;
The transformation rules for context-free grammars don't appear that much different from those for regular grammars. &lt;br /&gt;
*Only a single non-terminal item can appear on the left-hand side of a rule.&lt;br /&gt;
*The right-hand side of any rule must be one of:&lt;br /&gt;
**[nothing].&lt;br /&gt;
**any combination of terminal items and non-terminal items.&lt;br /&gt;
&lt;br /&gt;
The key difference is that in a regular grammar, any non-empty rule must effectively start with terminal item so that every rule transformation makes some immediate progress, while in a context-free grammar a rule could start with a non-terminal item which itself could be subject to arbitrary further transformations.&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
The following example shows how context-free grammars can cope with arithmetic expressions involving possibly nested brackets. Also an expression such as &amp;quot;2 + 3 * 4&amp;quot; could be interpreted as either &amp;quot;(2 + 3) * 4&amp;quot; or as &amp;quot;2 + (3 * 4)&amp;quot;. The latter interpretation is that which is normally used - multiplication &amp;quot;*&amp;quot; is said to have a higher priority than addition &amp;quot;+&amp;quot; - so the example also needs to incorporate this priority concept into the grammar. Furthermore, consecutive operators of the same priority are applied from left to right, so that &amp;quot;8 - 2 + 3&amp;quot; is normally interpreted as &amp;quot;(8 - 2) + 3&amp;quot; = 9, rather than as &amp;quot;8 - (2 + 3)&amp;quot; = 3.  This ordering must also be built in to the grammar.&lt;br /&gt;
&lt;br /&gt;
To avoid distracting side-issues, this example only deals with numbers which consist solely of a single digit. The example is a simplified version of the definition of an arithmetic expression given in the Revised Algol 60 Report (Section 3.3.1).&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.masswerk.at/algol60/report.htm&lt;br /&gt;
| title = Revised Report on the Algorithmic Language Algol 60&lt;br /&gt;
| accessdate = 2012-04-22&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ''Expression'' -&amp;gt; ''Term''                        # an ''Expression'' is either a ''Term''&lt;br /&gt;
 ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''    #   or an ''Expression'' followed by '''+''' or '''-''' followed by a ''Term''&lt;br /&gt;
 ''Term''       -&amp;gt; ''Primary''                     # a ''Term'' is either a ''Primary''&lt;br /&gt;
 ''Term''       -&amp;gt; ''Term'' ''MulDivOp'' ''Primary''       #   or a ''Term'' followed by '''*''' or '''/''' followed by a ''Primary''&lt;br /&gt;
                                           #&lt;br /&gt;
 ''Primary''    -&amp;gt; ''Number''                      # a ''Primary'' is either a ''Number''&lt;br /&gt;
 ''Primary''    -&amp;gt; '''(''' ''Expression'' ''')'''              #   or an ''Expression'' enclosed in brackets&lt;br /&gt;
                                           #&lt;br /&gt;
 ''MulDivOp''   -&amp;gt; '''*'''. '''/'''                        # multiplication and division have the same priority&lt;br /&gt;
 ''AddSubOp''   -&amp;gt; '''+'''. '''-'''                        # addition and subtraction have the same priority&lt;br /&gt;
 ''Number''     -&amp;gt; '''0''', '''1''', ... '''9'''                 # this simple-minded definition of a ''Number'' is enough for this example&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
* Both ''Expression'' and ''Term'' are each defined via a left-recursive rule; this ensures that operators of the same priority are applied from left to right.&lt;br /&gt;
* The distinction between ''Expression'' and ''Term'' ensures that multiplication/division are applied before addition/subtraction.&lt;br /&gt;
* ''Expression'' is indirectly recursive via ''Term'' and ''Primary'' to allow bracketed sub-expressions to any depth.&lt;br /&gt;
&lt;br /&gt;
Example 1: generate 2 + 3 * 4&lt;br /&gt;
&lt;br /&gt;
  ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Term'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Primary'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' ''Term''                                 # '''+''' can not be applied until ''Term'' has been evaluated&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' ''Term'' ''MulDivOp'' ''Primary''&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' ''Primary'' ''MulDipOp'' ''Primary''&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' '''3''' '''*''' '''4'''&lt;br /&gt;
&lt;br /&gt;
Example 2: generate 2 * 3 + 4&lt;br /&gt;
&lt;br /&gt;
  ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Term'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Term'' ''MulDivOp'' ''Primary'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Primary'' ''MulDivOp'' ''Primary'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; '''2''' '''*''' '''3''' ''AddSubOp'' ''Term''                      # ''Term'' to left of ''AddSubOp'' is evaluated first&lt;br /&gt;
             -&amp;gt; '''2''' '''*''' '''3''' ''AddSubOp'' ''Primary''  &lt;br /&gt;
             -&amp;gt; '''2''' '''*''' '''3''' '''+''' '''4'''&lt;br /&gt;
&lt;br /&gt;
===Level 1===&lt;br /&gt;
For both regular grammars and context-free grammars, the left-hand side of any rule is always a single non-terminal item, and any transformation is applied regardless of the context in which that non-terminal item appears.&lt;br /&gt;
&lt;br /&gt;
For context-sensitive grammars the left-hand side of a rule may indicate the context in which that rule applies, so that the same non-terminal item may be transformed in different ways depending on the context in which it appears.&lt;br /&gt;
&lt;br /&gt;
===Level 0===&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[category:linguistics]]&lt;br /&gt;
[[Category:Computer Science]]&lt;/div&gt;</summary>
		<author><name>RolandPlankton</name></author>
	</entry>
	<entry>
		<id>https://www.conservapedia.com/index.php?title=Chomsky_hierarchy&amp;diff=978061</id>
		<title>Chomsky hierarchy</title>
		<link rel="alternate" type="text/html" href="https://www.conservapedia.com/index.php?title=Chomsky_hierarchy&amp;diff=978061"/>
		<updated>2012-04-26T14:18:23Z</updated>

		<summary type="html">&lt;p&gt;RolandPlankton: /* Towards infinity */ left- and right- recursive can be different&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The '''Chomsky hierarchy''', sometimes known as the '''Chomsky-Schützenberger hierarchy''', is a hierarchy of formal grammatical systems for describing various classes of languages; the hierarchy can apply to both human and computer languages. This hierarchy was first published in 1956 by [[Noam Chomsky|Chomsky]].&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite journal &lt;br /&gt;
| title = Three models for the description of language &lt;br /&gt;
| year = 1956 &lt;br /&gt;
| last = Chomsky &lt;br /&gt;
| first = Noam &lt;br /&gt;
| journal = IRE Transactions on Information Theory &lt;br /&gt;
| volume = 2 &lt;br /&gt;
| pages = 113–124 &lt;br /&gt;
| url = http://www.chomsky.info/articles/195609--.pdf &lt;br /&gt;
| accessdate = 2012-04-08&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
These grammatical systems were referred to by Chomsky as ''transformational grammars''.  Other linguists have since developed a variety of similar grammars; together these are known as ''generative grammars''. &lt;br /&gt;
&lt;br /&gt;
The basic idea of a '''generative grammar''' is to provide a set of rules which are capable of generating all possible grammatical sentences in some language; the rules must constrain the generation so that only grammatical sentences are generated. The rules can also be used in reverse to parse a sentence and check if it is grammatical.&lt;br /&gt;
&lt;br /&gt;
In the late 1950's, [[John Backus]] and Peter Naur developed a notation for describing [[programming language]]s. This notation is known as [[Backus Naur Form]] (or BNF) and turns out to be equivalent to Chomsky's grammar number two (context-free grammar), although it was developed independently of Chomsky's work. Backus-Naur Form was first used in the Algol 60 Report to specify the syntax of [[Algol 60]], and has since been used for specifying the syntax of other programming languages. &lt;br /&gt;
&lt;br /&gt;
==Example of a very simple generative grammar==&lt;br /&gt;
This very simple example can handle only a tiny subset of English and should not be taken seriously as a guide to English grammar or vocabulary. It is based on an example by David Crystal&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite book &lt;br /&gt;
| last = Crystal &lt;br /&gt;
| first = David  &lt;br /&gt;
| title = The Cambridge Encyclopedia of Language &lt;br /&gt;
| publisher = Cambridge University Press &lt;br /&gt;
| year = 1987 &lt;br /&gt;
| isbn = 0-521-42443-7&lt;br /&gt;
| pages = page 97&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; and is a slight extension of an example on slide 9 of this lecture.&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.cs.princeton.edu/~rywang/99f126/slides/16th.pdf&lt;br /&gt;
| title = Lecture notes: Formal Languages&lt;br /&gt;
| accessdate = 2012-04-07}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase''         # A ''Sentence'' consists of a ''NounPhrase'' followed by a ''VerbPhrase''&lt;br /&gt;
 ''NounPhrase'' -&amp;gt;  ''Determiner'' ''Noun''               # A ''NounPhrase'' consists of a ''Determiner'' followed by a ''Noun''&lt;br /&gt;
 ''VerbPhrase'' -&amp;gt;  ''Verb'' ''NounPhrase''               # A ''VerbPhrase'' consists of a ''Verb'' followed by a ''NounPhrase''&lt;br /&gt;
 ''Determiner'' -&amp;gt;  '''a''', '''the'''                        # A ''Determiner''  is one of: '''a''' or '''the'''&lt;br /&gt;
 ''Noun''       -&amp;gt;  '''boy''', '''girl''', '''dog'''                # A ''Noun'' is one of: '''boy''' or '''girl''' or '''dog'''  &lt;br /&gt;
 ''Verb''       -&amp;gt;  '''chased''', '''heard''', '''saw'''            # A ''Verb'' is one of: '''chased''' or '''heard''' or '''saw'''&lt;br /&gt;
&lt;br /&gt;
Notation used above: &lt;br /&gt;
:The symbol &amp;quot;-&amp;gt;&amp;quot; means &amp;quot;can be replaced by&amp;quot;.  &lt;br /&gt;
:When there are several items on the right hand side separated by commas, just one of these items can be selected. &lt;br /&gt;
:The comments preceded by &amp;quot;#&amp;quot; are not part of the generative grammar, but hopefully will help folks understand the example a little better.&lt;br /&gt;
&lt;br /&gt;
By making appropriate substitutions we can generate such sentences as:&lt;br /&gt;
:The dog chased a girl.&lt;br /&gt;
:The girl heard the dog.&lt;br /&gt;
:The boy saw a girl.&lt;br /&gt;
&lt;br /&gt;
The stages in the generation of these examples are as follows:&lt;br /&gt;
:''Sentence''&lt;br /&gt;
:-&amp;gt; ''NounPhrase'' ''VerbPhrase''&lt;br /&gt;
:-&amp;gt; ''Determiner'' ''Noun'' ''Verb'' ''NounPhrase''&lt;br /&gt;
:-&amp;gt; ''Determiner'' ''Noun'' ''Verb'' ''Determiner'' ''Noun''&lt;br /&gt;
&lt;br /&gt;
By appropriate selection of words to substitute for ''Determiner'', ''Noun'', and ''Verb'' we can produce the 3 example sentences above.&lt;br /&gt;
&lt;br /&gt;
The simple grammar defines a few words which can be substituted for ''Determiner'', ''Noun'', and ''Verb''. There are two possibilities for ''Determiner'', three for ''Noun'', and three for ''Verb'', with both ''Determiner'' and ''Noun'' appearing twice in the expansion. Hence the total number of grammatical sentences which can be generated by this simple grammar is 108 (= 2 * 3 * 3 * 2 * 3). In this particular case the possible words have been carefully chosen so that all of these 108 sentences also actually mean something.&lt;br /&gt;
&lt;br /&gt;
Note that the use of ''italics'' and '''boldface''' in this example is merely a convenient way of indicating the difference between items which can be expanded further (e.g. concepts such as ''NounPhrase'') and items which can not be expanded further (e.g. words such as '''girl'''). In the linguistic literature, items which can be expanded further are referred to as 'non-terminal' items, while items which can't be expanded further are known as 'terminal' items.&lt;br /&gt;
&lt;br /&gt;
The 'comma' notation for alternatives is a form of shorthand. In some formulations this would be shown as several separate rules, so that:&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''a''', '''the''' &lt;br /&gt;
could be shown as two rules:&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''a'''&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''the''' &lt;br /&gt;
&lt;br /&gt;
==Caution==&lt;br /&gt;
While a generative grammar may produce sentences which are grammatically correct, there is no certainty that such sentences will actually mean anything. The classic example of such a meaningless sentence is from Chomsky's book&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite book &lt;br /&gt;
| last = Chomsky &lt;br /&gt;
| first = Noam &lt;br /&gt;
| title = Syntactic Structures &lt;br /&gt;
| year = 1957 &lt;br /&gt;
| publisher = Mouton &lt;br /&gt;
| location = The Hague/Paris &lt;br /&gt;
| pages = page 15 &lt;br /&gt;
| isbn = 3-11-017279-8&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; with the grammatically correct sentence:&lt;br /&gt;
&lt;br /&gt;
:&amp;quot;Colorless green ideas sleep furiously.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
:This example illustrates the difference between grammar/syntax and meaning/semantics.&lt;br /&gt;
&lt;br /&gt;
Another problem when analysing a sentence is that many English words have multiple meanings, so that there may be more than one way to interpret a sentence. A simple example is the sentence: &lt;br /&gt;
:&amp;quot;Time flies.&amp;quot; &lt;br /&gt;
:Is this an instruction to check how fast flies are flying, or an indication that time appears to be passing quickly? &lt;br /&gt;
:A varied and entertaining selection of such ambiguities has been compiled by Jeff Gray.&amp;lt;ref&amp;gt;{{Cite web &lt;br /&gt;
| title = Collection of Ambiguous or Inconsistent/Incomplete Statements  &lt;br /&gt;
| url = http://www.gray-area.org/Research/Ambig/ &lt;br /&gt;
| author = Jeff Gray&lt;br /&gt;
| accessdate = 2012-04-10&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Formal grammar==&lt;br /&gt;
'''Note''': this section and subsequent sections are, by necessity, slightly more technical/formal than the earlier parts of this article, though specialist notation has been largely avoided. Make sure that you understand the 'Simple example' above before proceeding further, since references will be made to that example to help explain the technicalities, and variations on that example will be used to illustrate new ideas. An attempt has been made to avoid formal linguistic abbreviations and unexplained jargon.&lt;br /&gt;
&lt;br /&gt;
A formal generative grammar has four components (see slide 19 of this lecture&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://adammikeal.org/courses/compute/Chomsky%20Presentation.pdf&lt;br /&gt;
| title = The Chomsky Hierarchy&lt;br /&gt;
| accessdate = 2012-04-06&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
):&lt;br /&gt;
# a finite number of non-terminal concepts (e.g. ''VerbPhrase'' in the example, or anything else in ''italics''),&lt;br /&gt;
# a finite number of terminal items (e.g. '''girl''' in the example, or anything else in '''bold-face''').&lt;br /&gt;
# a finite set of rules for transforming non-terminal items (e.g. the example has 6 rules).&lt;br /&gt;
# a single starting point (e.g. ''Sentence'' in the example).&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
:Any item which appears on the left-hand side of a transformation rule is non-terminal since it can be replaced by something else; apart from the starting point, all other non-terminals must also appear somewhere on the right-hand side of transformation rule.&lt;br /&gt;
:An item which appears only on the right-hand side of a transformation rule is a terminal item, since it can not be transformed further.&lt;br /&gt;
:A list of all the terminal items is effectively the vocabulary from which sentences are built.&lt;br /&gt;
:Linguists have developed various classes of grammars by using constraints to govern what sort of rules can be used for any particular grammar.&lt;br /&gt;
&lt;br /&gt;
===Changing the rules===&lt;br /&gt;
An relatively small change to even a single rule can make a large change in the language which can be generated. For example, change the first rule in the simple example to read:&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''NounPhrase'' ''VerbPhrase'' '''and''' ''NounPhrase'' ''VerbPhrase''&lt;br /&gt;
This means that a ''Sentence'' is either a ''NounPhrase'' followed by a ''VerbPhrase'' or a ''NounPhrase'' followed by a ''VerbPhrase'' followed by '''and''' followed by a ''NounPhrase'' followed by a ''VerbPhrase''. In addition to the shorter sentences already discussed, this could also generate a sentence such as: &amp;quot;A dog saw a girl and the dog chased the girl&amp;quot;. The total number of grammatically-correct sentences which can be generated by this modified grammar is now 11,772 (108 + 108*108), though some of these may not be very meaingful.&lt;br /&gt;
&lt;br /&gt;
===Towards infinity===&lt;br /&gt;
A significantly different rule change can have an astounding effect. Consider changing the first rule to read:&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''NounPhrase'' ''VerbPhrase'' '''and''' ''Sentence''&lt;br /&gt;
This can generate a potentially infinite number of sentences (any number of these five-word sentences linked by '''and'''). This is an example of what is known as a [[Recursion|recursive]] definition, whereby a ''Sentence'' is partially defined in terms of itself. In such a recursive rule there must be at least one transformation option which does not involve ''Sentence'', otherwise the transformation could never stop.&lt;br /&gt;
&lt;br /&gt;
The above change is known as right-recursive; a left-recursive formulation is also possible, and can in this example generate exactly the same sentences. As shown below  under 'Context-free grammar', there are situations where the choice of left- or right-recursive formulations can change the meaning. &lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''Sentence'' '''and''' ''NounPhrase'' ''VerbPhrase'' &lt;br /&gt;
&lt;br /&gt;
The distinction between left- and right-recursive grammars becomes important when trying to parse/analyse a sentence; some types of parser work best with left-recursive grammars, while other types work best with right-recursive grammars. This distinction is particularly relevant in connection with [[compiler|compiling or translating]] a program written in some high-level [[programming language]] so that it can be used on a [[computer]].&lt;br /&gt;
&lt;br /&gt;
==Chomsky hierarchy==&lt;br /&gt;
By imposing different constraints&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.cs.uaf.edu/2011/spring/cs331/lectures/cs331_20110124_grammar.html&lt;br /&gt;
| title = Lecture notes: Languages &amp;amp; Grammars&lt;br /&gt;
| accessdate = 2012-04-07&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; &lt;br /&gt;
as to what sort of transformation rules could be used, Chomsky was able to define four strictly nested transformational grammars, which he numbered from 0 to 3. As the grammar number increases, the generated language becomes simpler. As the grammar number decreases, parsing a sentence in that language becomes more difficult. The following table provides a summary, which is then explained further in the subsequent subsections.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!| Chomsky&amp;lt;br&amp;gt;number || linguistic name || Rule constraints || Recogniser+ || Notes &lt;br /&gt;
|-&lt;br /&gt;
| 0 || recursively enumerable || [anything] -&amp;gt; [anything] || Turing machine || most human languages &lt;br /&gt;
|-&lt;br /&gt;
| 1 || context-sensitive || X ''A'' Y -&amp;gt; X [anything] Y || linear bounded automaton || X and Y provide the context in which ''A'' can be transformed &lt;br /&gt;
|-&lt;br /&gt;
| 2 || context-free || ''A'' -&amp;gt; [anything] || non-deterministic push-down automaton || syntax analysis for most programming languages &lt;br /&gt;
|-&lt;br /&gt;
| 3 || regular || ''A'' -&amp;gt; [nothing]&amp;lt;br&amp;gt;''A'' -&amp;gt; '''xyz'''&amp;lt;br&amp;gt;''A'' -&amp;gt; '''xyz''' ''B'' || finite automaton&amp;lt;br&amp;gt;or finite state machine || lexical analysis (combining characters into words/tokens)  &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''+''' The '''recogniser''' column indicates the type of mathematical or computer science theoretical model needed to recognise that a sentence belongs to a language, essentially by applying the transformation rules in reverse to work backwards from the actual words in order to finish up with a ''sentence'' (in programming languages the starting concept is usually a ''program''). A finite automaton uses only a small fixed amount of memory, operates in time proportional to the length of the input, and always reaches a decision, while a Turing machine may use an infinite amount of memory and time and may fail to reach a decision (may never stop).&lt;br /&gt;
&lt;br /&gt;
In the linguistic literature, [nothing] is often represented by the symbol '''ε'''.&lt;br /&gt;
&lt;br /&gt;
The descriptions of the various Chomsky levels which follows are presented in reverse order, so as to work up from a simple case to a rather complicated case.&lt;br /&gt;
&lt;br /&gt;
===Level 3: regular grammar===&lt;br /&gt;
The transformation rules for regular grammars are required to be very simple. &lt;br /&gt;
*Only a single non-terminal item can appear on the left-hand side of a rule.&lt;br /&gt;
*The right-hand side of any rule must be one of:&lt;br /&gt;
**[nothing].&lt;br /&gt;
**a terminal item.&lt;br /&gt;
**a terminal item followed by a non-terminal item.&lt;br /&gt;
Note that instead of a terminal item we could have a non-terminal item whose transformation rule immediately resolves to a single terminal item, or to one of several terminal items.&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
Informally we can define a 'word' as a sequence of one or more ''Letter''s. The following regular grammar provides a more formal definition; for simplicity it is restricted to lower-case letters.&lt;br /&gt;
&lt;br /&gt;
 ''Word''     -&amp;gt; ''Letter'' ''PartWord''&lt;br /&gt;
 ''PartWord'' -&amp;gt; [nothing]&lt;br /&gt;
 ''PartWord'' -&amp;gt; ''Letter'' ''PartWord''&lt;br /&gt;
 ''Letter''   -&amp;gt; '''a''', '''b''', ... '''z'''&lt;br /&gt;
&lt;br /&gt;
Note that ''PartWord'' is recursively defined, with the recursion stopping if it is transformed into [nothing].&lt;br /&gt;
&lt;br /&gt;
For one-letter words we expand as: &lt;br /&gt;
:''Word'' -&amp;gt; ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' [nothing] -&amp;gt; ''Letter''&lt;br /&gt;
&lt;br /&gt;
For two-letter words we expand as: &lt;br /&gt;
:''Word'' -&amp;gt; ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' ''Letter'' [nothing] -&amp;gt;  ''Letter'' ''Letter''&lt;br /&gt;
&lt;br /&gt;
Obviously, words of any length can be constructed, though they may well not actually be words from any language. &lt;br /&gt;
&lt;br /&gt;
====Discussion====&lt;br /&gt;
Trying to devise transformation rules to produce words which are more English-like is much more difficult - how do you insist on at least one vowel or on no more than 5 consecutive consonants (e.g. as in 'strengths').&lt;br /&gt;
&lt;br /&gt;
Further examples in [[Regular grammar]] show how numbers can be defined via a regular grammar, and also show how a hyphenated word could be defined.&lt;br /&gt;
&lt;br /&gt;
One of the limitations of a regular grammar is that it can't cope with nested matching brackets, so that it is impossible to write a regular grammar to describe an expression such as '''2 * (3+4)''' where that grammar is expected to allow brackets nested to any depth. A context-free grammar is needed for this, as described in the next section.&lt;br /&gt;
&lt;br /&gt;
Regular grammars or equivalent are widely used by [[compiler]]s in the lexical analysis of programming languages.&lt;br /&gt;
&lt;br /&gt;
===Level 2: context-free grammar===&lt;br /&gt;
The transformation rules for context-free grammars don't appear that much different from those for regular grammars. &lt;br /&gt;
*Only a single non-terminal item can appear on the left-hand side of a rule.&lt;br /&gt;
*The right-hand side of any rule must be one of:&lt;br /&gt;
**[nothing].&lt;br /&gt;
**any combination of terminal items and non-terminal items.&lt;br /&gt;
&lt;br /&gt;
The key difference is that in a regular grammar, any non-empty rule must effectively start with terminal item so that every rule transformation makes some immediate progress, while in a context-free grammar a rule could start with a non-terminal item which itself could be subject to arbitrary further transformations.&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
The following example shows how context-free grammars can cope with arithmetic expressions involving possibly nested brackets. Also an expression such as &amp;quot;2 + 3 * 4&amp;quot; could be interpreted as either &amp;quot;(2 + 3) * 4&amp;quot; or as &amp;quot;2 + (3 * 4)&amp;quot;. The latter interpretation is that which is normally used - multiplication &amp;quot;*&amp;quot; is said to have a higher priority than addition &amp;quot;+&amp;quot; - so the example also needs to incorporate this priority concept into the grammar. Furthermore, consecutive operators of the same priority are applied from left to right, so that &amp;quot;8 - 2 + 3&amp;quot; is normally interpreted as &amp;quot;(8 - 2) + 3&amp;quot; = 9, rather than as &amp;quot;8 - (2 + 3)&amp;quot; = 3.  This ordering must also be built in to the grammar.&lt;br /&gt;
&lt;br /&gt;
To avoid distracting side-issues, this example only deals with numbers which consist solely of a single digit. The example is a simplified version of the definition of an arithmetic expression given in the Revised Algol 60 Report (Section 3.3.1).&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.masswerk.at/algol60/report.htm&lt;br /&gt;
| title = Revised Report on the Algorithmic Language Algol 60&lt;br /&gt;
| accessdate = 2012-04-22&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ''Expression'' -&amp;gt; ''Term''                        # an ''Expression'' is either a ''Term''&lt;br /&gt;
 ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''    #   or an ''Expression'' followed by '''+''' or '''-''' followed by a ''Term''&lt;br /&gt;
 ''Term''       -&amp;gt; ''Primary''                     # a ''Term'' is either a ''Primary''&lt;br /&gt;
 ''Term''       -&amp;gt; ''Term'' ''MulDivOp'' ''Primary''       #   or a ''Term'' followed by '''*''' or '''/''' followed by a ''Primary''&lt;br /&gt;
                                           #&lt;br /&gt;
 ''Primary''    -&amp;gt; ''Number''                      # a ''Primary'' is either a ''Number''&lt;br /&gt;
 ''Primary''    -&amp;gt; '''(''' ''Expression'' ''')'''              #   or an ''Expression'' enclosed in brackets&lt;br /&gt;
                                           #&lt;br /&gt;
 ''MulDivOp''   -&amp;gt; '''*'''. '''/'''                        # multiplication and division have the same priority&lt;br /&gt;
 ''AddSubOp''   -&amp;gt; '''+'''. '''-'''                        # addition and subtraction have the same priority&lt;br /&gt;
 ''Number''     -&amp;gt; '''0''', '''1''', ... '''9'''                 # this simple-minded definition of a ''Number'' is enough for this example&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
* Both ''Expression'' and ''Term'' are each defined via a left-recursive rule; this ensures that operators of the same priority are applied from left to right.&lt;br /&gt;
* The distinction between ''Expression'' and ''Term'' ensures that multiplication/division are applied before addition/subtraction.&lt;br /&gt;
* ''Expression'' is indirectly recursive via ''Term'' and ''Primary'' to allow bracketed sub-expressions to any depth.&lt;br /&gt;
&lt;br /&gt;
Example 1: generate 2 + 3 * 4&lt;br /&gt;
&lt;br /&gt;
  ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Term'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Primary'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' ''Term''                                 # '''+''' can not be applied until ''Term'' has been evaluated&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' ''Term'' ''MulDivOp'' ''Primary''&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' ''Primary'' ''MulDipOp'' ''Primary''&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' '''3''' '''*''' '''4'''&lt;br /&gt;
&lt;br /&gt;
Example 2: generate 2 * 3 + 4&lt;br /&gt;
&lt;br /&gt;
  ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Term'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Term'' ''MulDivOp'' ''Primary'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Primary'' ''MulDivOp'' ''Primary'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; '''2''' '''*''' '''3''' ''AddSubOp'' ''Term''                      # ''Term'' to left of ''AddSubOp'' is evaluated first&lt;br /&gt;
             -&amp;gt; '''2''' '''*''' '''3''' ''AddSubOp'' ''Primary''  &lt;br /&gt;
             -&amp;gt; '''2''' '''*''' '''3''' '''+''' '''4'''&lt;br /&gt;
&lt;br /&gt;
===Level 1===&lt;br /&gt;
&lt;br /&gt;
===Level 0===&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[category:linguistics]]&lt;br /&gt;
[[Category:Computer Science]]&lt;/div&gt;</summary>
		<author><name>RolandPlankton</name></author>
	</entry>
	<entry>
		<id>https://www.conservapedia.com/index.php?title=Chomsky_hierarchy&amp;diff=977975</id>
		<title>Chomsky hierarchy</title>
		<link rel="alternate" type="text/html" href="https://www.conservapedia.com/index.php?title=Chomsky_hierarchy&amp;diff=977975"/>
		<updated>2012-04-25T22:33:47Z</updated>

		<summary type="html">&lt;p&gt;RolandPlankton: shift mention of Backus Naur Form in to the lead&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The '''Chomsky hierarchy''', sometimes known as the '''Chomsky-Schützenberger hierarchy''', is a hierarchy of formal grammatical systems for describing various classes of languages; the hierarchy can apply to both human and computer languages. This hierarchy was first published in 1956 by [[Noam Chomsky|Chomsky]].&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite journal &lt;br /&gt;
| title = Three models for the description of language &lt;br /&gt;
| year = 1956 &lt;br /&gt;
| last = Chomsky &lt;br /&gt;
| first = Noam &lt;br /&gt;
| journal = IRE Transactions on Information Theory &lt;br /&gt;
| volume = 2 &lt;br /&gt;
| pages = 113–124 &lt;br /&gt;
| url = http://www.chomsky.info/articles/195609--.pdf &lt;br /&gt;
| accessdate = 2012-04-08&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
These grammatical systems were referred to by Chomsky as ''transformational grammars''.  Other linguists have since developed a variety of similar grammars; together these are known as ''generative grammars''. &lt;br /&gt;
&lt;br /&gt;
The basic idea of a '''generative grammar''' is to provide a set of rules which are capable of generating all possible grammatical sentences in some language; the rules must constrain the generation so that only grammatical sentences are generated. The rules can also be used in reverse to parse a sentence and check if it is grammatical.&lt;br /&gt;
&lt;br /&gt;
In the late 1950's, [[John Backus]] and Peter Naur developed a notation for describing [[programming language]]s. This notation is known as [[Backus Naur Form]] (or BNF) and turns out to be equivalent to Chomsky's grammar number two (context-free grammar), although it was developed independently of Chomsky's work. Backus-Naur Form was first used in the Algol 60 Report to specify the syntax of [[Algol 60]], and has since been used for specifying the syntax of other programming languages. &lt;br /&gt;
&lt;br /&gt;
==Example of a very simple generative grammar==&lt;br /&gt;
This very simple example can handle only a tiny subset of English and should not be taken seriously as a guide to English grammar or vocabulary. It is based on an example by David Crystal&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite book &lt;br /&gt;
| last = Crystal &lt;br /&gt;
| first = David  &lt;br /&gt;
| title = The Cambridge Encyclopedia of Language &lt;br /&gt;
| publisher = Cambridge University Press &lt;br /&gt;
| year = 1987 &lt;br /&gt;
| isbn = 0-521-42443-7&lt;br /&gt;
| pages = page 97&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; and is a slight extension of an example on slide 9 of this lecture.&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.cs.princeton.edu/~rywang/99f126/slides/16th.pdf&lt;br /&gt;
| title = Lecture notes: Formal Languages&lt;br /&gt;
| accessdate = 2012-04-07}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase''         # A ''Sentence'' consists of a ''NounPhrase'' followed by a ''VerbPhrase''&lt;br /&gt;
 ''NounPhrase'' -&amp;gt;  ''Determiner'' ''Noun''               # A ''NounPhrase'' consists of a ''Determiner'' followed by a ''Noun''&lt;br /&gt;
 ''VerbPhrase'' -&amp;gt;  ''Verb'' ''NounPhrase''               # A ''VerbPhrase'' consists of a ''Verb'' followed by a ''NounPhrase''&lt;br /&gt;
 ''Determiner'' -&amp;gt;  '''a''', '''the'''                        # A ''Determiner''  is one of: '''a''' or '''the'''&lt;br /&gt;
 ''Noun''       -&amp;gt;  '''boy''', '''girl''', '''dog'''                # A ''Noun'' is one of: '''boy''' or '''girl''' or '''dog'''  &lt;br /&gt;
 ''Verb''       -&amp;gt;  '''chased''', '''heard''', '''saw'''            # A ''Verb'' is one of: '''chased''' or '''heard''' or '''saw'''&lt;br /&gt;
&lt;br /&gt;
Notation used above: &lt;br /&gt;
:The symbol &amp;quot;-&amp;gt;&amp;quot; means &amp;quot;can be replaced by&amp;quot;.  &lt;br /&gt;
:When there are several items on the right hand side separated by commas, just one of these items can be selected. &lt;br /&gt;
:The comments preceded by &amp;quot;#&amp;quot; are not part of the generative grammar, but hopefully will help folks understand the example a little better.&lt;br /&gt;
&lt;br /&gt;
By making appropriate substitutions we can generate such sentences as:&lt;br /&gt;
:The dog chased a girl.&lt;br /&gt;
:The girl heard the dog.&lt;br /&gt;
:The boy saw a girl.&lt;br /&gt;
&lt;br /&gt;
The stages in the generation of these examples are as follows:&lt;br /&gt;
:''Sentence''&lt;br /&gt;
:-&amp;gt; ''NounPhrase'' ''VerbPhrase''&lt;br /&gt;
:-&amp;gt; ''Determiner'' ''Noun'' ''Verb'' ''NounPhrase''&lt;br /&gt;
:-&amp;gt; ''Determiner'' ''Noun'' ''Verb'' ''Determiner'' ''Noun''&lt;br /&gt;
&lt;br /&gt;
By appropriate selection of words to substitute for ''Determiner'', ''Noun'', and ''Verb'' we can produce the 3 example sentences above.&lt;br /&gt;
&lt;br /&gt;
The simple grammar defines a few words which can be substituted for ''Determiner'', ''Noun'', and ''Verb''. There are two possibilities for ''Determiner'', three for ''Noun'', and three for ''Verb'', with both ''Determiner'' and ''Noun'' appearing twice in the expansion. Hence the total number of grammatical sentences which can be generated by this simple grammar is 108 (= 2 * 3 * 3 * 2 * 3). In this particular case the possible words have been carefully chosen so that all of these 108 sentences also actually mean something.&lt;br /&gt;
&lt;br /&gt;
Note that the use of ''italics'' and '''boldface''' in this example is merely a convenient way of indicating the difference between items which can be expanded further (e.g. concepts such as ''NounPhrase'') and items which can not be expanded further (e.g. words such as '''girl'''). In the linguistic literature, items which can be expanded further are referred to as 'non-terminal' items, while items which can't be expanded further are known as 'terminal' items.&lt;br /&gt;
&lt;br /&gt;
The 'comma' notation for alternatives is a form of shorthand. In some formulations this would be shown as several separate rules, so that:&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''a''', '''the''' &lt;br /&gt;
could be shown as two rules:&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''a'''&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''the''' &lt;br /&gt;
&lt;br /&gt;
==Caution==&lt;br /&gt;
While a generative grammar may produce sentences which are grammatically correct, there is no certainty that such sentences will actually mean anything. The classic example of such a meaningless sentence is from Chomsky's book&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite book &lt;br /&gt;
| last = Chomsky &lt;br /&gt;
| first = Noam &lt;br /&gt;
| title = Syntactic Structures &lt;br /&gt;
| year = 1957 &lt;br /&gt;
| publisher = Mouton &lt;br /&gt;
| location = The Hague/Paris &lt;br /&gt;
| pages = page 15 &lt;br /&gt;
| isbn = 3-11-017279-8&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; with the grammatically correct sentence:&lt;br /&gt;
&lt;br /&gt;
:&amp;quot;Colorless green ideas sleep furiously.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
:This example illustrates the difference between grammar/syntax and meaning/semantics.&lt;br /&gt;
&lt;br /&gt;
Another problem when analysing a sentence is that many English words have multiple meanings, so that there may be more than one way to interpret a sentence. A simple example is the sentence: &lt;br /&gt;
:&amp;quot;Time flies.&amp;quot; &lt;br /&gt;
:Is this an instruction to check how fast flies are flying, or an indication that time appears to be passing quickly? &lt;br /&gt;
:A varied and entertaining selection of such ambiguities has been compiled by Jeff Gray.&amp;lt;ref&amp;gt;{{Cite web &lt;br /&gt;
| title = Collection of Ambiguous or Inconsistent/Incomplete Statements  &lt;br /&gt;
| url = http://www.gray-area.org/Research/Ambig/ &lt;br /&gt;
| author = Jeff Gray&lt;br /&gt;
| accessdate = 2012-04-10&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Formal grammar==&lt;br /&gt;
'''Note''': this section and subsequent sections are, by necessity, slightly more technical/formal than the earlier parts of this article, though specialist notation has been largely avoided. Make sure that you understand the 'Simple example' above before proceeding further, since references will be made to that example to help explain the technicalities, and variations on that example will be used to illustrate new ideas. An attempt has been made to avoid formal linguistic abbreviations and unexplained jargon.&lt;br /&gt;
&lt;br /&gt;
A formal generative grammar has four components (see slide 19 of this lecture&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://adammikeal.org/courses/compute/Chomsky%20Presentation.pdf&lt;br /&gt;
| title = The Chomsky Hierarchy&lt;br /&gt;
| accessdate = 2012-04-06&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
):&lt;br /&gt;
# a finite number of non-terminal concepts (e.g. ''VerbPhrase'' in the example, or anything else in ''italics''),&lt;br /&gt;
# a finite number of terminal items (e.g. '''girl''' in the example, or anything else in '''bold-face''').&lt;br /&gt;
# a finite set of rules for transforming non-terminal items (e.g. the example has 6 rules).&lt;br /&gt;
# a single starting point (e.g. ''Sentence'' in the example).&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
:Any item which appears on the left-hand side of a transformation rule is non-terminal since it can be replaced by something else; apart from the starting point, all other non-terminals must also appear somewhere on the right-hand side of transformation rule.&lt;br /&gt;
:An item which appears only on the right-hand side of a transformation rule is a terminal item, since it can not be transformed further.&lt;br /&gt;
:A list of all the terminal items is effectively the vocabulary from which sentences are built.&lt;br /&gt;
:Linguists have developed various classes of grammars by using constraints to govern what sort of rules can be used for any particular grammar.&lt;br /&gt;
&lt;br /&gt;
===Changing the rules===&lt;br /&gt;
An relatively small change to even a single rule can make a large change in the language which can be generated. For example, change the first rule in the simple example to read:&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''NounPhrase'' ''VerbPhrase'' '''and''' ''NounPhrase'' ''VerbPhrase''&lt;br /&gt;
This means that a ''Sentence'' is either a ''NounPhrase'' followed by a ''VerbPhrase'' or a ''NounPhrase'' followed by a ''VerbPhrase'' followed by '''and''' followed by a ''NounPhrase'' followed by a ''VerbPhrase''. In addition to the shorter sentences already discussed, this could also generate a sentence such as: &amp;quot;A dog saw a girl and the dog chased the girl&amp;quot;. The total number of grammatically-correct sentences which can be generated by this modified grammar is now 11,772 (108 + 108*108), though some of these may not be very meaingful.&lt;br /&gt;
&lt;br /&gt;
===Towards infinity===&lt;br /&gt;
A significantly different rule change can have an astounding effect. Consider changing the first rule to read:&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''NounPhrase'' ''VerbPhrase'' '''and''' ''Sentence''&lt;br /&gt;
This can generate a potentially infinite number of sentences (any number of these five-word sentences linked by '''and'''). This is an example of what is known as a [[Recursion|recursive]] definition, whereby a ''Sentence'' is partially defined in terms of itself. In such a recursive rule there must be at least one transformation option which does not involve ''Sentence'', otherwise the transformation could never stop.&lt;br /&gt;
&lt;br /&gt;
The above change is known as right-recursive; a left-recursive formulation is also possible, and can in this example generate exactly the same sentences.&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''Sentence'' '''and''' ''NounPhrase'' ''VerbPhrase'' &lt;br /&gt;
&lt;br /&gt;
The distinction between left- and right-recursive grammars becomes important when trying to parse/analyse a sentence; some types of parser work best with left-recursive grammars, while other types work best with right-recursive grammars. This distinction is particularly relevant in connection with [[compiler|compiling or translating]] a program written in some high-level [[programming language]] so that it can be used on a [[computer]].&lt;br /&gt;
&lt;br /&gt;
==Chomsky hierarchy==&lt;br /&gt;
By imposing different constraints&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.cs.uaf.edu/2011/spring/cs331/lectures/cs331_20110124_grammar.html&lt;br /&gt;
| title = Lecture notes: Languages &amp;amp; Grammars&lt;br /&gt;
| accessdate = 2012-04-07&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; &lt;br /&gt;
as to what sort of transformation rules could be used, Chomsky was able to define four strictly nested transformational grammars, which he numbered from 0 to 3. As the grammar number increases, the generated language becomes simpler. As the grammar number decreases, parsing a sentence in that language becomes more difficult. The following table provides a summary, which is then explained further in the subsequent subsections.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!| Chomsky&amp;lt;br&amp;gt;number || linguistic name || Rule constraints || Recogniser+ || Notes &lt;br /&gt;
|-&lt;br /&gt;
| 0 || recursively enumerable || [anything] -&amp;gt; [anything] || Turing machine || most human languages &lt;br /&gt;
|-&lt;br /&gt;
| 1 || context-sensitive || X ''A'' Y -&amp;gt; X [anything] Y || linear bounded automaton || X and Y provide the context in which ''A'' can be transformed &lt;br /&gt;
|-&lt;br /&gt;
| 2 || context-free || ''A'' -&amp;gt; [anything] || non-deterministic push-down automaton || syntax analysis for most programming languages &lt;br /&gt;
|-&lt;br /&gt;
| 3 || regular || ''A'' -&amp;gt; [nothing]&amp;lt;br&amp;gt;''A'' -&amp;gt; '''xyz'''&amp;lt;br&amp;gt;''A'' -&amp;gt; '''xyz''' ''B'' || finite automaton&amp;lt;br&amp;gt;or finite state machine || lexical analysis (combining characters into words/tokens)  &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''+''' The '''recogniser''' column indicates the type of mathematical or computer science theoretical model needed to recognise that a sentence belongs to a language, essentially by applying the transformation rules in reverse to work backwards from the actual words in order to finish up with a ''sentence'' (in programming languages the starting concept is usually a ''program''). A finite automaton uses only a small fixed amount of memory, operates in time proportional to the length of the input, and always reaches a decision, while a Turing machine may use an infinite amount of memory and time and may fail to reach a decision (may never stop).&lt;br /&gt;
&lt;br /&gt;
In the linguistic literature, [nothing] is often represented by the symbol '''ε'''.&lt;br /&gt;
&lt;br /&gt;
The descriptions of the various Chomsky levels which follows are presented in reverse order, so as to work up from a simple case to a rather complicated case.&lt;br /&gt;
&lt;br /&gt;
===Level 3: regular grammar===&lt;br /&gt;
The transformation rules for regular grammars are required to be very simple. &lt;br /&gt;
*Only a single non-terminal item can appear on the left-hand side of a rule.&lt;br /&gt;
*The right-hand side of any rule must be one of:&lt;br /&gt;
**[nothing].&lt;br /&gt;
**a terminal item.&lt;br /&gt;
**a terminal item followed by a non-terminal item.&lt;br /&gt;
Note that instead of a terminal item we could have a non-terminal item whose transformation rule immediately resolves to a single terminal item, or to one of several terminal items.&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
Informally we can define a 'word' as a sequence of one or more ''Letter''s. The following regular grammar provides a more formal definition; for simplicity it is restricted to lower-case letters.&lt;br /&gt;
&lt;br /&gt;
 ''Word''     -&amp;gt; ''Letter'' ''PartWord''&lt;br /&gt;
 ''PartWord'' -&amp;gt; [nothing]&lt;br /&gt;
 ''PartWord'' -&amp;gt; ''Letter'' ''PartWord''&lt;br /&gt;
 ''Letter''   -&amp;gt; '''a''', '''b''', ... '''z'''&lt;br /&gt;
&lt;br /&gt;
Note that ''PartWord'' is recursively defined, with the recursion stopping if it is transformed into [nothing].&lt;br /&gt;
&lt;br /&gt;
For one-letter words we expand as: &lt;br /&gt;
:''Word'' -&amp;gt; ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' [nothing] -&amp;gt; ''Letter''&lt;br /&gt;
&lt;br /&gt;
For two-letter words we expand as: &lt;br /&gt;
:''Word'' -&amp;gt; ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' ''Letter'' [nothing] -&amp;gt;  ''Letter'' ''Letter''&lt;br /&gt;
&lt;br /&gt;
Obviously, words of any length can be constructed, though they may well not actually be words from any language. &lt;br /&gt;
&lt;br /&gt;
====Discussion====&lt;br /&gt;
Trying to devise transformation rules to produce words which are more English-like is much more difficult - how do you insist on at least one vowel or on no more than 5 consecutive consonants (e.g. as in 'strengths').&lt;br /&gt;
&lt;br /&gt;
Further examples in [[Regular grammar]] show how numbers can be defined via a regular grammar, and also show how a hyphenated word could be defined.&lt;br /&gt;
&lt;br /&gt;
One of the limitations of a regular grammar is that it can't cope with nested matching brackets, so that it is impossible to write a regular grammar to describe an expression such as '''2 * (3+4)''' where that grammar is expected to allow brackets nested to any depth. A context-free grammar is needed for this, as described in the next section.&lt;br /&gt;
&lt;br /&gt;
Regular grammars or equivalent are widely used by [[compiler]]s in the lexical analysis of programming languages.&lt;br /&gt;
&lt;br /&gt;
===Level 2: context-free grammar===&lt;br /&gt;
The transformation rules for context-free grammars don't appear that much different from those for regular grammars. &lt;br /&gt;
*Only a single non-terminal item can appear on the left-hand side of a rule.&lt;br /&gt;
*The right-hand side of any rule must be one of:&lt;br /&gt;
**[nothing].&lt;br /&gt;
**any combination of terminal items and non-terminal items.&lt;br /&gt;
&lt;br /&gt;
The key difference is that in a regular grammar, any non-empty rule must effectively start with terminal item so that every rule transformation makes some immediate progress, while in a context-free grammar a rule could start with a non-terminal item which itself could be subject to arbitrary further transformations.&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
The following example shows how context-free grammars can cope with arithmetic expressions involving possibly nested brackets. Also an expression such as &amp;quot;2 + 3 * 4&amp;quot; could be interpreted as either &amp;quot;(2 + 3) * 4&amp;quot; or as &amp;quot;2 + (3 * 4)&amp;quot;. The latter interpretation is that which is normally used - multiplication &amp;quot;*&amp;quot; is said to have a higher priority than addition &amp;quot;+&amp;quot; - so the example also needs to incorporate this priority concept into the grammar. Furthermore, consecutive operators of the same priority are applied from left to right, so that &amp;quot;8 - 2 + 3&amp;quot; is normally interpreted as &amp;quot;(8 - 2) + 3&amp;quot; = 9, rather than as &amp;quot;8 - (2 + 3)&amp;quot; = 3.  This ordering must also be built in to the grammar.&lt;br /&gt;
&lt;br /&gt;
To avoid distracting side-issues, this example only deals with numbers which consist solely of a single digit. The example is a simplified version of the definition of an arithmetic expression given in the Revised Algol 60 Report (Section 3.3.1).&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.masswerk.at/algol60/report.htm&lt;br /&gt;
| title = Revised Report on the Algorithmic Language Algol 60&lt;br /&gt;
| accessdate = 2012-04-22&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ''Expression'' -&amp;gt; ''Term''                        # an ''Expression'' is either a ''Term''&lt;br /&gt;
 ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''    #   or an ''Expression'' followed by '''+''' or '''-''' followed by a ''Term''&lt;br /&gt;
 ''Term''       -&amp;gt; ''Primary''                     # a ''Term'' is either a ''Primary''&lt;br /&gt;
 ''Term''       -&amp;gt; ''Term'' ''MulDivOp'' ''Primary''       #   or a ''Term'' followed by '''*''' or '''/''' followed by a ''Primary''&lt;br /&gt;
                                           #&lt;br /&gt;
 ''Primary''    -&amp;gt; ''Number''                      # a ''Primary'' is either a ''Number''&lt;br /&gt;
 ''Primary''    -&amp;gt; '''(''' ''Expression'' ''')'''              #   or an ''Expression'' enclosed in brackets&lt;br /&gt;
                                           #&lt;br /&gt;
 ''MulDivOp''   -&amp;gt; '''*'''. '''/'''                        # multiplication and division have the same priority&lt;br /&gt;
 ''AddSubOp''   -&amp;gt; '''+'''. '''-'''                        # addition and subtraction have the same priority&lt;br /&gt;
 ''Number''     -&amp;gt; '''0''', '''1''', ... '''9'''                 # this simple-minded definition of a ''Number'' is enough for this example&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
* Both ''Expression'' and ''Term'' are each defined via a left-recursive rule; this ensures that operators of the same priority are applied from left to right.&lt;br /&gt;
* The distinction between ''Expression'' and ''Term'' ensures that multiplication/division are applied before addition/subtraction.&lt;br /&gt;
* ''Expression'' is indirectly recursive via ''Term'' and ''Primary'' to allow bracketed sub-expressions to any depth.&lt;br /&gt;
&lt;br /&gt;
Example 1: generate 2 + 3 * 4&lt;br /&gt;
&lt;br /&gt;
  ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Term'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Primary'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' ''Term''                                 # '''+''' can not be applied until ''Term'' has been evaluated&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' ''Term'' ''MulDivOp'' ''Primary''&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' ''Primary'' ''MulDipOp'' ''Primary''&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' '''3''' '''*''' '''4'''&lt;br /&gt;
&lt;br /&gt;
Example 2: generate 2 * 3 + 4&lt;br /&gt;
&lt;br /&gt;
  ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Term'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Term'' ''MulDivOp'' ''Primary'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Primary'' ''MulDivOp'' ''Primary'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; '''2''' '''*''' '''3''' ''AddSubOp'' ''Term''                      # ''Term'' to left of ''AddSubOp'' is evaluated first&lt;br /&gt;
             -&amp;gt; '''2''' '''*''' '''3''' ''AddSubOp'' ''Primary''  &lt;br /&gt;
             -&amp;gt; '''2''' '''*''' '''3''' '''+''' '''4'''&lt;br /&gt;
&lt;br /&gt;
===Level 1===&lt;br /&gt;
&lt;br /&gt;
===Level 0===&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[category:linguistics]]&lt;br /&gt;
[[Category:Computer Science]]&lt;/div&gt;</summary>
		<author><name>RolandPlankton</name></author>
	</entry>
	<entry>
		<id>https://www.conservapedia.com/index.php?title=Chomsky_hierarchy&amp;diff=977974</id>
		<title>Chomsky hierarchy</title>
		<link rel="alternate" type="text/html" href="https://www.conservapedia.com/index.php?title=Chomsky_hierarchy&amp;diff=977974"/>
		<updated>2012-04-25T22:26:57Z</updated>

		<summary type="html">&lt;p&gt;RolandPlankton: /* Example */ add notes and examples&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The '''Chomsky hierarchy''', sometimes known as the '''Chomsky-Schützenberger hierarchy''', is a hierarchy of formal grammatical systems for describing various classes of languages; the hierarchy can apply to both human and computer languages. This hierarchy was first published in 1956 by [[Noam Chomsky|Chomsky]].&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite journal &lt;br /&gt;
| title = Three models for the description of language &lt;br /&gt;
| year = 1956 &lt;br /&gt;
| last = Chomsky &lt;br /&gt;
| first = Noam &lt;br /&gt;
| journal = IRE Transactions on Information Theory &lt;br /&gt;
| volume = 2 &lt;br /&gt;
| pages = 113–124 &lt;br /&gt;
| url = http://www.chomsky.info/articles/195609--.pdf &lt;br /&gt;
| accessdate = 2012-04-08&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
These grammatical systems were referred to by Chomsky as ''transformational grammars''.  Other linguists have since developed a variety of similar grammars; together these are known as ''generative grammars''. &lt;br /&gt;
&lt;br /&gt;
The basic idea of a '''generative grammar''' is to provide a set of rules which are capable of generating all possible grammatical sentences in some language; the rules must constrain the generation so that only grammatical sentences are generated. The rules can also be used in reverse to parse a sentence and check if it is grammatical.&lt;br /&gt;
&lt;br /&gt;
==Example of a very simple generative grammar==&lt;br /&gt;
This very simple example can handle only a tiny subset of English and should not be taken seriously as a guide to English grammar or vocabulary. It is based on an example by David Crystal&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite book &lt;br /&gt;
| last = Crystal &lt;br /&gt;
| first = David  &lt;br /&gt;
| title = The Cambridge Encyclopedia of Language &lt;br /&gt;
| publisher = Cambridge University Press &lt;br /&gt;
| year = 1987 &lt;br /&gt;
| isbn = 0-521-42443-7&lt;br /&gt;
| pages = page 97&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; and is a slight extension of an example on slide 9 of this lecture.&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.cs.princeton.edu/~rywang/99f126/slides/16th.pdf&lt;br /&gt;
| title = Lecture notes: Formal Languages&lt;br /&gt;
| accessdate = 2012-04-07}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase''         # A ''Sentence'' consists of a ''NounPhrase'' followed by a ''VerbPhrase''&lt;br /&gt;
 ''NounPhrase'' -&amp;gt;  ''Determiner'' ''Noun''               # A ''NounPhrase'' consists of a ''Determiner'' followed by a ''Noun''&lt;br /&gt;
 ''VerbPhrase'' -&amp;gt;  ''Verb'' ''NounPhrase''               # A ''VerbPhrase'' consists of a ''Verb'' followed by a ''NounPhrase''&lt;br /&gt;
 ''Determiner'' -&amp;gt;  '''a''', '''the'''                        # A ''Determiner''  is one of: '''a''' or '''the'''&lt;br /&gt;
 ''Noun''       -&amp;gt;  '''boy''', '''girl''', '''dog'''                # A ''Noun'' is one of: '''boy''' or '''girl''' or '''dog'''  &lt;br /&gt;
 ''Verb''       -&amp;gt;  '''chased''', '''heard''', '''saw'''            # A ''Verb'' is one of: '''chased''' or '''heard''' or '''saw'''&lt;br /&gt;
&lt;br /&gt;
Notation used above: &lt;br /&gt;
:The symbol &amp;quot;-&amp;gt;&amp;quot; means &amp;quot;can be replaced by&amp;quot;.  &lt;br /&gt;
:When there are several items on the right hand side separated by commas, just one of these items can be selected. &lt;br /&gt;
:The comments preceded by &amp;quot;#&amp;quot; are not part of the generative grammar, but hopefully will help folks understand the example a little better.&lt;br /&gt;
&lt;br /&gt;
By making appropriate substitutions we can generate such sentences as:&lt;br /&gt;
:The dog chased a girl.&lt;br /&gt;
:The girl heard the dog.&lt;br /&gt;
:The boy saw a girl.&lt;br /&gt;
&lt;br /&gt;
The stages in the generation of these examples are as follows:&lt;br /&gt;
:''Sentence''&lt;br /&gt;
:-&amp;gt; ''NounPhrase'' ''VerbPhrase''&lt;br /&gt;
:-&amp;gt; ''Determiner'' ''Noun'' ''Verb'' ''NounPhrase''&lt;br /&gt;
:-&amp;gt; ''Determiner'' ''Noun'' ''Verb'' ''Determiner'' ''Noun''&lt;br /&gt;
&lt;br /&gt;
By appropriate selection of words to substitute for ''Determiner'', ''Noun'', and ''Verb'' we can produce the 3 example sentences above.&lt;br /&gt;
&lt;br /&gt;
The simple grammar defines a few words which can be substituted for ''Determiner'', ''Noun'', and ''Verb''. There are two possibilities for ''Determiner'', three for ''Noun'', and three for ''Verb'', with both ''Determiner'' and ''Noun'' appearing twice in the expansion. Hence the total number of grammatical sentences which can be generated by this simple grammar is 108 (= 2 * 3 * 3 * 2 * 3). In this particular case the possible words have been carefully chosen so that all of these 108 sentences also actually mean something.&lt;br /&gt;
&lt;br /&gt;
Note that the use of ''italics'' and '''boldface''' in this example is merely a convenient way of indicating the difference between items which can be expanded further (e.g. concepts such as ''NounPhrase'') and items which can not be expanded further (e.g. words such as '''girl'''). In the linguistic literature, items which can be expanded further are referred to as 'non-terminal' items, while items which can't be expanded further are known as 'terminal' items.&lt;br /&gt;
&lt;br /&gt;
The 'comma' notation for alternatives is a form of shorthand. In some formulations this would be shown as several separate rules, so that:&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''a''', '''the''' &lt;br /&gt;
could be shown as two rules:&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''a'''&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''the''' &lt;br /&gt;
&lt;br /&gt;
==Caution==&lt;br /&gt;
While a generative grammar may produce sentences which are grammatically correct, there is no certainty that such sentences will actually mean anything. The classic example of such a meaningless sentence is from Chomsky's book&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite book &lt;br /&gt;
| last = Chomsky &lt;br /&gt;
| first = Noam &lt;br /&gt;
| title = Syntactic Structures &lt;br /&gt;
| year = 1957 &lt;br /&gt;
| publisher = Mouton &lt;br /&gt;
| location = The Hague/Paris &lt;br /&gt;
| pages = page 15 &lt;br /&gt;
| isbn = 3-11-017279-8&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; with the grammatically correct sentence:&lt;br /&gt;
&lt;br /&gt;
:&amp;quot;Colorless green ideas sleep furiously.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
:This example illustrates the difference between grammar/syntax and meaning/semantics.&lt;br /&gt;
&lt;br /&gt;
Another problem when analysing a sentence is that many English words have multiple meanings, so that there may be more than one way to interpret a sentence. A simple example is the sentence: &lt;br /&gt;
:&amp;quot;Time flies.&amp;quot; &lt;br /&gt;
:Is this an instruction to check how fast flies are flying, or an indication that time appears to be passing quickly? &lt;br /&gt;
:A varied and entertaining selection of such ambiguities has been compiled by Jeff Gray.&amp;lt;ref&amp;gt;{{Cite web &lt;br /&gt;
| title = Collection of Ambiguous or Inconsistent/Incomplete Statements  &lt;br /&gt;
| url = http://www.gray-area.org/Research/Ambig/ &lt;br /&gt;
| author = Jeff Gray&lt;br /&gt;
| accessdate = 2012-04-10&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Formal grammar==&lt;br /&gt;
'''Note''': this section and subsequent sections are, by necessity, slightly more technical/formal than the earlier parts of this article, though specialist notation has been largely avoided. Make sure that you understand the 'Simple example' above before proceeding further, since references will be made to that example to help explain the technicalities, and variations on that example will be used to illustrate new ideas. An attempt has been made to avoid formal linguistic abbreviations and unexplained jargon.&lt;br /&gt;
&lt;br /&gt;
A formal generative grammar has four components (see slide 19 of this lecture&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://adammikeal.org/courses/compute/Chomsky%20Presentation.pdf&lt;br /&gt;
| title = The Chomsky Hierarchy&lt;br /&gt;
| accessdate = 2012-04-06&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
):&lt;br /&gt;
# a finite number of non-terminal concepts (e.g. ''VerbPhrase'' in the example, or anything else in ''italics''),&lt;br /&gt;
# a finite number of terminal items (e.g. '''girl''' in the example, or anything else in '''bold-face''').&lt;br /&gt;
# a finite set of rules for transforming non-terminal items (e.g. the example has 6 rules).&lt;br /&gt;
# a single starting point (e.g. ''Sentence'' in the example).&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
:Any item which appears on the left-hand side of a transformation rule is non-terminal since it can be replaced by something else; apart from the starting point, all other non-terminals must also appear somewhere on the right-hand side of transformation rule.&lt;br /&gt;
:An item which appears only on the right-hand side of a transformation rule is a terminal item, since it can not be transformed further.&lt;br /&gt;
:A list of all the terminal items is effectively the vocabulary from which sentences are built.&lt;br /&gt;
:Linguists have developed various classes of grammars by using constraints to govern what sort of rules can be used for any particular grammar.&lt;br /&gt;
&lt;br /&gt;
===Changing the rules===&lt;br /&gt;
An relatively small change to even a single rule can make a large change in the language which can be generated. For example, change the first rule in the simple example to read:&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''NounPhrase'' ''VerbPhrase'' '''and''' ''NounPhrase'' ''VerbPhrase''&lt;br /&gt;
This means that a ''Sentence'' is either a ''NounPhrase'' followed by a ''VerbPhrase'' or a ''NounPhrase'' followed by a ''VerbPhrase'' followed by '''and''' followed by a ''NounPhrase'' followed by a ''VerbPhrase''. In addition to the shorter sentences already discussed, this could also generate a sentence such as: &amp;quot;A dog saw a girl and the dog chased the girl&amp;quot;. The total number of grammatically-correct sentences which can be generated by this modified grammar is now 11,772 (108 + 108*108), though some of these may not be very meaingful.&lt;br /&gt;
&lt;br /&gt;
===Towards infinity===&lt;br /&gt;
A significantly different rule change can have an astounding effect. Consider changing the first rule to read:&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''NounPhrase'' ''VerbPhrase'' '''and''' ''Sentence''&lt;br /&gt;
This can generate a potentially infinite number of sentences (any number of these five-word sentences linked by '''and'''). This is an example of what is known as a [[Recursion|recursive]] definition, whereby a ''Sentence'' is partially defined in terms of itself. In such a recursive rule there must be at least one transformation option which does not involve ''Sentence'', otherwise the transformation could never stop.&lt;br /&gt;
&lt;br /&gt;
The above change is known as right-recursive; a left-recursive formulation is also possible, and can in this example generate exactly the same sentences.&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''Sentence'' '''and''' ''NounPhrase'' ''VerbPhrase'' &lt;br /&gt;
&lt;br /&gt;
The distinction between left- and right-recursive grammars becomes important when trying to parse/analyse a sentence; some types of parser work best with left-recursive grammars, while other types work best with right-recursive grammars. This distinction is particularly relevant in connection with [[compiler|compiling or translating]] a program written in some high-level [[programming language]] so that it can be used on a [[computer]].&lt;br /&gt;
&lt;br /&gt;
==Chomsky hierarchy==&lt;br /&gt;
By imposing different constraints&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.cs.uaf.edu/2011/spring/cs331/lectures/cs331_20110124_grammar.html&lt;br /&gt;
| title = Lecture notes: Languages &amp;amp; Grammars&lt;br /&gt;
| accessdate = 2012-04-07&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; &lt;br /&gt;
as to what sort of transformation rules could be used, Chomsky was able to define four strictly nested transformational grammars, which he numbered from 0 to 3. As the grammar number increases, the generated language becomes simpler. As the grammar number decreases, parsing a sentence in that language becomes more difficult. The following table provides a summary, which is then explained further in the subsequent subsections.&lt;br /&gt;
&lt;br /&gt;
In the late 1950's, [[John Backus]] and Peter Naur developed a notation for describing [[programming language]]s. This notation is known as Backus Naur Form (or BNF) and turns out to be equivalent to Chomsky's grammar number two (context-free grammar), although it was developed independently of Chomsky's work. Backus-Naur Form was first used in the Algol 60 Report to specify the syntax of Algol 60, and has since been used for specifying the syntax of other programming languages. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!| Chomsky&amp;lt;br&amp;gt;number || linguistic name || Rule constraints || Recogniser+ || Notes &lt;br /&gt;
|-&lt;br /&gt;
| 0 || recursively enumerable || [anything] -&amp;gt; [anything] || Turing machine || most human languages &lt;br /&gt;
|-&lt;br /&gt;
| 1 || context-sensitive || X ''A'' Y -&amp;gt; X [anything] Y || linear bounded automaton || X and Y provide the context in which ''A'' can be transformed &lt;br /&gt;
|-&lt;br /&gt;
| 2 || context-free || ''A'' -&amp;gt; [anything] || non-deterministic push-down automaton || syntax analysis for most programming languages &lt;br /&gt;
|-&lt;br /&gt;
| 3 || regular || ''A'' -&amp;gt; [nothing]&amp;lt;br&amp;gt;''A'' -&amp;gt; '''xyz'''&amp;lt;br&amp;gt;''A'' -&amp;gt; '''xyz''' ''B'' || finite automaton&amp;lt;br&amp;gt;or finite state machine || lexical analysis (combining characters into words/tokens)  &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''+''' The '''recogniser''' column indicates the type of mathematical or computer science theoretical model needed to recognise that a sentence belongs to a language, essentially by applying the transformation rules in reverse to work backwards from the actual words in order to finish up with a ''sentence'' (in programming languages the starting concept is usually a ''program''). A finite automaton uses only a small fixed amount of memory, operates in time proportional to the length of the input, and always reaches a decision, while a Turing machine may use an infinite amount of memory and time and may fail to reach a decision (may never stop).&lt;br /&gt;
&lt;br /&gt;
In the linguistic literature, [nothing] is often represented by the symbol '''ε'''.&lt;br /&gt;
&lt;br /&gt;
The descriptions of the various Chomsky levels which follows are presented in reverse order, so as to work up from a simple case to a rather complicated case.&lt;br /&gt;
&lt;br /&gt;
===Level 3: regular grammar===&lt;br /&gt;
The transformation rules for regular grammars are required to be very simple. &lt;br /&gt;
*Only a single non-terminal item can appear on the left-hand side of a rule.&lt;br /&gt;
*The right-hand side of any rule must be one of:&lt;br /&gt;
**[nothing].&lt;br /&gt;
**a terminal item.&lt;br /&gt;
**a terminal item followed by a non-terminal item.&lt;br /&gt;
Note that instead of a terminal item we could have a non-terminal item whose transformation rule immediately resolves to a single terminal item, or to one of several terminal items.&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
Informally we can define a 'word' as a sequence of one or more ''Letter''s. The following regular grammar provides a more formal definition; for simplicity it is restricted to lower-case letters.&lt;br /&gt;
&lt;br /&gt;
 ''Word''     -&amp;gt; ''Letter'' ''PartWord''&lt;br /&gt;
 ''PartWord'' -&amp;gt; [nothing]&lt;br /&gt;
 ''PartWord'' -&amp;gt; ''Letter'' ''PartWord''&lt;br /&gt;
 ''Letter''   -&amp;gt; '''a''', '''b''', ... '''z'''&lt;br /&gt;
&lt;br /&gt;
Note that ''PartWord'' is recursively defined, with the recursion stopping if it is transformed into [nothing].&lt;br /&gt;
&lt;br /&gt;
For one-letter words we expand as: &lt;br /&gt;
:''Word'' -&amp;gt; ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' [nothing] -&amp;gt; ''Letter''&lt;br /&gt;
&lt;br /&gt;
For two-letter words we expand as: &lt;br /&gt;
:''Word'' -&amp;gt; ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' ''Letter'' [nothing] -&amp;gt;  ''Letter'' ''Letter''&lt;br /&gt;
&lt;br /&gt;
Obviously, words of any length can be constructed, though they may well not actually be words from any language. &lt;br /&gt;
&lt;br /&gt;
====Discussion====&lt;br /&gt;
Trying to devise transformation rules to produce words which are more English-like is much more difficult - how do you insist on at least one vowel or on no more than 5 consecutive consonants (e.g. as in 'strengths').&lt;br /&gt;
&lt;br /&gt;
Further examples in [[Regular grammar]] show how numbers can be defined via a regular grammar, and also show how a hyphenated word could be defined.&lt;br /&gt;
&lt;br /&gt;
One of the limitations of a regular grammar is that it can't cope with nested matching brackets, so that it is impossible to write a regular grammar to describe an expression such as '''2 * (3+4)''' where that grammar is expected to allow brackets nested to any depth. A context-free grammar is needed for this, as described in the next section.&lt;br /&gt;
&lt;br /&gt;
Regular grammars or equivalent are widely used by [[compiler]]s in the lexical analysis of programming languages.&lt;br /&gt;
&lt;br /&gt;
===Level 2: context-free grammar===&lt;br /&gt;
The transformation rules for context-free grammars don't appear that much different from those for regular grammars. &lt;br /&gt;
*Only a single non-terminal item can appear on the left-hand side of a rule.&lt;br /&gt;
*The right-hand side of any rule must be one of:&lt;br /&gt;
**[nothing].&lt;br /&gt;
**any combination of terminal items and non-terminal items.&lt;br /&gt;
&lt;br /&gt;
The key difference is that in a regular grammar, any non-empty rule must effectively start with terminal item so that every rule transformation makes some immediate progress, while in a context-free grammar a rule could start with a non-terminal item which itself could be subject to arbitrary further transformations.&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
The following example shows how context-free grammars can cope with arithmetic expressions involving possibly nested brackets. Also an expression such as &amp;quot;2 + 3 * 4&amp;quot; could be interpreted as either &amp;quot;(2 + 3) * 4&amp;quot; or as &amp;quot;2 + (3 * 4)&amp;quot;. The latter interpretation is that which is normally used - multiplication &amp;quot;*&amp;quot; is said to have a higher priority than addition &amp;quot;+&amp;quot; - so the example also needs to incorporate this priority concept into the grammar. Furthermore, consecutive operators of the same priority are applied from left to right, so that &amp;quot;8 - 2 + 3&amp;quot; is normally interpreted as &amp;quot;(8 - 2) + 3&amp;quot; = 9, rather than as &amp;quot;8 - (2 + 3)&amp;quot; = 3.  This ordering must also be built in to the grammar.&lt;br /&gt;
&lt;br /&gt;
To avoid distracting side-issues, this example only deals with numbers which consist solely of a single digit. The example is a simplified version of the definition of an arithmetic expression given in the Revised Algol 60 Report (Section 3.3.1).&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.masswerk.at/algol60/report.htm&lt;br /&gt;
| title = Revised Report on the Algorithmic Language Algol 60&lt;br /&gt;
| accessdate = 2012-04-22&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ''Expression'' -&amp;gt; ''Term''                        # an ''Expression'' is either a ''Term''&lt;br /&gt;
 ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''    #   or an ''Expression'' followed by '''+''' or '''-''' followed by a ''Term''&lt;br /&gt;
 ''Term''       -&amp;gt; ''Primary''                     # a ''Term'' is either a ''Primary''&lt;br /&gt;
 ''Term''       -&amp;gt; ''Term'' ''MulDivOp'' ''Primary''       #   or a ''Term'' followed by '''*''' or '''/''' followed by a ''Primary''&lt;br /&gt;
                                           #&lt;br /&gt;
 ''Primary''    -&amp;gt; ''Number''                      # a ''Primary'' is either a ''Number''&lt;br /&gt;
 ''Primary''    -&amp;gt; '''(''' ''Expression'' ''')'''              #   or an ''Expression'' enclosed in brackets&lt;br /&gt;
                                           #&lt;br /&gt;
 ''MulDivOp''   -&amp;gt; '''*'''. '''/'''                        # multiplication and division have the same priority&lt;br /&gt;
 ''AddSubOp''   -&amp;gt; '''+'''. '''-'''                        # addition and subtraction have the same priority&lt;br /&gt;
 ''Number''     -&amp;gt; '''0''', '''1''', ... '''9'''                 # this simple-minded definition of a ''Number'' is enough for this example&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
* Both ''Expression'' and ''Term'' are each defined via a left-recursive rule; this ensures that operators of the same priority are applied from left to right.&lt;br /&gt;
* The distinction between ''Expression'' and ''Term'' ensures that multiplication/division are applied before addition/subtraction.&lt;br /&gt;
* ''Expression'' is indirectly recursive via ''Term'' and ''Primary'' to allow bracketed sub-expressions to any depth.&lt;br /&gt;
&lt;br /&gt;
Example 1: generate 2 + 3 * 4&lt;br /&gt;
&lt;br /&gt;
  ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Term'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Primary'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' ''Term''                                 # '''+''' can not be applied until ''Term'' has been evaluated&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' ''Term'' ''MulDivOp'' ''Primary''&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' ''Primary'' ''MulDipOp'' ''Primary''&lt;br /&gt;
             -&amp;gt; '''2''' '''+''' '''3''' '''*''' '''4'''&lt;br /&gt;
&lt;br /&gt;
Example 2: generate 2 * 3 + 4&lt;br /&gt;
&lt;br /&gt;
  ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Term'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Term'' ''MulDivOp'' ''Primary'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; ''Primary'' ''MulDivOp'' ''Primary'' ''AddSubOp'' ''Term''&lt;br /&gt;
             -&amp;gt; '''2''' '''*''' '''3''' ''AddSubOp'' ''Term''                      # ''Term'' to left of ''AddSubOp'' is evaluated first&lt;br /&gt;
             -&amp;gt; '''2''' '''*''' '''3''' ''AddSubOp'' ''Primary''  &lt;br /&gt;
             -&amp;gt; '''2''' '''*''' '''3''' '''+''' '''4'''&lt;br /&gt;
&lt;br /&gt;
===Level 1===&lt;br /&gt;
&lt;br /&gt;
===Level 0===&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[category:linguistics]]&lt;br /&gt;
[[Category:Computer Science]]&lt;/div&gt;</summary>
		<author><name>RolandPlankton</name></author>
	</entry>
	<entry>
		<id>https://www.conservapedia.com/index.php?title=Conservapedia_talk:Copyright&amp;diff=977570</id>
		<title>Conservapedia talk:Copyright</title>
		<link rel="alternate" type="text/html" href="https://www.conservapedia.com/index.php?title=Conservapedia_talk:Copyright&amp;diff=977570"/>
		<updated>2012-04-24T06:34:16Z</updated>

		<summary type="html">&lt;p&gt;RolandPlankton: /* Interpreting Conservapedia:Copyright */ thanks&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Dual users ==&lt;br /&gt;
As a dual user (and now a dual administrator) of Conservapedia and CreationWiki, I have some questions that I think every registered user of multiple Wikis should ask himself--and here is the best place to put the answers.&lt;br /&gt;
&lt;br /&gt;
What obligations does a dual user labor under?&lt;br /&gt;
&lt;br /&gt;
May a dual user submit content--and by &amp;quot;content&amp;quot; I mean ''that user's own words''--directly to Conservapedia and to another Wiki?&lt;br /&gt;
&lt;br /&gt;
If a dual user has already submitted content to another Wiki--say, CreationWiki--then how long does he have to submit that content to Conservapedia before having to do an extensive rewrite?&lt;br /&gt;
&lt;br /&gt;
How extensive a rewrite would be required to avoid all questions of liability?&lt;br /&gt;
&lt;br /&gt;
In asking these questions, I realize at once that some content requires an extensive rewrite because the &amp;quot;target audience&amp;quot; is not the same, and has different values and, for lack of a better term, needs. But if that situation does not apply, then a dual user might be tempted to submit exactly the same words to both projects. If a user is going to do that, then how many days apart may he do that and still stay within a legal definition of &amp;quot;a simultaneous submission&amp;quot;?&lt;br /&gt;
&lt;br /&gt;
I am glad to have the opportunity to open a discussion on a topic of vital importance to Conservapedia. A firm policy on dual-user rights and obligations will go far to ensure that Conservapedia can get good content submitted to it.--[[User:TerryH|TerryH]]&amp;lt;sup&amp;gt;[[User talk:TerryH|Talk]]&amp;lt;/sup&amp;gt; 12:15, 6 April 2007 (EDT)&lt;br /&gt;
&lt;br /&gt;
: Other Wikis embrace, mistakenly in my opinion, the [[copyleft]] approach.  We do not.  As a dual user, I suggest submitting to Conservapedia first because our copyright is less restrictive than other Wikis.  If you submit to other Wikis first, then they might insist that impose the burdensome [[copyleft]] conditions on reuse of that material elsewhere.  We impose no such requirements.--[[User:Aschlafly|Aschlafly]] 13:46, 6 April 2007 (EDT)&lt;br /&gt;
&lt;br /&gt;
* Just on the broader point of comparing it to Wikipedia's license...  [[Differences with Wikipedia]] and [[Wikipedia copyright]] both currently say that contributing material to Wikipedia prevents the author from re-using their work elsewhere.  This is manifestly untrue.  By U.S. law, authors automatically own the copyright to their work, and the GFDL has no clauses that reassign copyright ownership to anyone else.    &amp;amp;nbsp;&amp;amp;nbsp; If I write a poem all by myself, license it under the GFDL, and post it to Geocities, then I still own the copyright.  The same holds for Wikipedia. &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; Wikipedia authors can and do [http://en.wikipedia.org/wiki/Wikipedia:Multi-licensing multiply-license] their works under other licenses in addition to the GFDL, which can include licenses that are more restrictive than the GFDL.  --[[User:Interiot|Interiot]] 13:57, 6 April 2007 (EDT)&lt;br /&gt;
&lt;br /&gt;
: That's '''not''' correct to the extent your work has been edited on other Wikis.  I don't know if you are right about your unedited original work and what Wikipedia or other Wikis may require as a condition of submission there.  The provisions governing submission on those websites would need to be checked.--[[User:Aschlafly|Aschlafly]] 14:09, 6 April 2007 (EDT)&lt;br /&gt;
::I should think that any contributor who built his contribution on his own machine, or otherwise re-created his original submission ''prior to any edits'', would satisfy the original-submission requirement. Happily, any Wiki has a history section that preserves the source code of every version of every article since its creation, or perhaps fifty edits back. All that a user has to do is look back to how his article looked ''before anyone else edited it'' (not counting immediate reverts) and then view and copy the source. I maintain that a contributor who does that, should be able to dual-submit. But I agree--once the article has been edited by another person, it's not that submitter's original work product anymore.--[[User:TerryH|TerryH]]&amp;lt;sup&amp;gt;[[User talk:TerryH|Talk]]&amp;lt;/sup&amp;gt; 14:16, 6 April 2007 (EDT)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
: As I (not a legal type - this comes from my experience as an artist and a writer in dealing with copyrights) understand it there are two issues here - original work and deritive work.  In the case of original work, unless you assign the copyright or &amp;quot;irrevocably waive and relinquish all copyrights&amp;quot;[http://www.conservapedia.com/index.php?title=Conservapedia:Copyright&amp;amp;oldid=89370#II] you own the copyright.  You are free to license it however you want.  You can put it on a gdfl wiki and you can publish it in a book, and that is not an issue (some publishers may want exclusive publishing rights in which case having published the material at a wiki means they won't be interested in it).  The only thing you have to be aware of is that someone else can come along and use the material in a way granted by the gdfl and they are not violating your copyright.  If the material is a deritive work - it is edits based on other edits of someone else's work, while you own the copyright to the ''edit'', you have to abide by the licensing of the parent work - if it is gdfl, then that means if you want to publish the material you have edited, then it is also under the gdfl.  --[[User:Mtur|Mtur]] 14:17, 6 April 2007 (EDT)&lt;br /&gt;
&lt;br /&gt;
: I think both Terry and Mtur are right.  Thanks also to Interiot for alerting us to this aspect of the issue.&lt;br /&gt;
&lt;br /&gt;
: By the way, those you who have influence with other wikis might persuade them to abandon their burdensome &amp;quot;copyleft&amp;quot; or gdfl licensing requirements.--[[User:Aschlafly|Aschlafly]] 14:30, 6 April 2007 (EDT)&lt;br /&gt;
&lt;br /&gt;
:: Could you remove that disconcerting &amp;quot;irrevocably waive and relinquish all copyrights&amp;quot; bit here? As an artist that kind of scares me. --[[User:Mtur|Mtur]] 14:32, 6 April 2007 (EDT)&lt;br /&gt;
&lt;br /&gt;
::: I've clarified it for you, but I don't see how to change what's in quotations without allowing people to cause problems in protesting copying of their entries.  Do you have a suggestion consistent with the purpose of a wiki?--[[User:Aschlafly|Aschlafly]] 14:38, 6 April 2007 (EDT)&lt;br /&gt;
&lt;br /&gt;
== From Wikipedia on multi licensing ==&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Wikipedia:Multi-licensing Wikipedia:Multi-licensing]&lt;br /&gt;
&amp;lt;blockquote&amp;gt;All text edits to Wikipedia fall under the GNU Free Documentation License (GFDL) with the copyright being retained by the original author.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
This edit[http://www.conservapedia.com/index.php?title=Differences_with_Wikipedia&amp;amp;curid=11868&amp;amp;diff=89683&amp;amp;oldid=89350] is not correct in that manner.&lt;br /&gt;
&amp;lt;blockquote&amp;gt;	1. We allow broader reuse of our material than Wikipedia does. By entering information on Wikipedia you are actually losing rights to your own material to the extent anyone else edits it, as you cannot then copy your entry for use elsewhere without complying with Wikipedia's burdensome copyright restrictions.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
You still own the original material even after it has been edited.  (ps: could you make that a wiki style numbering instead?  It should make your life easier if you ever want to insert a point between it or if you use a local style sheet to change how ordered lists are presented) --[[User:Mtur|Mtur]] 14:39, 6 April 2007 (EDT)&lt;br /&gt;
: OK, you're right.  I made it this: &amp;quot;you irrevocably consent to the display, copying, reuse or editing of your information, edits and entries, with or without attribution.&amp;quot;  And I'll fix the numbering also.  Thanks.--[[User:Aschlafly|Aschlafly]] 14:42, 6 April 2007 (EDT)&lt;br /&gt;
:: That is ''much'' better.  Thank you.  --[[User:Mtur|Mtur]] 14:44, 6 April 2007 (EDT)&lt;br /&gt;
&lt;br /&gt;
== Can Wikipedia (or any Wiki) Stop Copying of Entries? ==&lt;br /&gt;
&lt;br /&gt;
One editor here has suggested that Wikipedia (and other Wikis) never own any rights in any of their entries, and that Wikipedia (and other Wikis) cannot stop any copying of their entries even if in violation of the GNU license.  Wikipedians, do you have a view on this? (We don't want to copy any Wikipedia here but this is relevant to our own copyright policies).--[[User:Aschlafly|Aschlafly]] 19:51, 6 April 2007 (EDT)&lt;br /&gt;
:Well, though I'm technically still a registered user of [[Wikipedia]], I must disclaim anything more than a passing acquaintance with Wikipedia's copyright policies.&lt;br /&gt;
:But I ''am'' an administrator at [[CreationWiki]], and I am in at least weekly contact with their Chief Bureaucrat, Christopher W. Ashcraft. He says that he won't accept any verbatim copies from Conservapedia to his site, and he has advised all of us on his end not to copy stuff that we did not write over here. (As to things we ''did'' write--well, he doesn't mind dual submissions, and he said that ''simultaneous'' submissions are perfectly permissible as a matter of law. But I think he would agree with you, Andy, that we must submit our own words ''before'' anyone else edited them.)&lt;br /&gt;
:Frankly, that's about all that matters. I'll tell you how I use Wikipedia: I go to their sources whenever possible, and where that's not possible, I rewrite. In fact, most of the time, I ''couldn't'' accept their content, because they have a POV that I don't share. And even as regards my dual submisions here and at CreationWiki, I can't always write exactly the same thing here and there. This project and CreationWiki have two different target populations and two different scopes.&lt;br /&gt;
:Now as to whether anyone can stop the copying: I suspect that they could. I'll give you an insight from another context: firmware for a wireless router. When the company that currently owns the Linksys name incorporated code from the [[Linux]] operating system in the firmware for their WRT-54G family of wireless combination access point/routers, the Free Software Foundation sent them a cease-and-desist order. Linksys concluded that they just couldn't keep that code proprietary anymore, so they released the code. The result has been the invention of a number of &amp;quot;alternative firmwares&amp;quot; for that device. But it has ''also'' set a precedent that &amp;quot;copyleft&amp;quot; provisions ''are'' enforceable.&lt;br /&gt;
:And even if they couldn't go to court--well, I'd certainly hate to see any of our dual users get blocked for unlawful copying. That kind of misunderatanding would truly be a crying shame.--[[User:TerryH|TerryH]]&amp;lt;sup&amp;gt;[[User talk:TerryH|Talk]]&amp;lt;/sup&amp;gt; 20:33, 6 April 2007 (EDT)&lt;br /&gt;
The original contributors are the copyright owners (Wikipedia contributions aren't a [http://fairuse.stanford.edu/Copyright_and_Fair_Use_Overview/chapter0/0-c.html &amp;quot;work for hire&amp;quot;], and there's no other agreement to transfer copyright ownership), and the copyright owners [https://message.computerlaw.com/GH_ShowArticle.asp?HID=35 are the only ones who have standing] to sue for infringement.  Outside of court of course, standing isn't strictly adhered to, anybody can negotiate on behalf of the copyright owners, particularly if they believe they'll be able to find and assist the people who have standing by the time a lawsuit could occur.&lt;br /&gt;
&lt;br /&gt;
That's just copyright law though, I guess non-copyleft licenses may behave [http://www.groklaw.net/article.php?story=20031214210634851 more like contracts], I don't know.  --[[User:Interiot|Interiot]] 12:32, 9 July 2008 (EDT)&lt;br /&gt;
&lt;br /&gt;
==Photographs==&lt;br /&gt;
&lt;br /&gt;
To place a photo on wikipedia, you have to have specific proof that you have the copyright holder's permission to post it.  Here, you can post any photograph.  That's a violation of copyright law.  [[User:Czolgolz|Czolgolz]] 01:39, 9 April 2007 (EDT)&lt;br /&gt;
:Are you sure? The Sysops monitor all photograph submissions, and insist that everyone provide that proof in a free-text field. We also warn people that photograph submissions not in accord with our guidelines are subject to deletion. [[Wikipedia]] offers a menu of copyright-rationale choices. Perhaps Conservapedia would be well-advised to construct something similar, if only to make things easier on uploaders. But &amp;quot;anyone can post&amp;quot; is not a violation ''per se''. ''Retaining'' a photograph in our image archive that we shouldn't have--now ''that'' might be a violation.--[[User:TerryH|TerryH]]&amp;lt;sup&amp;gt;[[User talk:TerryH|Talk]]&amp;lt;/sup&amp;gt; 08:36, 9 April 2007 (EDT)&lt;br /&gt;
&lt;br /&gt;
== time to grow up? ==&lt;br /&gt;
&lt;br /&gt;
Is Conservapedia mature enough yet to remove &amp;quot;To compare this with Wikipedia's more restrictive copyright policy, see [[Wikipedia copyright]].&amp;quot; from this page? We don't compare it to the copyright policy of the US government, or of paper encyclopaedia publishers, so comparing to Wikipedia here is not really helpful either.&lt;br /&gt;
&lt;br /&gt;
I see this page is not presently protected, but it probably should be, as I believe only the site owner should change its copyright notice. --[[User:Scott|Scott]] 21:46, 13 April 2007 (EDT)&lt;br /&gt;
&lt;br /&gt;
: Thanks, I protected it at your suggestion.&lt;br /&gt;
&lt;br /&gt;
: As to your substantive comment above, Wikipedia's copyright requirements are burdensome.  Conservapedia's copyright allows much broader and easier reuse.  This is factual, well-supported, and no one seems to dispute it.  Users should be aware of this.--[[User:Aschlafly|Aschlafly]] 14:01, 14 April 2007 (EDT)&lt;br /&gt;
&lt;br /&gt;
::Thanks. If Conservapedia is supposed to be an ''alternative'' to Wikipedia, it shouldn't need to compare itself on every page. Someone wanting to know under what conditions they are contributing here, or whether they can reuse something found here, doesn't need or want to read the comparison any more than at the end of point 1 (revocable) &amp;quot;This is different to material published by the US Government which is released to the public domain and can be used for any purpose without restriction.&amp;quot; or &amp;quot;Encyclopaedia Brittannica does not allow reuse of their published material.&amp;quot; --[[User:Scott|Scott]] 19:34, 14 April 2007 (EDT)&lt;br /&gt;
&lt;br /&gt;
==Self-defense?==&lt;br /&gt;
This licence is simpler that the GFDL only at the expense of the vagueness inherent in the sentence &amp;quot;This license is revocable only in very rare instances of self-defense, such as protecting continued use by Conservapedia editors or other licensees.&amp;quot; Much of the GFDL licence document is concerned with enumerating the precise conditions you must meet in order to be ''sure'' that that your right to use the material will not be revoked. By maintaining the right to revoke the licence under the poorly-defined grounds of &amp;quot;self-defense&amp;quot; users can't be sure that they actually have the right to use the material; Nor can they be sure that a use that is permitted at one time might be disallowed at a future time. In this sense the Conservapedia license is less free than the GFDL. I suggest that this clause is replaced with a BSD-style &amp;quot;no endorsement&amp;quot; clause.--[[User:Jalapeno|Jalapeno]] 04:12, 15 May 2007 (EDT)&lt;br /&gt;
&lt;br /&gt;
:This encyclopedia is well appreciated, a needed response to Wikipedia's fatal flaws.  I am for it.  Nonetheless, Jalapeno is right.  It is not really relevant that the GNU project is a left-wing, anti-American organization, or that the BSD license comes from the liberal fever swamps of Berkeley.  The informal term &amp;quot;copyleft&amp;quot; may be etymologically annoying, but the idea the term represents is entirely sound.  You just cannot have an open-source encyclopedia without a proper open-source license.&lt;br /&gt;
&lt;br /&gt;
::The Free Software Foundation (GNU project) has a left-wing anarchist bias, and I also reject that term &amp;quot;copyleft&amp;quot; because it implies that everyone who supports open source, even voluntarily or in a financial/promotional setting, is a communist liberal. Many right-wing people, especially the anti-Ayn-Rand libertarians such as Lew Rockwell and Stephan Kinsella, support open-source because it is opposed to restrictive government laws and government-empowered lawyers getting in your way of free markets and a free press, and/or does not follow Locke's definition of property (it does follow Rand's), and/or is/might be financially profitable in certain situations. The man who first commercialized (and coined the term) open-source, Eric S. Raymond of the Open Source Development Initiative, was a libertarian for many years and is currently a neocon. Linus Torvalds is similar, he came from a Finnish communist family but became a wealthy conservative due to his work on the Linux kernel. Other musicians with past fan bases (such as NIN) have turned to Internet marketing and have dumped their record labels, making some stuff open-source/CC and/or charging for another/a better product. So we should not claim that open-source and free-software are &amp;quot;liberal&amp;quot; but are voluntary contracts any political person can agree to. (Private contract is limited government conservatism, isn't it?) However, see my note below about public domain under the &amp;quot;Creative Commons Attribution 3.0&amp;quot; section regarding possible risks with Conservapedia doing waiver such as these. -[[User:Danq|danq]] 13:36, 6 February 2011 (EST)&lt;br /&gt;
&lt;br /&gt;
:There is a fundamental difference between an encyclopedia that allows free use of its material and one that restricts free use for the purpose of &amp;quot;stopping unauthorized copying or mirroring of entire parts of this site,&amp;quot; as Conservapedia evidently does.  If Conservapedia includes some old material that obstructs proper open-sourcedness, and if open-sourcedness (is that a word?) is a goal, then why not remove or sequester the old material?  --[[User:Tannoce|Tannoce]] 08:43, 21 August 2008 (EDT)&lt;br /&gt;
&lt;br /&gt;
:: The [[GFDL]] copyright is the one that needs improvement to ease reuse.  Our copyright has worked well and is much more free and easy-to-use, except when the use is obviously destructive as outlined.--[[User:Aschlafly|Aschlafly]] 09:46, 21 August 2008 (EDT)&lt;br /&gt;
&lt;br /&gt;
== Migrating Solid Material to Wikipedia ==&lt;br /&gt;
&lt;br /&gt;
As I read the above, GNU allows me to use my ''exact'' contribution elsewhere (but proving it was my contribution may be problemantic) but once others have ''collaborated'' on the article it may be &amp;quot;illegal&amp;quot; for me to cut and paste all or any edited portions of the article to Conservapedia, since it would now include other editor's contributions.  Correct?&lt;br /&gt;
&lt;br /&gt;
Therefore, if one wants to work with collaborators in developing a solid article on controversial issues subject to POV pushing at Wikipedia, one should start here at Conservapedia...collaborate...then copy the entire article over to Wikipedia, since there would be no restrictions on moving an entire article to Wikipedia or WikiInfo or any other GNU governed site.  Is that correct?&lt;br /&gt;
&lt;br /&gt;
Mostly, I'm looking for a safer ground to collaborate with editors who won't constantly disrupt the article by deleting facts that undermine their political position.  Am I correct in my understanding that Conservapedia provides better safegaurds?  For example, can a person who starts an article for collaboration unilaterally block a disruptive editor?  Can one or more &amp;quot;approved&amp;quot; collaborators &amp;quot;guard&amp;quot; the article from someone who is disruptively trying to slant it in a different direction?&lt;br /&gt;
&lt;br /&gt;
If all that I've described above is correct, I STRONGLY recommend that Conservapedia should have an article prominently linked here that encourages developing articles here with the intent of copying them over to Wikipedia (which surely has more traffic) once they are developed.  Participating Editors then should, of course, watchlist the article on their Wikipedia accounts to help protect it from &amp;quot;blanking&amp;quot; of &amp;quot;inconvenient&amp;quot; facts.--[[User:MarthaVine|MarthaVine]] 11:24, 17 April 2008 (EDT)&lt;br /&gt;
&lt;br /&gt;
: What you say is correct, but [[Wikipedia]] is a lost cause and I don't have any interest in trying to post good material there.  [[Wikipedia]] does have lots of traffic but much of it is for non-educational (and sometimes biased) entries.  If something good is posted to [[Wikipedia]], then I don't expect it to last there.&lt;br /&gt;
&lt;br /&gt;
: However, feel welcome to copy your contributions to Wikipedia over to here, where we do not impose the silly copyright restrictions imposed by Wikipedia.--[[User:Aschlafly|Aschlafly]] 11:30, 17 April 2008 (EDT)&lt;br /&gt;
&lt;br /&gt;
::At Wikipedia, it is possible for a group of contributors (whom you call &amp;quot;editors&amp;quot;) to monopolize all collaboration on an article, even though this is expressly against Wikipedia policy. The abuse happens so frequently that Wikipedia '''itself''' calls it &amp;quot;tag-team editing&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
::*''Tag teams can block other Wikipedians from making contributions'' [http://en.wikipedia.org/wiki/Wikipedia:Ownership_of_articles#Multiple_editors]&lt;br /&gt;
&lt;br /&gt;
::Here, collaboration can take place among those who are sympathetic with the project's goals. Trustworthy articles are the primary goal, so if any liberals want to submit reliable information they are welcome. Unfortunately, about 90% of new users arrive here determined to subvert the project. Perhaps you would like to help reverse this trend. &lt;br /&gt;
&lt;br /&gt;
::What you propose, however, in terms of a team preparing an article offsite for migration to Wikipedia, is best down on a wiki which uses a free license. I would be happy to work with you at www.churchwiki.net if you are on the level. Forgive my caution, but I'd like to make sure before I invest any time in this. --[[User:Ed Poor|Ed Poor]] &amp;lt;sup&amp;gt;[[User talk:Ed Poor|Talk]]&amp;lt;/sup&amp;gt; 11:41, 17 April 2008 (EDT)&lt;br /&gt;
&lt;br /&gt;
Am I wrong to be sure that copying or migrating our articles to Wikipedia would be useless, because &amp;quot;THEY&amp;quot; would destroy it there anyway?  {{unsigned|Jerryankeedoodle}}&lt;br /&gt;
&lt;br /&gt;
== requesting change ==&lt;br /&gt;
&lt;br /&gt;
In item 3, I recommend changing &amp;quot;the United States District Court sitting in the City of Newark, State of New Jersey&amp;quot; to &amp;quot;A COURT OF LAW IN TRENTON, NEW JERSEY&amp;quot;.  I would have made the change myself, but the page is protected.--[[User:MackHein|MackHein]] 11:39, 9 March 2009 (EDT)&lt;br /&gt;
&lt;br /&gt;
==Alternative dispute resolution==&lt;br /&gt;
A more &amp;quot;free market&amp;quot; solution would be to eliminate all mention of U.S. Government courts altogether, and provide for the settlement of copyright-related disputes through some sort of [[alternative dispute resolution]] (ADR) - perhaps [[mediation]] as a first step and then [[arbitration]]. If any litigation did occur, it would reduce the cost and time required to resolve it. A typical ADR boilerplate clause reads thus:&lt;br /&gt;
{{cquote|'''Arbitration of all Disputes.'''  As a material part of this Agreement, the parties agree that any and all disputes, claims or controversies arising out of or relating to this Agreement or the purchase of the Property, shall be determined by confidential, final and binding arbitration in Newark, New Jersey, in accordance with the then-existing rules for commercial arbitration of the American Arbitration Association. Disputes, claims, and controversies subject to final and binding arbitration  under this Agreement include, without limitation, all those that otherwise could be tried in a court to a judge or jury in the absence of this Agreement.  By agreeing to submit all disputes, claims and controversies to binding arbitration, each of the parties expressly waives its rights to have such matters heard or tried in a court before a judge or jury or in any other tribunal.  Any award shall be final, binding and conclusive upon the parties, subject only to judicial review provided by statute, and a judgment rendered on the arbitration award may be entered in any state or federal court having jurisdiction thereof.  Notwithstanding the foregoing, each party agrees that before undertaking the aforementioned arbitration, they shall submit all disputes, claims or controversies to a mutually agreeable mediator in an attempt to a informally resolve said disputes, claims or controversies without the need for arbitration.}} [[User:NathanLarson|NathanLarson]] 12:39, 1 March 2010 (EST)&lt;br /&gt;
&lt;br /&gt;
:It would only be &amp;quot;free market&amp;quot; if we decided to put it in the contract. I for one have closed many Web site accounts for fear of someone bringing a charge against me where I have no means of self-defense and would be stuck paying not only the Web site owner thousands of dollars, but everyone's &amp;quot;legal fees&amp;quot; to the arbitration forum. Plus, if I am correct it costs companies money to join/fund these forums. I suggest we put as many waivers in as we need, such as waiving the right to a jury trial to discourage long cases and class-action suits. But to involve ourselves in something like this where we not only risk lacking the ability to pay and/or putting the financial safety of one editor/administrator/visitor against another, people's lives can be destroyed over a single debate about something. Conservapedia is not a multinational corporation, and we get picked on/spammed by liberals and atheists, both celebrity and troll, quite a bit. -[[User:Danq|danq]] 11:12, 6 February 2011 (EST)&lt;br /&gt;
&lt;br /&gt;
== Creative Commons Attribution 3.0 ==&lt;br /&gt;
&lt;br /&gt;
The [http://creativecommons.org/licenses/by/3.0/ Creative Commons Attribution 3.0 license] is a pretty good one. It's not a [[copyleft]] license like the [[GFDL]] or [[Creative Commons Share-Alike]] licenses, so cumbersome contractual entanglements pertaining to derivative works are avoided. Functionally, it's not all that different from a [[public domain]] license (see [http://creativecommons.org/licenses/publicdomain/ this page]), except that it's perhaps on firmer legal footing. (There is still some question as to whether a copyright owner is allowed to release his work into the public domain.) I don't think it would be such a bad idea to migrate this site to Creative Commons Attribution 3.0. [[User:NathanLarson|NathanLarson]] 15:33, 1 March 2010 (EST)&lt;br /&gt;
&lt;br /&gt;
:NathanLarson et al, I thought you should know that Creative Commons at some point introduced something called CC0. It is a list of waivers, not a license, and it waives not only the copyright but all of the &amp;quot;all rights reserved&amp;quot; which come with copyright (this doesn't include patents or trademarks). If any part of waiver is not legally possible, the unwaivable rights are re-waived in a &amp;quot;public license fallback&amp;quot;, and if that doesn't work, you agree to not to pursue any legal action against others regarding the work. I have applied this to my journal/poetry/opinion blog, but in terms of something like Conservapedia, every editor and administrator would have to know that there is no &amp;quot;taking back&amp;quot; of anything other than deleting it from Conservapedia.com, discouraging automatic spidering using ROBOTS.TXT, and asking/requesting/begging people. Also, there is no attribution requirement, so people can claim not only full credit for our work but partial credit as well (they cannot claim anyone here endorses it). For example, those liberal and atheist spammers can take whatever content they want, pervert it into something else, and claim it it was based on real Conservapedia content, so long as they don't say it's approved/endorsed by any of us. Links: [http://wiki.creativecommons.org/CC0_FAQ CC0 FAQ] [[http://creativecommons.org/publicdomain/zero/1.0/ CC0 main link] [http://creativecommons.org/publicdomain/zero/1.0/legalcode CC0 legal code]. Personally I think it would be too much of a hassle to put out press releases on what is and isn't genuine all the time, especially with people like Jon Stewart making fun of us on national TV. I just thought I'd share info on the new CC0 system with NathanLarson and anyone else who happens to read this, and why I feel Conservapedia shouldn't do it. -[[User:Danq|danq]] 10:59, 6 February 2011 (EST)&lt;br /&gt;
&lt;br /&gt;
:Thanks, Nathan.  The owner of this site is a licensed Attorney and not merely a wiki-lawyer, however.  --&amp;lt;big&amp;gt;[[User:TK|'''ṬK''']]&amp;lt;/big&amp;gt;&amp;lt;sub&amp;gt;/Admin&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;[[User_Talk:TK|/Talk]]&amp;lt;/sup&amp;gt; 19:46, 1 March 2010 (EST)&lt;br /&gt;
&lt;br /&gt;
== Interpreting [[Conservapedia:Copyright]] ==&lt;br /&gt;
&lt;br /&gt;
I do not have any U.S.A. legal training, and I am uncertain as to how to interpret some aspects of [[Conservapedia:Copyright]].&lt;br /&gt;
&lt;br /&gt;
Perhaps someone can answer these simple questions relating to Conservapedia articles (excluding pictures, talk pages, user pages, etc.):&lt;br /&gt;
&lt;br /&gt;
*Are Conservapedia articles in the public domain? &lt;br /&gt;
*Are Conservapedia articles copyrighted?&lt;br /&gt;
**If 'yes', who owns the copyrights? &lt;br /&gt;
&lt;br /&gt;
I would be grateful for some definitive answers. [[User:RolandPlankton|RolandPlankton]] 17:41, 23 April 2012 (EDT)&lt;br /&gt;
:This probably isn't sufficiently definitive, but here are my thoughts based on some googling and a not-yet-complete legal education: Since 1988, no registration is required (generally) to create a copyright. This means that any contributor who edits here (assuming that the edit is eligible for copyright protection), is automatically granted a copyright in his contribution. Over at Wikipedia, edits can only be made after agreeing to release the copyright for use under their license. No such requirement is made here, which I believe means that the individual editors retain their copyrights. The fact that Conservapedia has a copyright policy is functionally of very little use. It would only apply in the rare cases where an editor here has assigned his copyright to the site (assuming that's even possible) or explicitly licensed its use under the terms of this page.&lt;br /&gt;
&lt;br /&gt;
:So, to answer your specific questions:&lt;br /&gt;
:*Not generally, though any article content which was previously in the public domain would remain so.&lt;br /&gt;
:*Articles themselves are not copyrighted, but individual contributions are (assuming they're sufficiently original to qualify for protection)&lt;br /&gt;
::*The copyright for any individual contribution is owned by the contributor, unless such copyright is waived or released. Since there is no general mechanism here for release, it is likely that very few releases have occurred. &lt;br /&gt;
::--[[User:JustinD|JustinD]] 22:09, 23 April 2012 (EDT)&lt;br /&gt;
&lt;br /&gt;
::JustinD, thank you for your prompt response. [[User:RolandPlankton|RolandPlankton]] 02:34, 24 April 2012 (EDT)&lt;/div&gt;</summary>
		<author><name>RolandPlankton</name></author>
	</entry>
	<entry>
		<id>https://www.conservapedia.com/index.php?title=Conservapedia_talk:Copyright&amp;diff=977482</id>
		<title>Conservapedia talk:Copyright</title>
		<link rel="alternate" type="text/html" href="https://www.conservapedia.com/index.php?title=Conservapedia_talk:Copyright&amp;diff=977482"/>
		<updated>2012-04-23T21:41:24Z</updated>

		<summary type="html">&lt;p&gt;RolandPlankton: /* Interpreting Conservapedia:Copyright */ new section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Dual users ==&lt;br /&gt;
As a dual user (and now a dual administrator) of Conservapedia and CreationWiki, I have some questions that I think every registered user of multiple Wikis should ask himself--and here is the best place to put the answers.&lt;br /&gt;
&lt;br /&gt;
What obligations does a dual user labor under?&lt;br /&gt;
&lt;br /&gt;
May a dual user submit content--and by &amp;quot;content&amp;quot; I mean ''that user's own words''--directly to Conservapedia and to another Wiki?&lt;br /&gt;
&lt;br /&gt;
If a dual user has already submitted content to another Wiki--say, CreationWiki--then how long does he have to submit that content to Conservapedia before having to do an extensive rewrite?&lt;br /&gt;
&lt;br /&gt;
How extensive a rewrite would be required to avoid all questions of liability?&lt;br /&gt;
&lt;br /&gt;
In asking these questions, I realize at once that some content requires an extensive rewrite because the &amp;quot;target audience&amp;quot; is not the same, and has different values and, for lack of a better term, needs. But if that situation does not apply, then a dual user might be tempted to submit exactly the same words to both projects. If a user is going to do that, then how many days apart may he do that and still stay within a legal definition of &amp;quot;a simultaneous submission&amp;quot;?&lt;br /&gt;
&lt;br /&gt;
I am glad to have the opportunity to open a discussion on a topic of vital importance to Conservapedia. A firm policy on dual-user rights and obligations will go far to ensure that Conservapedia can get good content submitted to it.--[[User:TerryH|TerryH]]&amp;lt;sup&amp;gt;[[User talk:TerryH|Talk]]&amp;lt;/sup&amp;gt; 12:15, 6 April 2007 (EDT)&lt;br /&gt;
&lt;br /&gt;
: Other Wikis embrace, mistakenly in my opinion, the [[copyleft]] approach.  We do not.  As a dual user, I suggest submitting to Conservapedia first because our copyright is less restrictive than other Wikis.  If you submit to other Wikis first, then they might insist that impose the burdensome [[copyleft]] conditions on reuse of that material elsewhere.  We impose no such requirements.--[[User:Aschlafly|Aschlafly]] 13:46, 6 April 2007 (EDT)&lt;br /&gt;
&lt;br /&gt;
* Just on the broader point of comparing it to Wikipedia's license...  [[Differences with Wikipedia]] and [[Wikipedia copyright]] both currently say that contributing material to Wikipedia prevents the author from re-using their work elsewhere.  This is manifestly untrue.  By U.S. law, authors automatically own the copyright to their work, and the GFDL has no clauses that reassign copyright ownership to anyone else.    &amp;amp;nbsp;&amp;amp;nbsp; If I write a poem all by myself, license it under the GFDL, and post it to Geocities, then I still own the copyright.  The same holds for Wikipedia. &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; Wikipedia authors can and do [http://en.wikipedia.org/wiki/Wikipedia:Multi-licensing multiply-license] their works under other licenses in addition to the GFDL, which can include licenses that are more restrictive than the GFDL.  --[[User:Interiot|Interiot]] 13:57, 6 April 2007 (EDT)&lt;br /&gt;
&lt;br /&gt;
: That's '''not''' correct to the extent your work has been edited on other Wikis.  I don't know if you are right about your unedited original work and what Wikipedia or other Wikis may require as a condition of submission there.  The provisions governing submission on those websites would need to be checked.--[[User:Aschlafly|Aschlafly]] 14:09, 6 April 2007 (EDT)&lt;br /&gt;
::I should think that any contributor who built his contribution on his own machine, or otherwise re-created his original submission ''prior to any edits'', would satisfy the original-submission requirement. Happily, any Wiki has a history section that preserves the source code of every version of every article since its creation, or perhaps fifty edits back. All that a user has to do is look back to how his article looked ''before anyone else edited it'' (not counting immediate reverts) and then view and copy the source. I maintain that a contributor who does that, should be able to dual-submit. But I agree--once the article has been edited by another person, it's not that submitter's original work product anymore.--[[User:TerryH|TerryH]]&amp;lt;sup&amp;gt;[[User talk:TerryH|Talk]]&amp;lt;/sup&amp;gt; 14:16, 6 April 2007 (EDT)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
: As I (not a legal type - this comes from my experience as an artist and a writer in dealing with copyrights) understand it there are two issues here - original work and deritive work.  In the case of original work, unless you assign the copyright or &amp;quot;irrevocably waive and relinquish all copyrights&amp;quot;[http://www.conservapedia.com/index.php?title=Conservapedia:Copyright&amp;amp;oldid=89370#II] you own the copyright.  You are free to license it however you want.  You can put it on a gdfl wiki and you can publish it in a book, and that is not an issue (some publishers may want exclusive publishing rights in which case having published the material at a wiki means they won't be interested in it).  The only thing you have to be aware of is that someone else can come along and use the material in a way granted by the gdfl and they are not violating your copyright.  If the material is a deritive work - it is edits based on other edits of someone else's work, while you own the copyright to the ''edit'', you have to abide by the licensing of the parent work - if it is gdfl, then that means if you want to publish the material you have edited, then it is also under the gdfl.  --[[User:Mtur|Mtur]] 14:17, 6 April 2007 (EDT)&lt;br /&gt;
&lt;br /&gt;
: I think both Terry and Mtur are right.  Thanks also to Interiot for alerting us to this aspect of the issue.&lt;br /&gt;
&lt;br /&gt;
: By the way, those you who have influence with other wikis might persuade them to abandon their burdensome &amp;quot;copyleft&amp;quot; or gdfl licensing requirements.--[[User:Aschlafly|Aschlafly]] 14:30, 6 April 2007 (EDT)&lt;br /&gt;
&lt;br /&gt;
:: Could you remove that disconcerting &amp;quot;irrevocably waive and relinquish all copyrights&amp;quot; bit here? As an artist that kind of scares me. --[[User:Mtur|Mtur]] 14:32, 6 April 2007 (EDT)&lt;br /&gt;
&lt;br /&gt;
::: I've clarified it for you, but I don't see how to change what's in quotations without allowing people to cause problems in protesting copying of their entries.  Do you have a suggestion consistent with the purpose of a wiki?--[[User:Aschlafly|Aschlafly]] 14:38, 6 April 2007 (EDT)&lt;br /&gt;
&lt;br /&gt;
== From Wikipedia on multi licensing ==&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Wikipedia:Multi-licensing Wikipedia:Multi-licensing]&lt;br /&gt;
&amp;lt;blockquote&amp;gt;All text edits to Wikipedia fall under the GNU Free Documentation License (GFDL) with the copyright being retained by the original author.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
This edit[http://www.conservapedia.com/index.php?title=Differences_with_Wikipedia&amp;amp;curid=11868&amp;amp;diff=89683&amp;amp;oldid=89350] is not correct in that manner.&lt;br /&gt;
&amp;lt;blockquote&amp;gt;	1. We allow broader reuse of our material than Wikipedia does. By entering information on Wikipedia you are actually losing rights to your own material to the extent anyone else edits it, as you cannot then copy your entry for use elsewhere without complying with Wikipedia's burdensome copyright restrictions.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
You still own the original material even after it has been edited.  (ps: could you make that a wiki style numbering instead?  It should make your life easier if you ever want to insert a point between it or if you use a local style sheet to change how ordered lists are presented) --[[User:Mtur|Mtur]] 14:39, 6 April 2007 (EDT)&lt;br /&gt;
: OK, you're right.  I made it this: &amp;quot;you irrevocably consent to the display, copying, reuse or editing of your information, edits and entries, with or without attribution.&amp;quot;  And I'll fix the numbering also.  Thanks.--[[User:Aschlafly|Aschlafly]] 14:42, 6 April 2007 (EDT)&lt;br /&gt;
:: That is ''much'' better.  Thank you.  --[[User:Mtur|Mtur]] 14:44, 6 April 2007 (EDT)&lt;br /&gt;
&lt;br /&gt;
== Can Wikipedia (or any Wiki) Stop Copying of Entries? ==&lt;br /&gt;
&lt;br /&gt;
One editor here has suggested that Wikipedia (and other Wikis) never own any rights in any of their entries, and that Wikipedia (and other Wikis) cannot stop any copying of their entries even if in violation of the GNU license.  Wikipedians, do you have a view on this? (We don't want to copy any Wikipedia here but this is relevant to our own copyright policies).--[[User:Aschlafly|Aschlafly]] 19:51, 6 April 2007 (EDT)&lt;br /&gt;
:Well, though I'm technically still a registered user of [[Wikipedia]], I must disclaim anything more than a passing acquaintance with Wikipedia's copyright policies.&lt;br /&gt;
:But I ''am'' an administrator at [[CreationWiki]], and I am in at least weekly contact with their Chief Bureaucrat, Christopher W. Ashcraft. He says that he won't accept any verbatim copies from Conservapedia to his site, and he has advised all of us on his end not to copy stuff that we did not write over here. (As to things we ''did'' write--well, he doesn't mind dual submissions, and he said that ''simultaneous'' submissions are perfectly permissible as a matter of law. But I think he would agree with you, Andy, that we must submit our own words ''before'' anyone else edited them.)&lt;br /&gt;
:Frankly, that's about all that matters. I'll tell you how I use Wikipedia: I go to their sources whenever possible, and where that's not possible, I rewrite. In fact, most of the time, I ''couldn't'' accept their content, because they have a POV that I don't share. And even as regards my dual submisions here and at CreationWiki, I can't always write exactly the same thing here and there. This project and CreationWiki have two different target populations and two different scopes.&lt;br /&gt;
:Now as to whether anyone can stop the copying: I suspect that they could. I'll give you an insight from another context: firmware for a wireless router. When the company that currently owns the Linksys name incorporated code from the [[Linux]] operating system in the firmware for their WRT-54G family of wireless combination access point/routers, the Free Software Foundation sent them a cease-and-desist order. Linksys concluded that they just couldn't keep that code proprietary anymore, so they released the code. The result has been the invention of a number of &amp;quot;alternative firmwares&amp;quot; for that device. But it has ''also'' set a precedent that &amp;quot;copyleft&amp;quot; provisions ''are'' enforceable.&lt;br /&gt;
:And even if they couldn't go to court--well, I'd certainly hate to see any of our dual users get blocked for unlawful copying. That kind of misunderatanding would truly be a crying shame.--[[User:TerryH|TerryH]]&amp;lt;sup&amp;gt;[[User talk:TerryH|Talk]]&amp;lt;/sup&amp;gt; 20:33, 6 April 2007 (EDT)&lt;br /&gt;
The original contributors are the copyright owners (Wikipedia contributions aren't a [http://fairuse.stanford.edu/Copyright_and_Fair_Use_Overview/chapter0/0-c.html &amp;quot;work for hire&amp;quot;], and there's no other agreement to transfer copyright ownership), and the copyright owners [https://message.computerlaw.com/GH_ShowArticle.asp?HID=35 are the only ones who have standing] to sue for infringement.  Outside of court of course, standing isn't strictly adhered to, anybody can negotiate on behalf of the copyright owners, particularly if they believe they'll be able to find and assist the people who have standing by the time a lawsuit could occur.&lt;br /&gt;
&lt;br /&gt;
That's just copyright law though, I guess non-copyleft licenses may behave [http://www.groklaw.net/article.php?story=20031214210634851 more like contracts], I don't know.  --[[User:Interiot|Interiot]] 12:32, 9 July 2008 (EDT)&lt;br /&gt;
&lt;br /&gt;
==Photographs==&lt;br /&gt;
&lt;br /&gt;
To place a photo on wikipedia, you have to have specific proof that you have the copyright holder's permission to post it.  Here, you can post any photograph.  That's a violation of copyright law.  [[User:Czolgolz|Czolgolz]] 01:39, 9 April 2007 (EDT)&lt;br /&gt;
:Are you sure? The Sysops monitor all photograph submissions, and insist that everyone provide that proof in a free-text field. We also warn people that photograph submissions not in accord with our guidelines are subject to deletion. [[Wikipedia]] offers a menu of copyright-rationale choices. Perhaps Conservapedia would be well-advised to construct something similar, if only to make things easier on uploaders. But &amp;quot;anyone can post&amp;quot; is not a violation ''per se''. ''Retaining'' a photograph in our image archive that we shouldn't have--now ''that'' might be a violation.--[[User:TerryH|TerryH]]&amp;lt;sup&amp;gt;[[User talk:TerryH|Talk]]&amp;lt;/sup&amp;gt; 08:36, 9 April 2007 (EDT)&lt;br /&gt;
&lt;br /&gt;
== time to grow up? ==&lt;br /&gt;
&lt;br /&gt;
Is Conservapedia mature enough yet to remove &amp;quot;To compare this with Wikipedia's more restrictive copyright policy, see [[Wikipedia copyright]].&amp;quot; from this page? We don't compare it to the copyright policy of the US government, or of paper encyclopaedia publishers, so comparing to Wikipedia here is not really helpful either.&lt;br /&gt;
&lt;br /&gt;
I see this page is not presently protected, but it probably should be, as I believe only the site owner should change its copyright notice. --[[User:Scott|Scott]] 21:46, 13 April 2007 (EDT)&lt;br /&gt;
&lt;br /&gt;
: Thanks, I protected it at your suggestion.&lt;br /&gt;
&lt;br /&gt;
: As to your substantive comment above, Wikipedia's copyright requirements are burdensome.  Conservapedia's copyright allows much broader and easier reuse.  This is factual, well-supported, and no one seems to dispute it.  Users should be aware of this.--[[User:Aschlafly|Aschlafly]] 14:01, 14 April 2007 (EDT)&lt;br /&gt;
&lt;br /&gt;
::Thanks. If Conservapedia is supposed to be an ''alternative'' to Wikipedia, it shouldn't need to compare itself on every page. Someone wanting to know under what conditions they are contributing here, or whether they can reuse something found here, doesn't need or want to read the comparison any more than at the end of point 1 (revocable) &amp;quot;This is different to material published by the US Government which is released to the public domain and can be used for any purpose without restriction.&amp;quot; or &amp;quot;Encyclopaedia Brittannica does not allow reuse of their published material.&amp;quot; --[[User:Scott|Scott]] 19:34, 14 April 2007 (EDT)&lt;br /&gt;
&lt;br /&gt;
==Self-defense?==&lt;br /&gt;
This licence is simpler that the GFDL only at the expense of the vagueness inherent in the sentence &amp;quot;This license is revocable only in very rare instances of self-defense, such as protecting continued use by Conservapedia editors or other licensees.&amp;quot; Much of the GFDL licence document is concerned with enumerating the precise conditions you must meet in order to be ''sure'' that that your right to use the material will not be revoked. By maintaining the right to revoke the licence under the poorly-defined grounds of &amp;quot;self-defense&amp;quot; users can't be sure that they actually have the right to use the material; Nor can they be sure that a use that is permitted at one time might be disallowed at a future time. In this sense the Conservapedia license is less free than the GFDL. I suggest that this clause is replaced with a BSD-style &amp;quot;no endorsement&amp;quot; clause.--[[User:Jalapeno|Jalapeno]] 04:12, 15 May 2007 (EDT)&lt;br /&gt;
&lt;br /&gt;
:This encyclopedia is well appreciated, a needed response to Wikipedia's fatal flaws.  I am for it.  Nonetheless, Jalapeno is right.  It is not really relevant that the GNU project is a left-wing, anti-American organization, or that the BSD license comes from the liberal fever swamps of Berkeley.  The informal term &amp;quot;copyleft&amp;quot; may be etymologically annoying, but the idea the term represents is entirely sound.  You just cannot have an open-source encyclopedia without a proper open-source license.&lt;br /&gt;
&lt;br /&gt;
::The Free Software Foundation (GNU project) has a left-wing anarchist bias, and I also reject that term &amp;quot;copyleft&amp;quot; because it implies that everyone who supports open source, even voluntarily or in a financial/promotional setting, is a communist liberal. Many right-wing people, especially the anti-Ayn-Rand libertarians such as Lew Rockwell and Stephan Kinsella, support open-source because it is opposed to restrictive government laws and government-empowered lawyers getting in your way of free markets and a free press, and/or does not follow Locke's definition of property (it does follow Rand's), and/or is/might be financially profitable in certain situations. The man who first commercialized (and coined the term) open-source, Eric S. Raymond of the Open Source Development Initiative, was a libertarian for many years and is currently a neocon. Linus Torvalds is similar, he came from a Finnish communist family but became a wealthy conservative due to his work on the Linux kernel. Other musicians with past fan bases (such as NIN) have turned to Internet marketing and have dumped their record labels, making some stuff open-source/CC and/or charging for another/a better product. So we should not claim that open-source and free-software are &amp;quot;liberal&amp;quot; but are voluntary contracts any political person can agree to. (Private contract is limited government conservatism, isn't it?) However, see my note below about public domain under the &amp;quot;Creative Commons Attribution 3.0&amp;quot; section regarding possible risks with Conservapedia doing waiver such as these. -[[User:Danq|danq]] 13:36, 6 February 2011 (EST)&lt;br /&gt;
&lt;br /&gt;
:There is a fundamental difference between an encyclopedia that allows free use of its material and one that restricts free use for the purpose of &amp;quot;stopping unauthorized copying or mirroring of entire parts of this site,&amp;quot; as Conservapedia evidently does.  If Conservapedia includes some old material that obstructs proper open-sourcedness, and if open-sourcedness (is that a word?) is a goal, then why not remove or sequester the old material?  --[[User:Tannoce|Tannoce]] 08:43, 21 August 2008 (EDT)&lt;br /&gt;
&lt;br /&gt;
:: The [[GFDL]] copyright is the one that needs improvement to ease reuse.  Our copyright has worked well and is much more free and easy-to-use, except when the use is obviously destructive as outlined.--[[User:Aschlafly|Aschlafly]] 09:46, 21 August 2008 (EDT)&lt;br /&gt;
&lt;br /&gt;
== Migrating Solid Material to Wikipedia ==&lt;br /&gt;
&lt;br /&gt;
As I read the above, GNU allows me to use my ''exact'' contribution elsewhere (but proving it was my contribution may be problemantic) but once others have ''collaborated'' on the article it may be &amp;quot;illegal&amp;quot; for me to cut and paste all or any edited portions of the article to Conservapedia, since it would now include other editor's contributions.  Correct?&lt;br /&gt;
&lt;br /&gt;
Therefore, if one wants to work with collaborators in developing a solid article on controversial issues subject to POV pushing at Wikipedia, one should start here at Conservapedia...collaborate...then copy the entire article over to Wikipedia, since there would be no restrictions on moving an entire article to Wikipedia or WikiInfo or any other GNU governed site.  Is that correct?&lt;br /&gt;
&lt;br /&gt;
Mostly, I'm looking for a safer ground to collaborate with editors who won't constantly disrupt the article by deleting facts that undermine their political position.  Am I correct in my understanding that Conservapedia provides better safegaurds?  For example, can a person who starts an article for collaboration unilaterally block a disruptive editor?  Can one or more &amp;quot;approved&amp;quot; collaborators &amp;quot;guard&amp;quot; the article from someone who is disruptively trying to slant it in a different direction?&lt;br /&gt;
&lt;br /&gt;
If all that I've described above is correct, I STRONGLY recommend that Conservapedia should have an article prominently linked here that encourages developing articles here with the intent of copying them over to Wikipedia (which surely has more traffic) once they are developed.  Participating Editors then should, of course, watchlist the article on their Wikipedia accounts to help protect it from &amp;quot;blanking&amp;quot; of &amp;quot;inconvenient&amp;quot; facts.--[[User:MarthaVine|MarthaVine]] 11:24, 17 April 2008 (EDT)&lt;br /&gt;
&lt;br /&gt;
: What you say is correct, but [[Wikipedia]] is a lost cause and I don't have any interest in trying to post good material there.  [[Wikipedia]] does have lots of traffic but much of it is for non-educational (and sometimes biased) entries.  If something good is posted to [[Wikipedia]], then I don't expect it to last there.&lt;br /&gt;
&lt;br /&gt;
: However, feel welcome to copy your contributions to Wikipedia over to here, where we do not impose the silly copyright restrictions imposed by Wikipedia.--[[User:Aschlafly|Aschlafly]] 11:30, 17 April 2008 (EDT)&lt;br /&gt;
&lt;br /&gt;
::At Wikipedia, it is possible for a group of contributors (whom you call &amp;quot;editors&amp;quot;) to monopolize all collaboration on an article, even though this is expressly against Wikipedia policy. The abuse happens so frequently that Wikipedia '''itself''' calls it &amp;quot;tag-team editing&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
::*''Tag teams can block other Wikipedians from making contributions'' [http://en.wikipedia.org/wiki/Wikipedia:Ownership_of_articles#Multiple_editors]&lt;br /&gt;
&lt;br /&gt;
::Here, collaboration can take place among those who are sympathetic with the project's goals. Trustworthy articles are the primary goal, so if any liberals want to submit reliable information they are welcome. Unfortunately, about 90% of new users arrive here determined to subvert the project. Perhaps you would like to help reverse this trend. &lt;br /&gt;
&lt;br /&gt;
::What you propose, however, in terms of a team preparing an article offsite for migration to Wikipedia, is best down on a wiki which uses a free license. I would be happy to work with you at www.churchwiki.net if you are on the level. Forgive my caution, but I'd like to make sure before I invest any time in this. --[[User:Ed Poor|Ed Poor]] &amp;lt;sup&amp;gt;[[User talk:Ed Poor|Talk]]&amp;lt;/sup&amp;gt; 11:41, 17 April 2008 (EDT)&lt;br /&gt;
&lt;br /&gt;
Am I wrong to be sure that copying or migrating our articles to Wikipedia would be useless, because &amp;quot;THEY&amp;quot; would destroy it there anyway?  {{unsigned|Jerryankeedoodle}}&lt;br /&gt;
&lt;br /&gt;
== requesting change ==&lt;br /&gt;
&lt;br /&gt;
In item 3, I recommend changing &amp;quot;the United States District Court sitting in the City of Newark, State of New Jersey&amp;quot; to &amp;quot;A COURT OF LAW IN TRENTON, NEW JERSEY&amp;quot;.  I would have made the change myself, but the page is protected.--[[User:MackHein|MackHein]] 11:39, 9 March 2009 (EDT)&lt;br /&gt;
&lt;br /&gt;
==Alternative dispute resolution==&lt;br /&gt;
A more &amp;quot;free market&amp;quot; solution would be to eliminate all mention of U.S. Government courts altogether, and provide for the settlement of copyright-related disputes through some sort of [[alternative dispute resolution]] (ADR) - perhaps [[mediation]] as a first step and then [[arbitration]]. If any litigation did occur, it would reduce the cost and time required to resolve it. A typical ADR boilerplate clause reads thus:&lt;br /&gt;
{{cquote|'''Arbitration of all Disputes.'''  As a material part of this Agreement, the parties agree that any and all disputes, claims or controversies arising out of or relating to this Agreement or the purchase of the Property, shall be determined by confidential, final and binding arbitration in Newark, New Jersey, in accordance with the then-existing rules for commercial arbitration of the American Arbitration Association. Disputes, claims, and controversies subject to final and binding arbitration  under this Agreement include, without limitation, all those that otherwise could be tried in a court to a judge or jury in the absence of this Agreement.  By agreeing to submit all disputes, claims and controversies to binding arbitration, each of the parties expressly waives its rights to have such matters heard or tried in a court before a judge or jury or in any other tribunal.  Any award shall be final, binding and conclusive upon the parties, subject only to judicial review provided by statute, and a judgment rendered on the arbitration award may be entered in any state or federal court having jurisdiction thereof.  Notwithstanding the foregoing, each party agrees that before undertaking the aforementioned arbitration, they shall submit all disputes, claims or controversies to a mutually agreeable mediator in an attempt to a informally resolve said disputes, claims or controversies without the need for arbitration.}} [[User:NathanLarson|NathanLarson]] 12:39, 1 March 2010 (EST)&lt;br /&gt;
&lt;br /&gt;
:It would only be &amp;quot;free market&amp;quot; if we decided to put it in the contract. I for one have closed many Web site accounts for fear of someone bringing a charge against me where I have no means of self-defense and would be stuck paying not only the Web site owner thousands of dollars, but everyone's &amp;quot;legal fees&amp;quot; to the arbitration forum. Plus, if I am correct it costs companies money to join/fund these forums. I suggest we put as many waivers in as we need, such as waiving the right to a jury trial to discourage long cases and class-action suits. But to involve ourselves in something like this where we not only risk lacking the ability to pay and/or putting the financial safety of one editor/administrator/visitor against another, people's lives can be destroyed over a single debate about something. Conservapedia is not a multinational corporation, and we get picked on/spammed by liberals and atheists, both celebrity and troll, quite a bit. -[[User:Danq|danq]] 11:12, 6 February 2011 (EST)&lt;br /&gt;
&lt;br /&gt;
== Creative Commons Attribution 3.0 ==&lt;br /&gt;
&lt;br /&gt;
The [http://creativecommons.org/licenses/by/3.0/ Creative Commons Attribution 3.0 license] is a pretty good one. It's not a [[copyleft]] license like the [[GFDL]] or [[Creative Commons Share-Alike]] licenses, so cumbersome contractual entanglements pertaining to derivative works are avoided. Functionally, it's not all that different from a [[public domain]] license (see [http://creativecommons.org/licenses/publicdomain/ this page]), except that it's perhaps on firmer legal footing. (There is still some question as to whether a copyright owner is allowed to release his work into the public domain.) I don't think it would be such a bad idea to migrate this site to Creative Commons Attribution 3.0. [[User:NathanLarson|NathanLarson]] 15:33, 1 March 2010 (EST)&lt;br /&gt;
&lt;br /&gt;
:NathanLarson et al, I thought you should know that Creative Commons at some point introduced something called CC0. It is a list of waivers, not a license, and it waives not only the copyright but all of the &amp;quot;all rights reserved&amp;quot; which come with copyright (this doesn't include patents or trademarks). If any part of waiver is not legally possible, the unwaivable rights are re-waived in a &amp;quot;public license fallback&amp;quot;, and if that doesn't work, you agree to not to pursue any legal action against others regarding the work. I have applied this to my journal/poetry/opinion blog, but in terms of something like Conservapedia, every editor and administrator would have to know that there is no &amp;quot;taking back&amp;quot; of anything other than deleting it from Conservapedia.com, discouraging automatic spidering using ROBOTS.TXT, and asking/requesting/begging people. Also, there is no attribution requirement, so people can claim not only full credit for our work but partial credit as well (they cannot claim anyone here endorses it). For example, those liberal and atheist spammers can take whatever content they want, pervert it into something else, and claim it it was based on real Conservapedia content, so long as they don't say it's approved/endorsed by any of us. Links: [http://wiki.creativecommons.org/CC0_FAQ CC0 FAQ] [[http://creativecommons.org/publicdomain/zero/1.0/ CC0 main link] [http://creativecommons.org/publicdomain/zero/1.0/legalcode CC0 legal code]. Personally I think it would be too much of a hassle to put out press releases on what is and isn't genuine all the time, especially with people like Jon Stewart making fun of us on national TV. I just thought I'd share info on the new CC0 system with NathanLarson and anyone else who happens to read this, and why I feel Conservapedia shouldn't do it. -[[User:Danq|danq]] 10:59, 6 February 2011 (EST)&lt;br /&gt;
&lt;br /&gt;
:Thanks, Nathan.  The owner of this site is a licensed Attorney and not merely a wiki-lawyer, however.  --&amp;lt;big&amp;gt;[[User:TK|'''ṬK''']]&amp;lt;/big&amp;gt;&amp;lt;sub&amp;gt;/Admin&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;[[User_Talk:TK|/Talk]]&amp;lt;/sup&amp;gt; 19:46, 1 March 2010 (EST)&lt;br /&gt;
&lt;br /&gt;
== Interpreting [[Conservapedia:Copyright]] ==&lt;br /&gt;
&lt;br /&gt;
I do not have any U.S.A. legal training, and I am uncertain as to how to interpret some aspects of [[Conservapedia:Copyright]].&lt;br /&gt;
&lt;br /&gt;
Perhaps someone can answer these simple questions relating to Conservapedia articles (excluding pictures, talk pages, user pages, etc.):&lt;br /&gt;
&lt;br /&gt;
*Are Conservapedia articles in the public domain? &lt;br /&gt;
*Are Conservapedia articles copyrighted?&lt;br /&gt;
**If 'yes', who owns the copyrights? &lt;br /&gt;
&lt;br /&gt;
I would be grateful for some definitive answers. [[User:RolandPlankton|RolandPlankton]] 17:41, 23 April 2012 (EDT)&lt;/div&gt;</summary>
		<author><name>RolandPlankton</name></author>
	</entry>
	<entry>
		<id>https://www.conservapedia.com/index.php?title=Chomsky_hierarchy&amp;diff=977473</id>
		<title>Chomsky hierarchy</title>
		<link rel="alternate" type="text/html" href="https://www.conservapedia.com/index.php?title=Chomsky_hierarchy&amp;diff=977473"/>
		<updated>2012-04-23T20:07:48Z</updated>

		<summary type="html">&lt;p&gt;RolandPlankton: /* Example */ get the operators correct&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The '''Chomsky hierarchy''', sometimes known as the '''Chomsky-Schützenberger hierarchy''', is a hierarchy of formal grammatical systems for describing various classes of languages; the hierarchy can apply to both human and computer languages. This hierarchy was first published in 1956 by [[Noam Chomsky|Chomsky]].&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite journal &lt;br /&gt;
| title = Three models for the description of language &lt;br /&gt;
| year = 1956 &lt;br /&gt;
| last = Chomsky &lt;br /&gt;
| first = Noam &lt;br /&gt;
| journal = IRE Transactions on Information Theory &lt;br /&gt;
| volume = 2 &lt;br /&gt;
| pages = 113–124 &lt;br /&gt;
| url = http://www.chomsky.info/articles/195609--.pdf &lt;br /&gt;
| accessdate = 2012-04-08&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
These grammatical systems were referred to by Chomsky as ''transformational grammars''.  Other linguists have since developed a variety of similar grammars; together these are known as ''generative grammars''. &lt;br /&gt;
&lt;br /&gt;
The basic idea of a '''generative grammar''' is to provide a set of rules which are capable of generating all possible grammatical sentences in some language; the rules must constrain the generation so that only grammatical sentences are generated. The rules can also be used in reverse to parse a sentence and check if it is grammatical.&lt;br /&gt;
&lt;br /&gt;
==Example of a very simple generative grammar==&lt;br /&gt;
This very simple example can handle only a tiny subset of English and should not be taken seriously as a guide to English grammar or vocabulary. It is based on an example by David Crystal&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite book &lt;br /&gt;
| last = Crystal &lt;br /&gt;
| first = David  &lt;br /&gt;
| title = The Cambridge Encyclopedia of Language &lt;br /&gt;
| publisher = Cambridge University Press &lt;br /&gt;
| year = 1987 &lt;br /&gt;
| isbn = 0-521-42443-7&lt;br /&gt;
| pages = page 97&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; and is a slight extension of an example on slide 9 of this lecture.&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.cs.princeton.edu/~rywang/99f126/slides/16th.pdf&lt;br /&gt;
| title = Lecture notes: Formal Languages&lt;br /&gt;
| accessdate = 2012-04-07}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase''         # A ''Sentence'' consists of a ''NounPhrase'' followed by a ''VerbPhrase''&lt;br /&gt;
 ''NounPhrase'' -&amp;gt;  ''Determiner'' ''Noun''               # A ''NounPhrase'' consists of a ''Determiner'' followed by a ''Noun''&lt;br /&gt;
 ''VerbPhrase'' -&amp;gt;  ''Verb'' ''NounPhrase''               # A ''VerbPhrase'' consists of a ''Verb'' followed by a ''NounPhrase''&lt;br /&gt;
 ''Determiner'' -&amp;gt;  '''a''', '''the'''                        # A ''Determiner''  is one of: '''a''' or '''the'''&lt;br /&gt;
 ''Noun''       -&amp;gt;  '''boy''', '''girl''', '''dog'''                # A ''Noun'' is one of: '''boy''' or '''girl''' or '''dog'''  &lt;br /&gt;
 ''Verb''       -&amp;gt;  '''chased''', '''heard''', '''saw'''            # A ''Verb'' is one of: '''chased''' or '''heard''' or '''saw'''&lt;br /&gt;
&lt;br /&gt;
Notation used above: &lt;br /&gt;
:The symbol &amp;quot;-&amp;gt;&amp;quot; means &amp;quot;can be replaced by&amp;quot;.  &lt;br /&gt;
:When there are several items on the right hand side separated by commas, just one of these items can be selected. &lt;br /&gt;
:The comments preceded by &amp;quot;#&amp;quot; are not part of the generative grammar, but hopefully will help folks understand the example a little better.&lt;br /&gt;
&lt;br /&gt;
By making appropriate substitutions we can generate such sentences as:&lt;br /&gt;
:The dog chased a girl.&lt;br /&gt;
:The girl heard the dog.&lt;br /&gt;
:The boy saw a girl.&lt;br /&gt;
&lt;br /&gt;
The stages in the generation of these examples are as follows:&lt;br /&gt;
:''Sentence''&lt;br /&gt;
:-&amp;gt; ''NounPhrase'' ''VerbPhrase''&lt;br /&gt;
:-&amp;gt; ''Determiner'' ''Noun'' ''Verb'' ''NounPhrase''&lt;br /&gt;
:-&amp;gt; ''Determiner'' ''Noun'' ''Verb'' ''Determiner'' ''Noun''&lt;br /&gt;
&lt;br /&gt;
By appropriate selection of words to substitute for ''Determiner'', ''Noun'', and ''Verb'' we can produce the 3 example sentences above.&lt;br /&gt;
&lt;br /&gt;
The simple grammar defines a few words which can be substituted for ''Determiner'', ''Noun'', and ''Verb''. There are two possibilities for ''Determiner'', three for ''Noun'', and three for ''Verb'', with both ''Determiner'' and ''Noun'' appearing twice in the expansion. Hence the total number of grammatical sentences which can be generated by this simple grammar is 108 (= 2 * 3 * 3 * 2 * 3). In this particular case the possible words have been carefully chosen so that all of these 108 sentences also actually mean something.&lt;br /&gt;
&lt;br /&gt;
Note that the use of ''italics'' and '''boldface''' in this example is merely a convenient way of indicating the difference between items which can be expanded further (e.g. concepts such as ''NounPhrase'') and items which can not be expanded further (e.g. words such as '''girl'''). In the linguistic literature, items which can be expanded further are referred to as 'non-terminal' items, while items which can't be expanded further are known as 'terminal' items.&lt;br /&gt;
&lt;br /&gt;
The 'comma' notation for alternatives is a form of shorthand. In some formulations this would be shown as several separate rules, so that:&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''a''', '''the''' &lt;br /&gt;
could be shown as two rules:&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''a'''&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''the''' &lt;br /&gt;
&lt;br /&gt;
==Caution==&lt;br /&gt;
While a generative grammar may produce sentences which are grammatically correct, there is no certainty that such sentences will actually mean anything. The classic example of such a meaningless sentence is from Chomsky's book&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite book &lt;br /&gt;
| last = Chomsky &lt;br /&gt;
| first = Noam &lt;br /&gt;
| title = Syntactic Structures &lt;br /&gt;
| year = 1957 &lt;br /&gt;
| publisher = Mouton &lt;br /&gt;
| location = The Hague/Paris &lt;br /&gt;
| pages = page 15 &lt;br /&gt;
| isbn = 3-11-017279-8&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; with the grammatically correct sentence:&lt;br /&gt;
&lt;br /&gt;
:&amp;quot;Colorless green ideas sleep furiously.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
:This example illustrates the difference between grammar/syntax and meaning/semantics.&lt;br /&gt;
&lt;br /&gt;
Another problem when analysing a sentence is that many English words have multiple meanings, so that there may be more than one way to interpret a sentence. A simple example is the sentence: &lt;br /&gt;
:&amp;quot;Time flies.&amp;quot; &lt;br /&gt;
:Is this an instruction to check how fast flies are flying, or an indication that time appears to be passing quickly? &lt;br /&gt;
:A varied and entertaining selection of such ambiguities has been compiled by Jeff Gray.&amp;lt;ref&amp;gt;{{Cite web &lt;br /&gt;
| title = Collection of Ambiguous or Inconsistent/Incomplete Statements  &lt;br /&gt;
| url = http://www.gray-area.org/Research/Ambig/ &lt;br /&gt;
| author = Jeff Gray&lt;br /&gt;
| accessdate = 2012-04-10&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Formal grammar==&lt;br /&gt;
'''Note''': this section and subsequent sections are, by necessity, slightly more technical/formal than the earlier parts of this article, though specialist notation has been largely avoided. Make sure that you understand the 'Simple example' above before proceeding further, since references will be made to that example to help explain the technicalities, and variations on that example will be used to illustrate new ideas. An attempt has been made to avoid formal linguistic abbreviations and unexplained jargon.&lt;br /&gt;
&lt;br /&gt;
A formal generative grammar has four components (see slide 19 of this lecture&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://adammikeal.org/courses/compute/Chomsky%20Presentation.pdf&lt;br /&gt;
| title = The Chomsky Hierarchy&lt;br /&gt;
| accessdate = 2012-04-06&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
):&lt;br /&gt;
# a finite number of non-terminal concepts (e.g. ''VerbPhrase'' in the example, or anything else in ''italics''),&lt;br /&gt;
# a finite number of terminal items (e.g. '''girl''' in the example, or anything else in '''bold-face''').&lt;br /&gt;
# a finite set of rules for transforming non-terminal items (e.g. the example has 6 rules).&lt;br /&gt;
# a single starting point (e.g. ''Sentence'' in the example).&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
:Any item which appears on the left-hand side of a transformation rule is non-terminal since it can be replaced by something else; apart from the starting point, all other non-terminals must also appear somewhere on the right-hand side of transformation rule.&lt;br /&gt;
:An item which appears only on the right-hand side of a transformation rule is a terminal item, since it can not be transformed further.&lt;br /&gt;
:A list of all the terminal items is effectively the vocabulary from which sentences are built.&lt;br /&gt;
:Linguists have developed various classes of grammars by using constraints to govern what sort of rules can be used for any particular grammar.&lt;br /&gt;
&lt;br /&gt;
===Changing the rules===&lt;br /&gt;
An relatively small change to even a single rule can make a large change in the language which can be generated. For example, change the first rule in the simple example to read:&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''NounPhrase'' ''VerbPhrase'' '''and''' ''NounPhrase'' ''VerbPhrase''&lt;br /&gt;
This means that a ''Sentence'' is either a ''NounPhrase'' followed by a ''VerbPhrase'' or a ''NounPhrase'' followed by a ''VerbPhrase'' followed by '''and''' followed by a ''NounPhrase'' followed by a ''VerbPhrase''. In addition to the shorter sentences already discussed, this could also generate a sentence such as: &amp;quot;A dog saw a girl and the dog chased the girl&amp;quot;. The total number of grammatically-correct sentences which can be generated by this modified grammar is now 11,772 (108 + 108*108), though some of these may not be very meaingful.&lt;br /&gt;
&lt;br /&gt;
===Towards infinity===&lt;br /&gt;
A significantly different rule change can have an astounding effect. Consider changing the first rule to read:&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''NounPhrase'' ''VerbPhrase'' '''and''' ''Sentence''&lt;br /&gt;
This can generate a potentially infinite number of sentences (any number of these five-word sentences linked by '''and'''). This is an example of what is known as a [[Recursion|recursive]] definition, whereby a ''Sentence'' is partially defined in terms of itself. In such a recursive rule there must be at least one transformation option which does not involve ''Sentence'', otherwise the transformation could never stop.&lt;br /&gt;
&lt;br /&gt;
The above change is known as right-recursive; a left-recursive formulation is also possible, and can in this example generate exactly the same sentences.&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''Sentence'' '''and''' ''NounPhrase'' ''VerbPhrase'' &lt;br /&gt;
&lt;br /&gt;
The distinction between left- and right-recursive grammars becomes important when trying to parse/analyse a sentence; some types of parser work best with left-recursive grammars, while other types work best with right-recursive grammars. This distinction is particularly relevant in connection with [[compiler|compiling or translating]] a program written in some high-level [[programming language]] so that it can be used on a [[computer]].&lt;br /&gt;
&lt;br /&gt;
==Chomsky hierarchy==&lt;br /&gt;
By imposing different constraints&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.cs.uaf.edu/2011/spring/cs331/lectures/cs331_20110124_grammar.html&lt;br /&gt;
| title = Lecture notes: Languages &amp;amp; Grammars&lt;br /&gt;
| accessdate = 2012-04-07&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; &lt;br /&gt;
as to what sort of transformation rules could be used, Chomsky was able to define four strictly nested transformational grammars, which he numbered from 0 to 3. As the grammar number increases, the generated language becomes simpler. As the grammar number decreases, parsing a sentence in that language becomes more difficult. The following table provides a summary, which is then explained further in the subsequent subsections.&lt;br /&gt;
&lt;br /&gt;
In the late 1950's, [[John Backus]] and Peter Naur developed a notation for describing [[programming language]]s. This notation is known as Backus Naur Form (or BNF) and turns out to be equivalent to Chomsky's grammar number two (context-free grammar), although it was developed independently of Chomsky's work. Backus-Naur Form was first used in the Algol 60 Report to specify the syntax of Algol 60, and has since been used for specifying the syntax of other programming languages. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!| Chomsky&amp;lt;br&amp;gt;number || linguistic name || Rule constraints || Recogniser+ || Notes &lt;br /&gt;
|-&lt;br /&gt;
| 0 || recursively enumerable || [anything] -&amp;gt; [anything] || Turing machine || most human languages &lt;br /&gt;
|-&lt;br /&gt;
| 1 || context-sensitive || X ''A'' Y -&amp;gt; X [anything] Y || linear bounded automaton || X and Y provide the context in which ''A'' can be transformed &lt;br /&gt;
|-&lt;br /&gt;
| 2 || context-free || ''A'' -&amp;gt; [anything] || non-deterministic push-down automaton || syntax analysis for most programming languages &lt;br /&gt;
|-&lt;br /&gt;
| 3 || regular || ''A'' -&amp;gt; [nothing]&amp;lt;br&amp;gt;''A'' -&amp;gt; '''xyz'''&amp;lt;br&amp;gt;''A'' -&amp;gt; '''xyz''' ''B'' || finite automaton&amp;lt;br&amp;gt;or finite state machine || lexical analysis (combining characters into words/tokens)  &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''+''' The '''recogniser''' column indicates the type of mathematical or computer science theoretical model needed to recognise that a sentence belongs to a language, essentially by applying the transformation rules in reverse to work backwards from the actual words in order to finish up with a ''sentence'' (in programming languages the starting concept is usually a ''program''). A finite automaton uses only a small fixed amount of memory, operates in time proportional to the length of the input, and always reaches a decision, while a Turing machine may use an infinite amount of memory and time and may fail to reach a decision (may never stop).&lt;br /&gt;
&lt;br /&gt;
In the linguistic literature, [nothing] is often represented by the symbol '''ε'''.&lt;br /&gt;
&lt;br /&gt;
The descriptions of the various Chomsky levels which follows are presented in reverse order, so as to work up from a simple case to a rather complicated case.&lt;br /&gt;
&lt;br /&gt;
===Level 3: regular grammar===&lt;br /&gt;
The transformation rules for regular grammars are required to be very simple. &lt;br /&gt;
*Only a single non-terminal item can appear on the left-hand side of a rule.&lt;br /&gt;
*The right-hand side of any rule must be one of:&lt;br /&gt;
**[nothing].&lt;br /&gt;
**a terminal item.&lt;br /&gt;
**a terminal item followed by a non-terminal item.&lt;br /&gt;
Note that instead of a terminal item we could have a non-terminal item whose transformation rule immediately resolves to a single terminal item, or to one of several terminal items.&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
Informally we can define a 'word' as a sequence of one or more ''Letter''s. The following regular grammar provides a more formal definition; for simplicity it is restricted to lower-case letters.&lt;br /&gt;
&lt;br /&gt;
 ''Word''     -&amp;gt; ''Letter'' ''PartWord''&lt;br /&gt;
 ''PartWord'' -&amp;gt; [nothing]&lt;br /&gt;
 ''PartWord'' -&amp;gt; ''Letter'' ''PartWord''&lt;br /&gt;
 ''Letter''   -&amp;gt; '''a''', '''b''', ... '''z'''&lt;br /&gt;
&lt;br /&gt;
Note that ''PartWord'' is recursively defined, with the recursion stopping if it is transformed into [nothing].&lt;br /&gt;
&lt;br /&gt;
For one-letter words we expand as: &lt;br /&gt;
:''Word'' -&amp;gt; ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' [nothing] -&amp;gt; ''Letter''&lt;br /&gt;
&lt;br /&gt;
For two-letter words we expand as: &lt;br /&gt;
:''Word'' -&amp;gt; ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' ''Letter'' [nothing] -&amp;gt;  ''Letter'' ''Letter''&lt;br /&gt;
&lt;br /&gt;
Obviously, words of any length can be constructed, though they may well not actually be words from any language. &lt;br /&gt;
&lt;br /&gt;
====Discussion====&lt;br /&gt;
Trying to devise transformation rules to produce words which are more English-like is much more difficult - how do you insist on at least one vowel or on no more than 5 consecutive consonants (e.g. as in 'strengths').&lt;br /&gt;
&lt;br /&gt;
Further examples in [[Regular grammar]] show how numbers can be defined via a regular grammar, and also show how a hyphenated word could be defined.&lt;br /&gt;
&lt;br /&gt;
One of the limitations of a regular grammar is that it can't cope with nested matching brackets, so that it is impossible to write a regular grammar to describe an expression such as '''2 * (3+4)''' where that grammar is expected to allow brackets nested to any depth. A context-free grammar is needed for this, as described in the next section.&lt;br /&gt;
&lt;br /&gt;
Regular grammars or equivalent are widely used by [[compiler]]s in the lexical analysis of programming languages.&lt;br /&gt;
&lt;br /&gt;
===Level 2: context-free grammar===&lt;br /&gt;
The transformation rules for context-free grammars don't appear that much different from those for regular grammars. &lt;br /&gt;
*Only a single non-terminal item can appear on the left-hand side of a rule.&lt;br /&gt;
*The right-hand side of any rule must be one of:&lt;br /&gt;
**[nothing].&lt;br /&gt;
**any combination of terminal items and non-terminal items.&lt;br /&gt;
&lt;br /&gt;
The key difference is that in a regular grammar, any non-empty rule must effectively start with terminal item so that every rule transformation makes some immediate progress, while in a context-free grammar a rule could start with a non-terminal item which itself could be subject to arbitrary further transformations.&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
The following example shows how context-free grammars can cope with arithmetic expressions involving possibly nested brackets. Also an expression such as &amp;quot;2 + 3 * 4&amp;quot; could be interpreted as either &amp;quot;(2 + 3) * 4&amp;quot; or as &amp;quot;2 + (3 * 4)&amp;quot;. The latter interpretation is that which is normally used - multiplication &amp;quot;*&amp;quot; is said to have a higher priority than addition &amp;quot;+&amp;quot; - so the example also needs to incorporate this priority concept into the grammar. Furthermore, consecutive operators of the same priority are applied from left to right, so that &amp;quot;8 - 2 + 3&amp;quot; is normally interpreted as &amp;quot;(8 - 2) + 3&amp;quot; = 9, rather than as &amp;quot;8 - (2 + 3)&amp;quot; = 3.  This ordering must also be built in to the grammar.&lt;br /&gt;
&lt;br /&gt;
To avoid distracting side-issues, this example only deals with numbers which consist solely of a single digit. The example is a simplified version of the definition of an arithmetic expression given in the Revised Algol 60 Report (Section 3.3.1).&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.masswerk.at/algol60/report.htm&lt;br /&gt;
| title = Revised Report on the Algorithmic Language Algol 60&lt;br /&gt;
| accessdate = 2012-04-22&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 ''Expression'' -&amp;gt; ''Term''                        # an ''Expression'' is either a ''Term''&lt;br /&gt;
 ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''    #   or an ''Expression'' followed by '''+''' or '''-''' followed by a ''Term''&lt;br /&gt;
 ''Term''       -&amp;gt; ''Primary''                     # a ''Term'' is either a ''Primary''&lt;br /&gt;
 ''Term''       -&amp;gt; ''Term'' ''MulDivOp'' ''Primary''       #   or a ''Term'' followed by '''*''' or '''/''' followed by a ''Primary''&lt;br /&gt;
                                           #&lt;br /&gt;
 ''Primary''    -&amp;gt; ''Number''                      # a ''Primary'' is either a ''Number''&lt;br /&gt;
 ''Primary''    -&amp;gt; '''(''' ''Expression'' ''')'''              #   or an ''Expression'' enclosed in brackets&lt;br /&gt;
                                           #&lt;br /&gt;
 ''MulDivOp''   -&amp;gt; '''*'''. '''/'''                        # multiplication and division have the same priority&lt;br /&gt;
 ''AddSubOp''   -&amp;gt; '''+'''. '''-'''                        # addition and subtraction have the same priority&lt;br /&gt;
 ''Number''     -&amp;gt; '''0''', '''1''', ... '''9'''                 # this simple-minded definition of a ''Number'' is enough for this example&lt;br /&gt;
&lt;br /&gt;
===Level 1===&lt;br /&gt;
&lt;br /&gt;
===Level 0===&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[category:linguistics]]&lt;br /&gt;
[[Category:Computer Science]]&lt;/div&gt;</summary>
		<author><name>RolandPlankton</name></author>
	</entry>
	<entry>
		<id>https://www.conservapedia.com/index.php?title=User_talk:RolandPlankton&amp;diff=977432</id>
		<title>User talk:RolandPlankton</title>
		<link rel="alternate" type="text/html" href="https://www.conservapedia.com/index.php?title=User_talk:RolandPlankton&amp;diff=977432"/>
		<updated>2012-04-23T16:27:49Z</updated>

		<summary type="html">&lt;p&gt;RolandPlankton: /* Biased */ add Wikipedia copyright&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{welcome|sig=[[User:Joaquín Martínez|Joaquín Martínez]] 19:52, 21 March 2012 (EDT)}}&lt;br /&gt;
&lt;br /&gt;
==Rugby World Cup==&lt;br /&gt;
&lt;br /&gt;
Do you doubt the truth of the phrase you wanted cited? Its not a sentiment I share, and its bloody hard to find a cite for that sort of thing, but I don't think the sentiment is untrue for a casual fan.  I know from talking to non-rugby people that the low number of tries and the general style of play turns a lot of people off.  It doesn't turn me off, nor perhaps you, but I think it undisputable that it turns many off.  --[[User:DamianJohn|DamianJohn]] 17:30, 12 February 2012 (EST)&lt;br /&gt;
:Hi Damian, In [Rugby World Cup], the phrase &amp;quot;the sudden death nature of the later stages tend to produce dour rugby that is often unattractive to casual fans&amp;quot; may or may not be true, but it looks rather like opinion and contains vague words &amp;quot;tend to produce&amp;quot;, and hence needs to be attributed to someone. If no attribution can be found then the phrase should be deleted. I believe that this approach is in accordance with the Conservapedia Commandments and the Manual of Style. [[User:RolandPlankton|RolandPlankton]] 13:23, 13 February 2012 (EST)&lt;br /&gt;
::Well, perhaps, but there is also points 10 and 13 in the [http://www.conservapedia.com/Conservapedia:How_Conservapedia_Differs_from_Wikipedia differences with Wikipedia] page to consider which is appropriate here.  Remember also that on this website, personal conversations are a sufficient source [http://www.conservapedia.com/Essay:25_Worst_Court_Decisions#cite_note-8 for observations].  I do hear what you are saying, but I think that the claim being made is so obviously true, that the referencing standards of this website do not require a cite.  --[[User:DamianJohn|DamianJohn]] 13:32, 13 February 2012 (EST)&lt;br /&gt;
:::As someone who has a scientific background, I'm rather unhappy with the phrase 'obviously true', since there have been plenty of examples over the last 1000 years or so when what is 'obviously true' turns out to be false.  Another question: what is 'dour rugby'?  Unless you can provide an attribution I would suggest toning the comment down a little to read at the end: &amp;quot;turns some people off.&amp;quot; [[User:RolandPlankton|RolandPlankton]] 14:37, 13 February 2012 (EST)&lt;br /&gt;
&lt;br /&gt;
Pause in discussion please. I'm off on pilgrimage to the Holy Land for nearly 2 weeks. [[User:RolandPlankton|RolandPlankton]] 14:01, 14 February 2012 (EST)&lt;br /&gt;
:I wouldn't worry about it too much.  I don't think the rugby world cup article is high on the list of priorities for anyone here.  --[[User:DamianJohn|DamianJohn]] 17:08, 14 February 2012 (EST)&lt;br /&gt;
::I have added a citation for your reading pleasure.  Ps How is [http://en.wikipedia.org/wiki/Millennium_Stadium Cardiff Arms Park] these days?Or was it [http://en.wikipedia.org/wiki/Ellis_Park_Stadium Ellis Park], or even [http://en.wikipedia.org/wiki/Eden_Park Eden Park] you went to?  --[[User:DamianJohn|DamianJohn]] 00:45, 29 February 2012 (EST)&lt;br /&gt;
:::Fine re citation. For the 3 places you mention, the only one I've been to is Eden Park. [[User:RolandPlankton|RolandPlankton]] 17:56, 29 February 2012 (EST)&lt;br /&gt;
&lt;br /&gt;
==Articles worked on==&lt;br /&gt;
This list excludes trivial changes such as spelling, grammar, fixing references, and very minor tidying up.&lt;br /&gt;
&lt;br /&gt;
===Major changes made===&lt;br /&gt;
*[[Compilation]] &lt;br /&gt;
*[[Compiler]]&lt;br /&gt;
*[[Pi]] Still need to tidy up the section on Pi and the Bible.&lt;br /&gt;
*[[Programming language]]&lt;br /&gt;
&lt;br /&gt;
===Minor changes made===&lt;br /&gt;
*[[Generative grammar]] created this as a redirect to [[Chomsky hierarchy]]&lt;br /&gt;
&lt;br /&gt;
===Extensive discussion===&lt;br /&gt;
*[[Talk:Theory of relativity]] discussions re GPS and relativity&lt;br /&gt;
&lt;br /&gt;
==Articles currently being worked on==&lt;br /&gt;
*[[Chomsky hierarchy]] newly created, needs more detail&lt;br /&gt;
&lt;br /&gt;
==Articles to work on==&lt;br /&gt;
===Meaning===&lt;br /&gt;
*[[Backus-Naur Form]]&lt;br /&gt;
*[[BNF]] redirect to [[Backus-Naur Form]]&lt;br /&gt;
*[[Context-free grammar]] Add less formal introduction and explain more clearly with examples. Make BNF a separate article.&lt;br /&gt;
*[[Grammar]]&lt;br /&gt;
*[[Recursion]]&lt;br /&gt;
*[[Regular grammar]]&lt;br /&gt;
*[[Semantics]]&lt;br /&gt;
*[[Syntax]] currently a redirect to [[grammar]]; could we separate out 'syntax' as relating to computer languages, and 'grammar' as relating to human languages&lt;br /&gt;
&lt;br /&gt;
===Assorted===&lt;br /&gt;
*[[Anglican Communion]]&lt;br /&gt;
*[[Assembly line]]&lt;br /&gt;
*[[Bicycle]]&lt;br /&gt;
*[[Camping]]&lt;br /&gt;
*[[Castle]]&lt;br /&gt;
*[[Church of England]]&lt;br /&gt;
*[[Fantasy]]&lt;br /&gt;
*[[Philosophy of science]]&lt;br /&gt;
*[[Rail transport modelling]]&lt;br /&gt;
*[[Science fiction]]&lt;br /&gt;
*[[Tent]]&lt;br /&gt;
*[[The Hobbit]]&lt;br /&gt;
*[[The Lord of the Rings]]&lt;br /&gt;
*[[Tower of London]]&lt;br /&gt;
&lt;br /&gt;
===Biased===&lt;br /&gt;
Need to sort out myth from fact, possibly controversial.&lt;br /&gt;
*[[Evolution]]&lt;br /&gt;
*[[Intelligent design]]&lt;br /&gt;
*[[Pseudoscience]] &lt;br /&gt;
*[[Theory of relativity]]&lt;br /&gt;
*[[Wikipedia copyright]]&lt;br /&gt;
&lt;br /&gt;
===Computer-related===&lt;br /&gt;
*[[Algol 60]]&lt;br /&gt;
*[[Assembly language]]&lt;br /&gt;
*[[BASIC (programming language)]] &lt;br /&gt;
*[[C (programming language)]]&lt;br /&gt;
*[[Cobol]]&lt;br /&gt;
*[[Code maintenance]] could well be merged into [[Computer programming]]&lt;br /&gt;
*[[Computer]] distinguish hardware/software&lt;br /&gt;
*[[Computer program]] merge with [[Computer Program]], latter should be a redirect&lt;br /&gt;
*[[Computer programming]] currently a redirect to [[Computer Programming]], need to swap these over&lt;br /&gt;
*[[Computer science]]&lt;br /&gt;
*[[Computer software]] &lt;br /&gt;
*[[Fortran]]&lt;br /&gt;
*[[Hardware]] could be redirect to [[Computer]]&lt;br /&gt;
*[[Internet]]&lt;br /&gt;
*[[Interpreter (computing)]] &lt;br /&gt;
*[[Machine code]] could be part of [[Programming language]]&lt;br /&gt;
*[[Operating system]]&lt;br /&gt;
*[[Pascal (programming language)]] &lt;br /&gt;
*[[Pseudocode]]&lt;br /&gt;
*[[Software]] should be redirect to [[Computer software]]&lt;br /&gt;
*[[Source code]] could be merged into [[Programming language]]&lt;br /&gt;
*[[World Wide Web]]&lt;br /&gt;
&lt;br /&gt;
== Block ==&lt;br /&gt;
It seems that you were blocked in February... please be careful. --[[User:Joaquín Martínez|Joaquín Martínez]] 19:55, 21 March 2012 (EDT)&lt;br /&gt;
&lt;br /&gt;
: See: 14:23, 4 February 2012, Taj deleted &amp;quot;User:RolandPlankton&amp;quot; ‎ (Vandalism / parody). --[[User:JMR10|Joaquín Martínez]] 09:51, 22 March 2012 (EDT)&lt;br /&gt;
&lt;br /&gt;
::I believe that 4 February 2012 was when I first registered on Conservapedia. My user name was chosen in accordance with CP Guideline: &amp;quot;As a sign of good faith and accountability it is recommended that editors select a user name based on a permutation of their real name.&amp;quot;. Certainly my son was instantly able to recognise my user name as referring to me. [[User:RolandPlankton|RolandPlankton]] 10:02, 22 March 2012 (EDT)&lt;br /&gt;
&lt;br /&gt;
:::Hi, I just wanted to let you know that I answered your question on my talk page - I hope it clears up the misunderstanding. :-) Thanks, [[User:Taj|Taj]] 15:32, 22 March 2012 (EDT)&lt;br /&gt;
&lt;br /&gt;
:::Following is a copy of the answer referred to by Taj:&lt;br /&gt;
:::::Hello, thanks for the question, I looked into it. Please refer to this log: [http://www.conservapedia.com/index.php?title=Special%3ALog&amp;amp;type=delete&amp;amp;user=Taj&amp;amp;page=&amp;amp;year=&amp;amp;month=-1 Deletion Log] for explanation. It appears that on Feb 4, 2012, your User page and talk page were caught in a wave of vandalization along with several other users pages, and since you were a new user, and I, a new admin, apparently I deleted the page as opposed to reverting the offending edits. This had the effect of removing the edits in their entirety, so you were then able to recreate your own User page yourself. The action didn't substantially affect your page, however, I would probably choose to simply revert the edits if I were faced with this same situation today, with a little more experience as an Admin. I hope this clears up the matter, and apologize for any confusion created by this. Thank you for your continued contributions to Conservapedia! Blessings, [[User:Taj|Taj]] 12:50, 22 March 2012 (EDT). Copy made by [[User:RolandPlankton|RolandPlankton]] 16:03, 24 March 2012 (EDT)&lt;br /&gt;
&lt;br /&gt;
:::::: Godspeed! --[[User:Joaquín Martínez|Joaquín Martínez]] 16:41, 24 March 2012 (EDT)&lt;br /&gt;
&lt;br /&gt;
== Compiler ==&lt;br /&gt;
&lt;br /&gt;
I could fix no. 10 and 11; no. 12 has a wrong url. (Not Found). --[[User:Joaquín Martínez|Joaquín Martínez]] 13:19, 5 April 2012 (EDT)&lt;br /&gt;
&lt;br /&gt;
:Joaquin, thanks for your help. Following your example I've managed to correctly locate and sort out the remaining reference. [[User:RolandPlankton|RolandPlankton]] 14:32, 5 April 2012 (EDT)&lt;/div&gt;</summary>
		<author><name>RolandPlankton</name></author>
	</entry>
	<entry>
		<id>https://www.conservapedia.com/index.php?title=Chomsky_hierarchy&amp;diff=977431</id>
		<title>Chomsky hierarchy</title>
		<link rel="alternate" type="text/html" href="https://www.conservapedia.com/index.php?title=Chomsky_hierarchy&amp;diff=977431"/>
		<updated>2012-04-23T16:16:53Z</updated>

		<summary type="html">&lt;p&gt;RolandPlankton: /* Example */ add comments to formal grammar&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The '''Chomsky hierarchy''', sometimes known as the '''Chomsky-Schützenberger hierarchy''', is a hierarchy of formal grammatical systems for describing various classes of languages; the hierarchy can apply to both human and computer languages. This hierarchy was first published in 1956 by [[Noam Chomsky|Chomsky]].&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite journal &lt;br /&gt;
| title = Three models for the description of language &lt;br /&gt;
| year = 1956 &lt;br /&gt;
| last = Chomsky &lt;br /&gt;
| first = Noam &lt;br /&gt;
| journal = IRE Transactions on Information Theory &lt;br /&gt;
| volume = 2 &lt;br /&gt;
| pages = 113–124 &lt;br /&gt;
| url = http://www.chomsky.info/articles/195609--.pdf &lt;br /&gt;
| accessdate = 2012-04-08&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
These grammatical systems were referred to by Chomsky as ''transformational grammars''.  Other linguists have since developed a variety of similar grammars; together these are known as ''generative grammars''. &lt;br /&gt;
&lt;br /&gt;
The basic idea of a '''generative grammar''' is to provide a set of rules which are capable of generating all possible grammatical sentences in some language; the rules must constrain the generation so that only grammatical sentences are generated. The rules can also be used in reverse to parse a sentence and check if it is grammatical.&lt;br /&gt;
&lt;br /&gt;
==Example of a very simple generative grammar==&lt;br /&gt;
This very simple example can handle only a tiny subset of English and should not be taken seriously as a guide to English grammar or vocabulary. It is based on an example by David Crystal&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite book &lt;br /&gt;
| last = Crystal &lt;br /&gt;
| first = David  &lt;br /&gt;
| title = The Cambridge Encyclopedia of Language &lt;br /&gt;
| publisher = Cambridge University Press &lt;br /&gt;
| year = 1987 &lt;br /&gt;
| isbn = 0-521-42443-7&lt;br /&gt;
| pages = page 97&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; and is a slight extension of an example on slide 9 of this lecture.&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.cs.princeton.edu/~rywang/99f126/slides/16th.pdf&lt;br /&gt;
| title = Lecture notes: Formal Languages&lt;br /&gt;
| accessdate = 2012-04-07}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase''         # A ''Sentence'' consists of a ''NounPhrase'' followed by a ''VerbPhrase''&lt;br /&gt;
 ''NounPhrase'' -&amp;gt;  ''Determiner'' ''Noun''               # A ''NounPhrase'' consists of a ''Determiner'' followed by a ''Noun''&lt;br /&gt;
 ''VerbPhrase'' -&amp;gt;  ''Verb'' ''NounPhrase''               # A ''VerbPhrase'' consists of a ''Verb'' followed by a ''NounPhrase''&lt;br /&gt;
 ''Determiner'' -&amp;gt;  '''a''', '''the'''                        # A ''Determiner''  is one of: '''a''' or '''the'''&lt;br /&gt;
 ''Noun''       -&amp;gt;  '''boy''', '''girl''', '''dog'''                # A ''Noun'' is one of: '''boy''' or '''girl''' or '''dog'''  &lt;br /&gt;
 ''Verb''       -&amp;gt;  '''chased''', '''heard''', '''saw'''            # A ''Verb'' is one of: '''chased''' or '''heard''' or '''saw'''&lt;br /&gt;
&lt;br /&gt;
Notation used above: &lt;br /&gt;
:The symbol &amp;quot;-&amp;gt;&amp;quot; means &amp;quot;can be replaced by&amp;quot;.  &lt;br /&gt;
:When there are several items on the right hand side separated by commas, just one of these items can be selected. &lt;br /&gt;
:The comments preceded by &amp;quot;#&amp;quot; are not part of the generative grammar, but hopefully will help folks understand the example a little better.&lt;br /&gt;
&lt;br /&gt;
By making appropriate substitutions we can generate such sentences as:&lt;br /&gt;
:The dog chased a girl.&lt;br /&gt;
:The girl heard the dog.&lt;br /&gt;
:The boy saw a girl.&lt;br /&gt;
&lt;br /&gt;
The stages in the generation of these examples are as follows:&lt;br /&gt;
:''Sentence''&lt;br /&gt;
:-&amp;gt; ''NounPhrase'' ''VerbPhrase''&lt;br /&gt;
:-&amp;gt; ''Determiner'' ''Noun'' ''Verb'' ''NounPhrase''&lt;br /&gt;
:-&amp;gt; ''Determiner'' ''Noun'' ''Verb'' ''Determiner'' ''Noun''&lt;br /&gt;
&lt;br /&gt;
By appropriate selection of words to substitute for ''Determiner'', ''Noun'', and ''Verb'' we can produce the 3 example sentences above.&lt;br /&gt;
&lt;br /&gt;
The simple grammar defines a few words which can be substituted for ''Determiner'', ''Noun'', and ''Verb''. There are two possibilities for ''Determiner'', three for ''Noun'', and three for ''Verb'', with both ''Determiner'' and ''Noun'' appearing twice in the expansion. Hence the total number of grammatical sentences which can be generated by this simple grammar is 108 (= 2 * 3 * 3 * 2 * 3). In this particular case the possible words have been carefully chosen so that all of these 108 sentences also actually mean something.&lt;br /&gt;
&lt;br /&gt;
Note that the use of ''italics'' and '''boldface''' in this example is merely a convenient way of indicating the difference between items which can be expanded further (e.g. concepts such as ''NounPhrase'') and items which can not be expanded further (e.g. words such as '''girl'''). In the linguistic literature, items which can be expanded further are referred to as 'non-terminal' items, while items which can't be expanded further are known as 'terminal' items.&lt;br /&gt;
&lt;br /&gt;
The 'comma' notation for alternatives is a form of shorthand. In some formulations this would be shown as several separate rules, so that:&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''a''', '''the''' &lt;br /&gt;
could be shown as two rules:&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''a'''&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''the''' &lt;br /&gt;
&lt;br /&gt;
==Caution==&lt;br /&gt;
While a generative grammar may produce sentences which are grammatically correct, there is no certainty that such sentences will actually mean anything. The classic example of such a meaningless sentence is from Chomsky's book&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite book &lt;br /&gt;
| last = Chomsky &lt;br /&gt;
| first = Noam &lt;br /&gt;
| title = Syntactic Structures &lt;br /&gt;
| year = 1957 &lt;br /&gt;
| publisher = Mouton &lt;br /&gt;
| location = The Hague/Paris &lt;br /&gt;
| pages = page 15 &lt;br /&gt;
| isbn = 3-11-017279-8&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; with the grammatically correct sentence:&lt;br /&gt;
&lt;br /&gt;
:&amp;quot;Colorless green ideas sleep furiously.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
:This example illustrates the difference between grammar/syntax and meaning/semantics.&lt;br /&gt;
&lt;br /&gt;
Another problem when analysing a sentence is that many English words have multiple meanings, so that there may be more than one way to interpret a sentence. A simple example is the sentence: &lt;br /&gt;
:&amp;quot;Time flies.&amp;quot; &lt;br /&gt;
:Is this an instruction to check how fast flies are flying, or an indication that time appears to be passing quickly? &lt;br /&gt;
:A varied and entertaining selection of such ambiguities has been compiled by Jeff Gray.&amp;lt;ref&amp;gt;{{Cite web &lt;br /&gt;
| title = Collection of Ambiguous or Inconsistent/Incomplete Statements  &lt;br /&gt;
| url = http://www.gray-area.org/Research/Ambig/ &lt;br /&gt;
| author = Jeff Gray&lt;br /&gt;
| accessdate = 2012-04-10&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Formal grammar==&lt;br /&gt;
'''Note''': this section and subsequent sections are, by necessity, slightly more technical/formal than the earlier parts of this article, though specialist notation has been largely avoided. Make sure that you understand the 'Simple example' above before proceeding further, since references will be made to that example to help explain the technicalities, and variations on that example will be used to illustrate new ideas. An attempt has been made to avoid formal linguistic abbreviations and unexplained jargon.&lt;br /&gt;
&lt;br /&gt;
A formal generative grammar has four components (see slide 19 of this lecture&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://adammikeal.org/courses/compute/Chomsky%20Presentation.pdf&lt;br /&gt;
| title = The Chomsky Hierarchy&lt;br /&gt;
| accessdate = 2012-04-06&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
):&lt;br /&gt;
# a finite number of non-terminal concepts (e.g. ''VerbPhrase'' in the example, or anything else in ''italics''),&lt;br /&gt;
# a finite number of terminal items (e.g. '''girl''' in the example, or anything else in '''bold-face''').&lt;br /&gt;
# a finite set of rules for transforming non-terminal items (e.g. the example has 6 rules).&lt;br /&gt;
# a single starting point (e.g. ''Sentence'' in the example).&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
:Any item which appears on the left-hand side of a transformation rule is non-terminal since it can be replaced by something else; apart from the starting point, all other non-terminals must also appear somewhere on the right-hand side of transformation rule.&lt;br /&gt;
:An item which appears only on the right-hand side of a transformation rule is a terminal item, since it can not be transformed further.&lt;br /&gt;
:A list of all the terminal items is effectively the vocabulary from which sentences are built.&lt;br /&gt;
:Linguists have developed various classes of grammars by using constraints to govern what sort of rules can be used for any particular grammar.&lt;br /&gt;
&lt;br /&gt;
===Changing the rules===&lt;br /&gt;
An relatively small change to even a single rule can make a large change in the language which can be generated. For example, change the first rule in the simple example to read:&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''NounPhrase'' ''VerbPhrase'' '''and''' ''NounPhrase'' ''VerbPhrase''&lt;br /&gt;
This means that a ''Sentence'' is either a ''NounPhrase'' followed by a ''VerbPhrase'' or a ''NounPhrase'' followed by a ''VerbPhrase'' followed by '''and''' followed by a ''NounPhrase'' followed by a ''VerbPhrase''. In addition to the shorter sentences already discussed, this could also generate a sentence such as: &amp;quot;A dog saw a girl and the dog chased the girl&amp;quot;. The total number of grammatically-correct sentences which can be generated by this modified grammar is now 11,772 (108 + 108*108), though some of these may not be very meaingful.&lt;br /&gt;
&lt;br /&gt;
===Towards infinity===&lt;br /&gt;
A significantly different rule change can have an astounding effect. Consider changing the first rule to read:&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''NounPhrase'' ''VerbPhrase'' '''and''' ''Sentence''&lt;br /&gt;
This can generate a potentially infinite number of sentences (any number of these five-word sentences linked by '''and'''). This is an example of what is known as a [[Recursion|recursive]] definition, whereby a ''Sentence'' is partially defined in terms of itself. In such a recursive rule there must be at least one transformation option which does not involve ''Sentence'', otherwise the transformation could never stop.&lt;br /&gt;
&lt;br /&gt;
The above change is known as right-recursive; a left-recursive formulation is also possible, and can in this example generate exactly the same sentences.&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''Sentence'' '''and''' ''NounPhrase'' ''VerbPhrase'' &lt;br /&gt;
&lt;br /&gt;
The distinction between left- and right-recursive grammars becomes important when trying to parse/analyse a sentence; some types of parser work best with left-recursive grammars, while other types work best with right-recursive grammars. This distinction is particularly relevant in connection with [[compiler|compiling or translating]] a program written in some high-level [[programming language]] so that it can be used on a [[computer]].&lt;br /&gt;
&lt;br /&gt;
==Chomsky hierarchy==&lt;br /&gt;
By imposing different constraints&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.cs.uaf.edu/2011/spring/cs331/lectures/cs331_20110124_grammar.html&lt;br /&gt;
| title = Lecture notes: Languages &amp;amp; Grammars&lt;br /&gt;
| accessdate = 2012-04-07&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; &lt;br /&gt;
as to what sort of transformation rules could be used, Chomsky was able to define four strictly nested transformational grammars, which he numbered from 0 to 3. As the grammar number increases, the generated language becomes simpler. As the grammar number decreases, parsing a sentence in that language becomes more difficult. The following table provides a summary, which is then explained further in the subsequent subsections.&lt;br /&gt;
&lt;br /&gt;
In the late 1950's, [[John Backus]] and Peter Naur developed a notation for describing [[programming language]]s. This notation is known as Backus Naur Form (or BNF) and turns out to be equivalent to Chomsky's grammar number two (context-free grammar), although it was developed independently of Chomsky's work. Backus-Naur Form was first used in the Algol 60 Report to specify the syntax of Algol 60, and has since been used for specifying the syntax of other programming languages. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!| Chomsky&amp;lt;br&amp;gt;number || linguistic name || Rule constraints || Recogniser+ || Notes &lt;br /&gt;
|-&lt;br /&gt;
| 0 || recursively enumerable || [anything] -&amp;gt; [anything] || Turing machine || most human languages &lt;br /&gt;
|-&lt;br /&gt;
| 1 || context-sensitive || X ''A'' Y -&amp;gt; X [anything] Y || linear bounded automaton || X and Y provide the context in which ''A'' can be transformed &lt;br /&gt;
|-&lt;br /&gt;
| 2 || context-free || ''A'' -&amp;gt; [anything] || non-deterministic push-down automaton || syntax analysis for most programming languages &lt;br /&gt;
|-&lt;br /&gt;
| 3 || regular || ''A'' -&amp;gt; [nothing]&amp;lt;br&amp;gt;''A'' -&amp;gt; '''xyz'''&amp;lt;br&amp;gt;''A'' -&amp;gt; '''xyz''' ''B'' || finite automaton&amp;lt;br&amp;gt;or finite state machine || lexical analysis (combining characters into words/tokens)  &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''+''' The '''recogniser''' column indicates the type of mathematical or computer science theoretical model needed to recognise that a sentence belongs to a language, essentially by applying the transformation rules in reverse to work backwards from the actual words in order to finish up with a ''sentence'' (in programming languages the starting concept is usually a ''program''). A finite automaton uses only a small fixed amount of memory, operates in time proportional to the length of the input, and always reaches a decision, while a Turing machine may use an infinite amount of memory and time and may fail to reach a decision (may never stop).&lt;br /&gt;
&lt;br /&gt;
In the linguistic literature, [nothing] is often represented by the symbol '''ε'''.&lt;br /&gt;
&lt;br /&gt;
The descriptions of the various Chomsky levels which follows are presented in reverse order, so as to work up from a simple case to a rather complicated case.&lt;br /&gt;
&lt;br /&gt;
===Level 3: regular grammar===&lt;br /&gt;
The transformation rules for regular grammars are required to be very simple. &lt;br /&gt;
*Only a single non-terminal item can appear on the left-hand side of a rule.&lt;br /&gt;
*The right-hand side of any rule must be one of:&lt;br /&gt;
**[nothing].&lt;br /&gt;
**a terminal item.&lt;br /&gt;
**a terminal item followed by a non-terminal item.&lt;br /&gt;
Note that instead of a terminal item we could have a non-terminal item whose transformation rule immediately resolves to a single terminal item, or to one of several terminal items.&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
Informally we can define a 'word' as a sequence of one or more ''Letter''s. The following regular grammar provides a more formal definition; for simplicity it is restricted to lower-case letters.&lt;br /&gt;
&lt;br /&gt;
 ''Word''     -&amp;gt; ''Letter'' ''PartWord''&lt;br /&gt;
 ''PartWord'' -&amp;gt; [nothing]&lt;br /&gt;
 ''PartWord'' -&amp;gt; ''Letter'' ''PartWord''&lt;br /&gt;
 ''Letter''   -&amp;gt; '''a''', '''b''', ... '''z'''&lt;br /&gt;
&lt;br /&gt;
Note that ''PartWord'' is recursively defined, with the recursion stopping if it is transformed into [nothing].&lt;br /&gt;
&lt;br /&gt;
For one-letter words we expand as: &lt;br /&gt;
:''Word'' -&amp;gt; ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' [nothing] -&amp;gt; ''Letter''&lt;br /&gt;
&lt;br /&gt;
For two-letter words we expand as: &lt;br /&gt;
:''Word'' -&amp;gt; ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' ''Letter'' [nothing] -&amp;gt;  ''Letter'' ''Letter''&lt;br /&gt;
&lt;br /&gt;
Obviously, words of any length can be constructed, though they may well not actually be words from any language. &lt;br /&gt;
&lt;br /&gt;
====Discussion====&lt;br /&gt;
Trying to devise transformation rules to produce words which are more English-like is much more difficult - how do you insist on at least one vowel or on no more than 5 consecutive consonants (e.g. as in 'strengths').&lt;br /&gt;
&lt;br /&gt;
Further examples in [[Regular grammar]] show how numbers can be defined via a regular grammar, and also show how a hyphenated word could be defined.&lt;br /&gt;
&lt;br /&gt;
One of the limitations of a regular grammar is that it can't cope with nested matching brackets, so that it is impossible to write a regular grammar to describe an expression such as '''2 * (3+4)''' where that grammar is expected to allow brackets nested to any depth. A context-free grammar is needed for this, as described in the next section.&lt;br /&gt;
&lt;br /&gt;
Regular grammars or equivalent are widely used by [[compiler]]s in the lexical analysis of programming languages.&lt;br /&gt;
&lt;br /&gt;
===Level 2: context-free grammar===&lt;br /&gt;
The transformation rules for context-free grammars don't appear that much different from those for regular grammars. &lt;br /&gt;
*Only a single non-terminal item can appear on the left-hand side of a rule.&lt;br /&gt;
*The right-hand side of any rule must be one of:&lt;br /&gt;
**[nothing].&lt;br /&gt;
**any combination of terminal items and non-terminal items.&lt;br /&gt;
&lt;br /&gt;
The key difference is that in a regular grammar, any non-empty rule must effectively start with terminal item so that every rule transformation makes some immediate progress, while in a context-free grammar a rule could start with a non-terminal item which itself could be subject to arbitrary further transformations.&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
The following example shows how context-free grammars can cope with arithmetic expressions involving possibly nested brackets. Also an expression such as &amp;quot;2 + 3 * 4&amp;quot; could be interpreted as either &amp;quot;(2 + 3) * 4&amp;quot; or as &amp;quot;2 + (3 * 4)&amp;quot;. The latter interpretation is that which is normally used - multiplication &amp;quot;*&amp;quot; is said to have a higher priority than addition &amp;quot;+&amp;quot; - so the example also needs to incorporate this priority concept into the grammar. Furthermore, consecutive operators of the same priority are applied from left to right, so that &amp;quot;8 - 2 + 3&amp;quot; is normally interpreted as &amp;quot;(8 - 2) + 3&amp;quot; = 9, rather than as &amp;quot;8 - (2 + 3)&amp;quot; = 3.  This ordering must also be built in to the grammar.&lt;br /&gt;
&lt;br /&gt;
To avoid distracting side-issues, this example only deals with numbers which consist solely of a single digit. The example is a simplified version of the definition of an arithmetic expression given in the Revised Algol 60 Report (Section 3.3.1).&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.masswerk.at/algol60/report.htm&lt;br /&gt;
| title = Revised Report on the Algorithmic Language Algol 60&lt;br /&gt;
| accessdate = 2012-04-22&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 ''Expression'' -&amp;gt; ''Term''                        # an ''Expression'' is either a ''Term''&lt;br /&gt;
 ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''    #   or an ''Expression'' followed by '''*''' or '''/''' followed by a ''Term''&lt;br /&gt;
 ''Term''       -&amp;gt; ''Primary''                     # a ''Term'' is either a ''Primary''&lt;br /&gt;
 ''Term''       -&amp;gt; ''Term'' ''MulDivOp'' ''Primary''       #   or a ''Term'' followed by '''+''' or '''-''' followed by a ''Primary''&lt;br /&gt;
                                           #&lt;br /&gt;
 ''Primary''    -&amp;gt; ''Number''                      # a ''Primary'' is either a ''Number''&lt;br /&gt;
 ''Primary''    -&amp;gt; '''(''' ''Expression'' ''')'''              #   or an ''Expression'' enclosed in brackets&lt;br /&gt;
                                           #&lt;br /&gt;
 ''MulDivOp''   -&amp;gt; '''*'''. '''/'''                        # multiplication and division have the same priority&lt;br /&gt;
 ''AddSubOp''   -&amp;gt; '''+'''. '''-'''                        # addition and subtraction have the same priority&lt;br /&gt;
 ''Number''     -&amp;gt; '''0''', '''1''', ... '''9'''                 # this simple-minded definition of a ''Number'' is enough for this example&lt;br /&gt;
&lt;br /&gt;
===Level 1===&lt;br /&gt;
&lt;br /&gt;
===Level 0===&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[category:linguistics]]&lt;br /&gt;
[[Category:Computer Science]]&lt;/div&gt;</summary>
		<author><name>RolandPlankton</name></author>
	</entry>
	<entry>
		<id>https://www.conservapedia.com/index.php?title=Chomsky_hierarchy&amp;diff=977238</id>
		<title>Chomsky hierarchy</title>
		<link rel="alternate" type="text/html" href="https://www.conservapedia.com/index.php?title=Chomsky_hierarchy&amp;diff=977238"/>
		<updated>2012-04-22T20:21:04Z</updated>

		<summary type="html">&lt;p&gt;RolandPlankton: /* =Level 0 */ get the subsection names correct&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The '''Chomsky hierarchy''', sometimes known as the '''Chomsky-Schützenberger hierarchy''', is a hierarchy of formal grammatical systems for describing various classes of languages; the hierarchy can apply to both human and computer languages. This hierarchy was first published in 1956 by [[Noam Chomsky|Chomsky]].&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite journal &lt;br /&gt;
| title = Three models for the description of language &lt;br /&gt;
| year = 1956 &lt;br /&gt;
| last = Chomsky &lt;br /&gt;
| first = Noam &lt;br /&gt;
| journal = IRE Transactions on Information Theory &lt;br /&gt;
| volume = 2 &lt;br /&gt;
| pages = 113–124 &lt;br /&gt;
| url = http://www.chomsky.info/articles/195609--.pdf &lt;br /&gt;
| accessdate = 2012-04-08&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
These grammatical systems were referred to by Chomsky as ''transformational grammars''.  Other linguists have since developed a variety of similar grammars; together these are known as ''generative grammars''. &lt;br /&gt;
&lt;br /&gt;
The basic idea of a '''generative grammar''' is to provide a set of rules which are capable of generating all possible grammatical sentences in some language; the rules must constrain the generation so that only grammatical sentences are generated. The rules can also be used in reverse to parse a sentence and check if it is grammatical.&lt;br /&gt;
&lt;br /&gt;
==Example of a very simple generative grammar==&lt;br /&gt;
This very simple example can handle only a tiny subset of English and should not be taken seriously as a guide to English grammar or vocabulary. It is based on an example by David Crystal&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite book &lt;br /&gt;
| last = Crystal &lt;br /&gt;
| first = David  &lt;br /&gt;
| title = The Cambridge Encyclopedia of Language &lt;br /&gt;
| publisher = Cambridge University Press &lt;br /&gt;
| year = 1987 &lt;br /&gt;
| isbn = 0-521-42443-7&lt;br /&gt;
| pages = page 97&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; and is a slight extension of an example on slide 9 of this lecture.&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.cs.princeton.edu/~rywang/99f126/slides/16th.pdf&lt;br /&gt;
| title = Lecture notes: Formal Languages&lt;br /&gt;
| accessdate = 2012-04-07}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase''         # A ''Sentence'' consists of a ''NounPhrase'' followed by a ''VerbPhrase''&lt;br /&gt;
 ''NounPhrase'' -&amp;gt;  ''Determiner'' ''Noun''               # A ''NounPhrase'' consists of a ''Determiner'' followed by a ''Noun''&lt;br /&gt;
 ''VerbPhrase'' -&amp;gt;  ''Verb'' ''NounPhrase''               # A ''VerbPhrase'' consists of a ''Verb'' followed by a ''NounPhrase''&lt;br /&gt;
 ''Determiner'' -&amp;gt;  '''a''', '''the'''                        # A ''Determiner''  is one of: '''a''' or '''the'''&lt;br /&gt;
 ''Noun''       -&amp;gt;  '''boy''', '''girl''', '''dog'''                # A ''Noun'' is one of: '''boy''' or '''girl''' or '''dog'''  &lt;br /&gt;
 ''Verb''       -&amp;gt;  '''chased''', '''heard''', '''saw'''            # A ''Verb'' is one of: '''chased''' or '''heard''' or '''saw'''&lt;br /&gt;
&lt;br /&gt;
Notation used above: &lt;br /&gt;
:The symbol &amp;quot;-&amp;gt;&amp;quot; means &amp;quot;can be replaced by&amp;quot;.  &lt;br /&gt;
:When there are several items on the right hand side separated by commas, just one of these items can be selected. &lt;br /&gt;
:The comments preceded by &amp;quot;#&amp;quot; are not part of the generative grammar, but hopefully will help folks understand the example a little better.&lt;br /&gt;
&lt;br /&gt;
By making appropriate substitutions we can generate such sentences as:&lt;br /&gt;
:The dog chased a girl.&lt;br /&gt;
:The girl heard the dog.&lt;br /&gt;
:The boy saw a girl.&lt;br /&gt;
&lt;br /&gt;
The stages in the generation of these examples are as follows:&lt;br /&gt;
:''Sentence''&lt;br /&gt;
:-&amp;gt; ''NounPhrase'' ''VerbPhrase''&lt;br /&gt;
:-&amp;gt; ''Determiner'' ''Noun'' ''Verb'' ''NounPhrase''&lt;br /&gt;
:-&amp;gt; ''Determiner'' ''Noun'' ''Verb'' ''Determiner'' ''Noun''&lt;br /&gt;
&lt;br /&gt;
By appropriate selection of words to substitute for ''Determiner'', ''Noun'', and ''Verb'' we can produce the 3 example sentences above.&lt;br /&gt;
&lt;br /&gt;
The simple grammar defines a few words which can be substituted for ''Determiner'', ''Noun'', and ''Verb''. There are two possibilities for ''Determiner'', three for ''Noun'', and three for ''Verb'', with both ''Determiner'' and ''Noun'' appearing twice in the expansion. Hence the total number of grammatical sentences which can be generated by this simple grammar is 108 (= 2 * 3 * 3 * 2 * 3). In this particular case the possible words have been carefully chosen so that all of these 108 sentences also actually mean something.&lt;br /&gt;
&lt;br /&gt;
Note that the use of ''italics'' and '''boldface''' in this example is merely a convenient way of indicating the difference between items which can be expanded further (e.g. concepts such as ''NounPhrase'') and items which can not be expanded further (e.g. words such as '''girl'''). In the linguistic literature, items which can be expanded further are referred to as 'non-terminal' items, while items which can't be expanded further are known as 'terminal' items.&lt;br /&gt;
&lt;br /&gt;
The 'comma' notation for alternatives is a form of shorthand. In some formulations this would be shown as several separate rules, so that:&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''a''', '''the''' &lt;br /&gt;
could be shown as two rules:&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''a'''&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''the''' &lt;br /&gt;
&lt;br /&gt;
==Caution==&lt;br /&gt;
While a generative grammar may produce sentences which are grammatically correct, there is no certainty that such sentences will actually mean anything. The classic example of such a meaningless sentence is from Chomsky's book&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite book &lt;br /&gt;
| last = Chomsky &lt;br /&gt;
| first = Noam &lt;br /&gt;
| title = Syntactic Structures &lt;br /&gt;
| year = 1957 &lt;br /&gt;
| publisher = Mouton &lt;br /&gt;
| location = The Hague/Paris &lt;br /&gt;
| pages = page 15 &lt;br /&gt;
| isbn = 3-11-017279-8&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; with the grammatically correct sentence:&lt;br /&gt;
&lt;br /&gt;
:&amp;quot;Colorless green ideas sleep furiously.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
:This example illustrates the difference between grammar/syntax and meaning/semantics.&lt;br /&gt;
&lt;br /&gt;
Another problem when analysing a sentence is that many English words have multiple meanings, so that there may be more than one way to interpret a sentence. A simple example is the sentence: &lt;br /&gt;
:&amp;quot;Time flies.&amp;quot; &lt;br /&gt;
:Is this an instruction to check how fast flies are flying, or an indication that time appears to be passing quickly? &lt;br /&gt;
:A varied and entertaining selection of such ambiguities has been compiled by Jeff Gray.&amp;lt;ref&amp;gt;{{Cite web &lt;br /&gt;
| title = Collection of Ambiguous or Inconsistent/Incomplete Statements  &lt;br /&gt;
| url = http://www.gray-area.org/Research/Ambig/ &lt;br /&gt;
| author = Jeff Gray&lt;br /&gt;
| accessdate = 2012-04-10&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Formal grammar==&lt;br /&gt;
'''Note''': this section and subsequent sections are, by necessity, slightly more technical/formal than the earlier parts of this article, though specialist notation has been largely avoided. Make sure that you understand the 'Simple example' above before proceeding further, since references will be made to that example to help explain the technicalities, and variations on that example will be used to illustrate new ideas. An attempt has been made to avoid formal linguistic abbreviations and unexplained jargon.&lt;br /&gt;
&lt;br /&gt;
A formal generative grammar has four components (see slide 19 of this lecture&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://adammikeal.org/courses/compute/Chomsky%20Presentation.pdf&lt;br /&gt;
| title = The Chomsky Hierarchy&lt;br /&gt;
| accessdate = 2012-04-06&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
):&lt;br /&gt;
# a finite number of non-terminal concepts (e.g. ''VerbPhrase'' in the example, or anything else in ''italics''),&lt;br /&gt;
# a finite number of terminal items (e.g. '''girl''' in the example, or anything else in '''bold-face''').&lt;br /&gt;
# a finite set of rules for transforming non-terminal items (e.g. the example has 6 rules).&lt;br /&gt;
# a single starting point (e.g. ''Sentence'' in the example).&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
:Any item which appears on the left-hand side of a transformation rule is non-terminal since it can be replaced by something else; apart from the starting point, all other non-terminals must also appear somewhere on the right-hand side of transformation rule.&lt;br /&gt;
:An item which appears only on the right-hand side of a transformation rule is a terminal item, since it can not be transformed further.&lt;br /&gt;
:A list of all the terminal items is effectively the vocabulary from which sentences are built.&lt;br /&gt;
:Linguists have developed various classes of grammars by using constraints to govern what sort of rules can be used for any particular grammar.&lt;br /&gt;
&lt;br /&gt;
===Changing the rules===&lt;br /&gt;
An relatively small change to even a single rule can make a large change in the language which can be generated. For example, change the first rule in the simple example to read:&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''NounPhrase'' ''VerbPhrase'' '''and''' ''NounPhrase'' ''VerbPhrase''&lt;br /&gt;
This means that a ''Sentence'' is either a ''NounPhrase'' followed by a ''VerbPhrase'' or a ''NounPhrase'' followed by a ''VerbPhrase'' followed by '''and''' followed by a ''NounPhrase'' followed by a ''VerbPhrase''. In addition to the shorter sentences already discussed, this could also generate a sentence such as: &amp;quot;A dog saw a girl and the dog chased the girl&amp;quot;. The total number of grammatically-correct sentences which can be generated by this modified grammar is now 11,772 (108 + 108*108), though some of these may not be very meaingful.&lt;br /&gt;
&lt;br /&gt;
===Towards infinity===&lt;br /&gt;
A significantly different rule change can have an astounding effect. Consider changing the first rule to read:&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''NounPhrase'' ''VerbPhrase'' '''and''' ''Sentence''&lt;br /&gt;
This can generate a potentially infinite number of sentences (any number of these five-word sentences linked by '''and'''). This is an example of what is known as a [[Recursion|recursive]] definition, whereby a ''Sentence'' is partially defined in terms of itself. In such a recursive rule there must be at least one transformation option which does not involve ''Sentence'', otherwise the transformation could never stop.&lt;br /&gt;
&lt;br /&gt;
The above change is known as right-recursive; a left-recursive formulation is also possible, and can in this example generate exactly the same sentences.&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''Sentence'' '''and''' ''NounPhrase'' ''VerbPhrase'' &lt;br /&gt;
&lt;br /&gt;
The distinction between left- and right-recursive grammars becomes important when trying to parse/analyse a sentence; some types of parser work best with left-recursive grammars, while other types work best with right-recursive grammars. This distinction is particularly relevant in connection with [[compiler|compiling or translating]] a program written in some high-level [[programming language]] so that it can be used on a [[computer]].&lt;br /&gt;
&lt;br /&gt;
==Chomsky hierarchy==&lt;br /&gt;
By imposing different constraints&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.cs.uaf.edu/2011/spring/cs331/lectures/cs331_20110124_grammar.html&lt;br /&gt;
| title = Lecture notes: Languages &amp;amp; Grammars&lt;br /&gt;
| accessdate = 2012-04-07&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; &lt;br /&gt;
as to what sort of transformation rules could be used, Chomsky was able to define four strictly nested transformational grammars, which he numbered from 0 to 3. As the grammar number increases, the generated language becomes simpler. As the grammar number decreases, parsing a sentence in that language becomes more difficult. The following table provides a summary, which is then explained further in the subsequent subsections.&lt;br /&gt;
&lt;br /&gt;
In the late 1950's, [[John Backus]] and Peter Naur developed a notation for describing [[programming language]]s. This notation is known as Backus Naur Form (or BNF) and turns out to be equivalent to Chomsky's grammar number two (context-free grammar), although it was developed independently of Chomsky's work. Backus-Naur Form was first used in the Algol 60 Report to specify the syntax of Algol 60, and has since been used for specifying the syntax of other programming languages. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!| Chomsky&amp;lt;br&amp;gt;number || linguistic name || Rule constraints || Recogniser+ || Notes &lt;br /&gt;
|-&lt;br /&gt;
| 0 || recursively enumerable || [anything] -&amp;gt; [anything] || Turing machine || most human languages &lt;br /&gt;
|-&lt;br /&gt;
| 1 || context-sensitive || X ''A'' Y -&amp;gt; X [anything] Y || linear bounded automaton || X and Y provide the context in which ''A'' can be transformed &lt;br /&gt;
|-&lt;br /&gt;
| 2 || context-free || ''A'' -&amp;gt; [anything] || non-deterministic push-down automaton || syntax analysis for most programming languages &lt;br /&gt;
|-&lt;br /&gt;
| 3 || regular || ''A'' -&amp;gt; [nothing]&amp;lt;br&amp;gt;''A'' -&amp;gt; '''xyz'''&amp;lt;br&amp;gt;''A'' -&amp;gt; '''xyz''' ''B'' || finite automaton&amp;lt;br&amp;gt;or finite state machine || lexical analysis (combining characters into words/tokens)  &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''+''' The '''recogniser''' column indicates the type of mathematical or computer science theoretical model needed to recognise that a sentence belongs to a language, essentially by applying the transformation rules in reverse to work backwards from the actual words in order to finish up with a ''sentence'' (in programming languages the starting concept is usually a ''program''). A finite automaton uses only a small fixed amount of memory, operates in time proportional to the length of the input, and always reaches a decision, while a Turing machine may use an infinite amount of memory and time and may fail to reach a decision (may never stop).&lt;br /&gt;
&lt;br /&gt;
In the linguistic literature, [nothing] is often represented by the symbol '''ε'''.&lt;br /&gt;
&lt;br /&gt;
The descriptions of the various Chomsky levels which follows are presented in reverse order, so as to work up from a simple case to a rather complicated case.&lt;br /&gt;
&lt;br /&gt;
===Level 3: regular grammar===&lt;br /&gt;
The transformation rules for regular grammars are required to be very simple. &lt;br /&gt;
*Only a single non-terminal item can appear on the left-hand side of a rule.&lt;br /&gt;
*The right-hand side of any rule must be one of:&lt;br /&gt;
**[nothing].&lt;br /&gt;
**a terminal item.&lt;br /&gt;
**a terminal item followed by a non-terminal item.&lt;br /&gt;
Note that instead of a terminal item we could have a non-terminal item whose transformation rule immediately resolves to a single terminal item, or to one of several terminal items.&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
Informally we can define a 'word' as a sequence of one or more ''Letter''s. The following regular grammar provides a more formal definition; for simplicity it is restricted to lower-case letters.&lt;br /&gt;
&lt;br /&gt;
 ''Word''     -&amp;gt; ''Letter'' ''PartWord''&lt;br /&gt;
 ''PartWord'' -&amp;gt; [nothing]&lt;br /&gt;
 ''PartWord'' -&amp;gt; ''Letter'' ''PartWord''&lt;br /&gt;
 ''Letter''   -&amp;gt; '''a''', '''b''', ... '''z'''&lt;br /&gt;
&lt;br /&gt;
Note that ''PartWord'' is recursively defined, with the recursion stopping if it is transformed into [nothing].&lt;br /&gt;
&lt;br /&gt;
For one-letter words we expand as: &lt;br /&gt;
:''Word'' -&amp;gt; ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' [nothing] -&amp;gt; ''Letter''&lt;br /&gt;
&lt;br /&gt;
For two-letter words we expand as: &lt;br /&gt;
:''Word'' -&amp;gt; ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' ''Letter'' [nothing] -&amp;gt;  ''Letter'' ''Letter''&lt;br /&gt;
&lt;br /&gt;
Obviously, words of any length can be constructed, though they may well not actually be words from any language. &lt;br /&gt;
&lt;br /&gt;
====Discussion====&lt;br /&gt;
Trying to devise transformation rules to produce words which are more English-like is much more difficult - how do you insist on at least one vowel or on no more than 5 consecutive consonants (e.g. as in 'strengths').&lt;br /&gt;
&lt;br /&gt;
Further examples in [[Regular grammar]] show how numbers can be defined via a regular grammar, and also show how a hyphenated word could be defined.&lt;br /&gt;
&lt;br /&gt;
One of the limitations of a regular grammar is that it can't cope with nested matching brackets, so that it is impossible to write a regular grammar to describe an expression such as '''2 * (3+4)''' where that grammar is expected to allow brackets nested to any depth. A context-free grammar is needed for this, as described in the next section.&lt;br /&gt;
&lt;br /&gt;
Regular grammars or equivalent are widely used by [[compiler]]s in the lexical analysis of programming languages.&lt;br /&gt;
&lt;br /&gt;
===Level 2: context-free grammar===&lt;br /&gt;
The transformation rules for context-free grammars don't appear that much different from those for regular grammars. &lt;br /&gt;
*Only a single non-terminal item can appear on the left-hand side of a rule.&lt;br /&gt;
*The right-hand side of any rule must be one of:&lt;br /&gt;
**[nothing].&lt;br /&gt;
**any combination of terminal items and non-terminal items.&lt;br /&gt;
&lt;br /&gt;
The key difference is that in a regular grammar, any non-empty rule must effectively start with terminal item so that every rule transformation makes some immediate progress, while in a context-free grammar a rule could start with a non-terminal item which itself could be subject to arbitrary further transformations.&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
The following example shows how context-free grammars can cope with arithmetic expressions involving possibly nested brackets. Also an expression such as &amp;quot;2 + 3 * 4&amp;quot; could be interpreted as either &amp;quot;(2 + 3) * 4&amp;quot; or as &amp;quot;2 + (3 * 4)&amp;quot;. The latter interpretation is that which is normally used - multiplication &amp;quot;*&amp;quot; is said to have a higher priority than addition &amp;quot;+&amp;quot; - so the example also needs to incorporate this priority concept into the grammar. Furthermore, consecutive operators of the same priority are applied from left to right, so that &amp;quot;8 - 2 + 3&amp;quot; is interpreted as &amp;quot;(8 - 2) + 3&amp;quot; = 9, rather than as &amp;quot;8 - (2 + 3)&amp;quot; = 3.  This ordering must also be built in to the grammar.&lt;br /&gt;
&lt;br /&gt;
To avoid distracting side-issues, this example only deals with numbers which consist solely of a single digit. The example is a simplified version of the definition of an arithmetic expression given in the Revised Algol 60 Report (Section 3.3.1)&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.masswerk.at/algol60/report.htm&lt;br /&gt;
| title = Revised Report on the Algorithmic Language Algol 60&lt;br /&gt;
| accessdate = 2012-04-22&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ''Expression'' -&amp;gt; ''Term''&lt;br /&gt;
 ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''&lt;br /&gt;
 ''Term''       -&amp;gt; ''Primary''&lt;br /&gt;
 ''Term''       -&amp;gt; ''Term'' ''MulDivOp'' ''Primary''&lt;br /&gt;
&lt;br /&gt;
 ''Primary''    -&amp;gt; ''Number''&lt;br /&gt;
 ''Primary''    -&amp;gt; '''(''' ''Expression'' ''')'''&lt;br /&gt;
&lt;br /&gt;
 ''MulDivOp''   -&amp;gt; '''*'''. '''/'''&lt;br /&gt;
 ''AddSubOp''   -&amp;gt; '''+'''. '''-'''&lt;br /&gt;
 ''Number''     -&amp;gt; '''0''', '''1''', ... '''9'''&lt;br /&gt;
&lt;br /&gt;
===Level 1===&lt;br /&gt;
&lt;br /&gt;
===Level 0===&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[category:linguistics]]&lt;br /&gt;
[[Category:Computer Science]]&lt;/div&gt;</summary>
		<author><name>RolandPlankton</name></author>
	</entry>
	<entry>
		<id>https://www.conservapedia.com/index.php?title=Chomsky_hierarchy&amp;diff=977236</id>
		<title>Chomsky hierarchy</title>
		<link rel="alternate" type="text/html" href="https://www.conservapedia.com/index.php?title=Chomsky_hierarchy&amp;diff=977236"/>
		<updated>2012-04-22T20:20:00Z</updated>

		<summary type="html">&lt;p&gt;RolandPlankton: /* Chomsky hierarchy */ rules for simple expressions&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The '''Chomsky hierarchy''', sometimes known as the '''Chomsky-Schützenberger hierarchy''', is a hierarchy of formal grammatical systems for describing various classes of languages; the hierarchy can apply to both human and computer languages. This hierarchy was first published in 1956 by [[Noam Chomsky|Chomsky]].&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite journal &lt;br /&gt;
| title = Three models for the description of language &lt;br /&gt;
| year = 1956 &lt;br /&gt;
| last = Chomsky &lt;br /&gt;
| first = Noam &lt;br /&gt;
| journal = IRE Transactions on Information Theory &lt;br /&gt;
| volume = 2 &lt;br /&gt;
| pages = 113–124 &lt;br /&gt;
| url = http://www.chomsky.info/articles/195609--.pdf &lt;br /&gt;
| accessdate = 2012-04-08&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
These grammatical systems were referred to by Chomsky as ''transformational grammars''.  Other linguists have since developed a variety of similar grammars; together these are known as ''generative grammars''. &lt;br /&gt;
&lt;br /&gt;
The basic idea of a '''generative grammar''' is to provide a set of rules which are capable of generating all possible grammatical sentences in some language; the rules must constrain the generation so that only grammatical sentences are generated. The rules can also be used in reverse to parse a sentence and check if it is grammatical.&lt;br /&gt;
&lt;br /&gt;
==Example of a very simple generative grammar==&lt;br /&gt;
This very simple example can handle only a tiny subset of English and should not be taken seriously as a guide to English grammar or vocabulary. It is based on an example by David Crystal&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite book &lt;br /&gt;
| last = Crystal &lt;br /&gt;
| first = David  &lt;br /&gt;
| title = The Cambridge Encyclopedia of Language &lt;br /&gt;
| publisher = Cambridge University Press &lt;br /&gt;
| year = 1987 &lt;br /&gt;
| isbn = 0-521-42443-7&lt;br /&gt;
| pages = page 97&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; and is a slight extension of an example on slide 9 of this lecture.&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.cs.princeton.edu/~rywang/99f126/slides/16th.pdf&lt;br /&gt;
| title = Lecture notes: Formal Languages&lt;br /&gt;
| accessdate = 2012-04-07}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase''         # A ''Sentence'' consists of a ''NounPhrase'' followed by a ''VerbPhrase''&lt;br /&gt;
 ''NounPhrase'' -&amp;gt;  ''Determiner'' ''Noun''               # A ''NounPhrase'' consists of a ''Determiner'' followed by a ''Noun''&lt;br /&gt;
 ''VerbPhrase'' -&amp;gt;  ''Verb'' ''NounPhrase''               # A ''VerbPhrase'' consists of a ''Verb'' followed by a ''NounPhrase''&lt;br /&gt;
 ''Determiner'' -&amp;gt;  '''a''', '''the'''                        # A ''Determiner''  is one of: '''a''' or '''the'''&lt;br /&gt;
 ''Noun''       -&amp;gt;  '''boy''', '''girl''', '''dog'''                # A ''Noun'' is one of: '''boy''' or '''girl''' or '''dog'''  &lt;br /&gt;
 ''Verb''       -&amp;gt;  '''chased''', '''heard''', '''saw'''            # A ''Verb'' is one of: '''chased''' or '''heard''' or '''saw'''&lt;br /&gt;
&lt;br /&gt;
Notation used above: &lt;br /&gt;
:The symbol &amp;quot;-&amp;gt;&amp;quot; means &amp;quot;can be replaced by&amp;quot;.  &lt;br /&gt;
:When there are several items on the right hand side separated by commas, just one of these items can be selected. &lt;br /&gt;
:The comments preceded by &amp;quot;#&amp;quot; are not part of the generative grammar, but hopefully will help folks understand the example a little better.&lt;br /&gt;
&lt;br /&gt;
By making appropriate substitutions we can generate such sentences as:&lt;br /&gt;
:The dog chased a girl.&lt;br /&gt;
:The girl heard the dog.&lt;br /&gt;
:The boy saw a girl.&lt;br /&gt;
&lt;br /&gt;
The stages in the generation of these examples are as follows:&lt;br /&gt;
:''Sentence''&lt;br /&gt;
:-&amp;gt; ''NounPhrase'' ''VerbPhrase''&lt;br /&gt;
:-&amp;gt; ''Determiner'' ''Noun'' ''Verb'' ''NounPhrase''&lt;br /&gt;
:-&amp;gt; ''Determiner'' ''Noun'' ''Verb'' ''Determiner'' ''Noun''&lt;br /&gt;
&lt;br /&gt;
By appropriate selection of words to substitute for ''Determiner'', ''Noun'', and ''Verb'' we can produce the 3 example sentences above.&lt;br /&gt;
&lt;br /&gt;
The simple grammar defines a few words which can be substituted for ''Determiner'', ''Noun'', and ''Verb''. There are two possibilities for ''Determiner'', three for ''Noun'', and three for ''Verb'', with both ''Determiner'' and ''Noun'' appearing twice in the expansion. Hence the total number of grammatical sentences which can be generated by this simple grammar is 108 (= 2 * 3 * 3 * 2 * 3). In this particular case the possible words have been carefully chosen so that all of these 108 sentences also actually mean something.&lt;br /&gt;
&lt;br /&gt;
Note that the use of ''italics'' and '''boldface''' in this example is merely a convenient way of indicating the difference between items which can be expanded further (e.g. concepts such as ''NounPhrase'') and items which can not be expanded further (e.g. words such as '''girl'''). In the linguistic literature, items which can be expanded further are referred to as 'non-terminal' items, while items which can't be expanded further are known as 'terminal' items.&lt;br /&gt;
&lt;br /&gt;
The 'comma' notation for alternatives is a form of shorthand. In some formulations this would be shown as several separate rules, so that:&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''a''', '''the''' &lt;br /&gt;
could be shown as two rules:&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''a'''&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''the''' &lt;br /&gt;
&lt;br /&gt;
==Caution==&lt;br /&gt;
While a generative grammar may produce sentences which are grammatically correct, there is no certainty that such sentences will actually mean anything. The classic example of such a meaningless sentence is from Chomsky's book&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite book &lt;br /&gt;
| last = Chomsky &lt;br /&gt;
| first = Noam &lt;br /&gt;
| title = Syntactic Structures &lt;br /&gt;
| year = 1957 &lt;br /&gt;
| publisher = Mouton &lt;br /&gt;
| location = The Hague/Paris &lt;br /&gt;
| pages = page 15 &lt;br /&gt;
| isbn = 3-11-017279-8&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; with the grammatically correct sentence:&lt;br /&gt;
&lt;br /&gt;
:&amp;quot;Colorless green ideas sleep furiously.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
:This example illustrates the difference between grammar/syntax and meaning/semantics.&lt;br /&gt;
&lt;br /&gt;
Another problem when analysing a sentence is that many English words have multiple meanings, so that there may be more than one way to interpret a sentence. A simple example is the sentence: &lt;br /&gt;
:&amp;quot;Time flies.&amp;quot; &lt;br /&gt;
:Is this an instruction to check how fast flies are flying, or an indication that time appears to be passing quickly? &lt;br /&gt;
:A varied and entertaining selection of such ambiguities has been compiled by Jeff Gray.&amp;lt;ref&amp;gt;{{Cite web &lt;br /&gt;
| title = Collection of Ambiguous or Inconsistent/Incomplete Statements  &lt;br /&gt;
| url = http://www.gray-area.org/Research/Ambig/ &lt;br /&gt;
| author = Jeff Gray&lt;br /&gt;
| accessdate = 2012-04-10&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Formal grammar==&lt;br /&gt;
'''Note''': this section and subsequent sections are, by necessity, slightly more technical/formal than the earlier parts of this article, though specialist notation has been largely avoided. Make sure that you understand the 'Simple example' above before proceeding further, since references will be made to that example to help explain the technicalities, and variations on that example will be used to illustrate new ideas. An attempt has been made to avoid formal linguistic abbreviations and unexplained jargon.&lt;br /&gt;
&lt;br /&gt;
A formal generative grammar has four components (see slide 19 of this lecture&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://adammikeal.org/courses/compute/Chomsky%20Presentation.pdf&lt;br /&gt;
| title = The Chomsky Hierarchy&lt;br /&gt;
| accessdate = 2012-04-06&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
):&lt;br /&gt;
# a finite number of non-terminal concepts (e.g. ''VerbPhrase'' in the example, or anything else in ''italics''),&lt;br /&gt;
# a finite number of terminal items (e.g. '''girl''' in the example, or anything else in '''bold-face''').&lt;br /&gt;
# a finite set of rules for transforming non-terminal items (e.g. the example has 6 rules).&lt;br /&gt;
# a single starting point (e.g. ''Sentence'' in the example).&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
:Any item which appears on the left-hand side of a transformation rule is non-terminal since it can be replaced by something else; apart from the starting point, all other non-terminals must also appear somewhere on the right-hand side of transformation rule.&lt;br /&gt;
:An item which appears only on the right-hand side of a transformation rule is a terminal item, since it can not be transformed further.&lt;br /&gt;
:A list of all the terminal items is effectively the vocabulary from which sentences are built.&lt;br /&gt;
:Linguists have developed various classes of grammars by using constraints to govern what sort of rules can be used for any particular grammar.&lt;br /&gt;
&lt;br /&gt;
===Changing the rules===&lt;br /&gt;
An relatively small change to even a single rule can make a large change in the language which can be generated. For example, change the first rule in the simple example to read:&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''NounPhrase'' ''VerbPhrase'' '''and''' ''NounPhrase'' ''VerbPhrase''&lt;br /&gt;
This means that a ''Sentence'' is either a ''NounPhrase'' followed by a ''VerbPhrase'' or a ''NounPhrase'' followed by a ''VerbPhrase'' followed by '''and''' followed by a ''NounPhrase'' followed by a ''VerbPhrase''. In addition to the shorter sentences already discussed, this could also generate a sentence such as: &amp;quot;A dog saw a girl and the dog chased the girl&amp;quot;. The total number of grammatically-correct sentences which can be generated by this modified grammar is now 11,772 (108 + 108*108), though some of these may not be very meaingful.&lt;br /&gt;
&lt;br /&gt;
===Towards infinity===&lt;br /&gt;
A significantly different rule change can have an astounding effect. Consider changing the first rule to read:&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''NounPhrase'' ''VerbPhrase'' '''and''' ''Sentence''&lt;br /&gt;
This can generate a potentially infinite number of sentences (any number of these five-word sentences linked by '''and'''). This is an example of what is known as a [[Recursion|recursive]] definition, whereby a ''Sentence'' is partially defined in terms of itself. In such a recursive rule there must be at least one transformation option which does not involve ''Sentence'', otherwise the transformation could never stop.&lt;br /&gt;
&lt;br /&gt;
The above change is known as right-recursive; a left-recursive formulation is also possible, and can in this example generate exactly the same sentences.&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''Sentence'' '''and''' ''NounPhrase'' ''VerbPhrase'' &lt;br /&gt;
&lt;br /&gt;
The distinction between left- and right-recursive grammars becomes important when trying to parse/analyse a sentence; some types of parser work best with left-recursive grammars, while other types work best with right-recursive grammars. This distinction is particularly relevant in connection with [[compiler|compiling or translating]] a program written in some high-level [[programming language]] so that it can be used on a [[computer]].&lt;br /&gt;
&lt;br /&gt;
==Chomsky hierarchy==&lt;br /&gt;
By imposing different constraints&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.cs.uaf.edu/2011/spring/cs331/lectures/cs331_20110124_grammar.html&lt;br /&gt;
| title = Lecture notes: Languages &amp;amp; Grammars&lt;br /&gt;
| accessdate = 2012-04-07&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; &lt;br /&gt;
as to what sort of transformation rules could be used, Chomsky was able to define four strictly nested transformational grammars, which he numbered from 0 to 3. As the grammar number increases, the generated language becomes simpler. As the grammar number decreases, parsing a sentence in that language becomes more difficult. The following table provides a summary, which is then explained further in the subsequent subsections.&lt;br /&gt;
&lt;br /&gt;
In the late 1950's, [[John Backus]] and Peter Naur developed a notation for describing [[programming language]]s. This notation is known as Backus Naur Form (or BNF) and turns out to be equivalent to Chomsky's grammar number two (context-free grammar), although it was developed independently of Chomsky's work. Backus-Naur Form was first used in the Algol 60 Report to specify the syntax of Algol 60, and has since been used for specifying the syntax of other programming languages. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!| Chomsky&amp;lt;br&amp;gt;number || linguistic name || Rule constraints || Recogniser+ || Notes &lt;br /&gt;
|-&lt;br /&gt;
| 0 || recursively enumerable || [anything] -&amp;gt; [anything] || Turing machine || most human languages &lt;br /&gt;
|-&lt;br /&gt;
| 1 || context-sensitive || X ''A'' Y -&amp;gt; X [anything] Y || linear bounded automaton || X and Y provide the context in which ''A'' can be transformed &lt;br /&gt;
|-&lt;br /&gt;
| 2 || context-free || ''A'' -&amp;gt; [anything] || non-deterministic push-down automaton || syntax analysis for most programming languages &lt;br /&gt;
|-&lt;br /&gt;
| 3 || regular || ''A'' -&amp;gt; [nothing]&amp;lt;br&amp;gt;''A'' -&amp;gt; '''xyz'''&amp;lt;br&amp;gt;''A'' -&amp;gt; '''xyz''' ''B'' || finite automaton&amp;lt;br&amp;gt;or finite state machine || lexical analysis (combining characters into words/tokens)  &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''+''' The '''recogniser''' column indicates the type of mathematical or computer science theoretical model needed to recognise that a sentence belongs to a language, essentially by applying the transformation rules in reverse to work backwards from the actual words in order to finish up with a ''sentence'' (in programming languages the starting concept is usually a ''program''). A finite automaton uses only a small fixed amount of memory, operates in time proportional to the length of the input, and always reaches a decision, while a Turing machine may use an infinite amount of memory and time and may fail to reach a decision (may never stop).&lt;br /&gt;
&lt;br /&gt;
In the linguistic literature, [nothing] is often represented by the symbol '''ε'''.&lt;br /&gt;
&lt;br /&gt;
The descriptions of the various Chomsky levels which follows are presented in reverse order, so as to work up from a simple case to a rather complicated case.&lt;br /&gt;
&lt;br /&gt;
===Level 3: regular grammar===&lt;br /&gt;
The transformation rules for regular grammars are required to be very simple. &lt;br /&gt;
*Only a single non-terminal item can appear on the left-hand side of a rule.&lt;br /&gt;
*The right-hand side of any rule must be one of:&lt;br /&gt;
**[nothing].&lt;br /&gt;
**a terminal item.&lt;br /&gt;
**a terminal item followed by a non-terminal item.&lt;br /&gt;
Note that instead of a terminal item we could have a non-terminal item whose transformation rule immediately resolves to a single terminal item, or to one of several terminal items.&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
Informally we can define a 'word' as a sequence of one or more ''Letter''s. The following regular grammar provides a more formal definition; for simplicity it is restricted to lower-case letters.&lt;br /&gt;
&lt;br /&gt;
 ''Word''     -&amp;gt; ''Letter'' ''PartWord''&lt;br /&gt;
 ''PartWord'' -&amp;gt; [nothing]&lt;br /&gt;
 ''PartWord'' -&amp;gt; ''Letter'' ''PartWord''&lt;br /&gt;
 ''Letter''   -&amp;gt; '''a''', '''b''', ... '''z'''&lt;br /&gt;
&lt;br /&gt;
Note that ''PartWord'' is recursively defined, with the recursion stopping if it is transformed into [nothing].&lt;br /&gt;
&lt;br /&gt;
For one-letter words we expand as: &lt;br /&gt;
:''Word'' -&amp;gt; ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' [nothing] -&amp;gt; ''Letter''&lt;br /&gt;
&lt;br /&gt;
For two-letter words we expand as: &lt;br /&gt;
:''Word'' -&amp;gt; ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' ''Letter'' [nothing] -&amp;gt;  ''Letter'' ''Letter''&lt;br /&gt;
&lt;br /&gt;
Obviously, words of any length can be constructed, though they may well not actually be words from any language. &lt;br /&gt;
&lt;br /&gt;
====Discussion====&lt;br /&gt;
Trying to devise transformation rules to produce words which are more English-like is much more difficult - how do you insist on at least one vowel or on no more than 5 consecutive consonants (e.g. as in 'strengths').&lt;br /&gt;
&lt;br /&gt;
Further examples in [[Regular grammar]] show how numbers can be defined via a regular grammar, and also show how a hyphenated word could be defined.&lt;br /&gt;
&lt;br /&gt;
One of the limitations of a regular grammar is that it can't cope with nested matching brackets, so that it is impossible to write a regular grammar to describe an expression such as '''2 * (3+4)''' where that grammar is expected to allow brackets nested to any depth. A context-free grammar is needed for this, as described in the next section.&lt;br /&gt;
&lt;br /&gt;
Regular grammars or equivalent are widely used by [[compiler]]s in the lexical analysis of programming languages.&lt;br /&gt;
&lt;br /&gt;
===Level 2: context-free grammar===&lt;br /&gt;
The transformation rules for context-free grammars don't appear that much different from those for regular grammars. &lt;br /&gt;
*Only a single non-terminal item can appear on the left-hand side of a rule.&lt;br /&gt;
*The right-hand side of any rule must be one of:&lt;br /&gt;
**[nothing].&lt;br /&gt;
**any combination of terminal items and non-terminal items.&lt;br /&gt;
&lt;br /&gt;
The key difference is that in a regular grammar, any non-empty rule must effectively start with terminal item so that every rule transformation makes some immediate progress, while in a context-free grammar a rule could start with a non-terminal item which itself could be subject to arbitrary further transformations.&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
The following example shows how context-free grammars can cope with arithmetic expressions involving possibly nested brackets. Also an expression such as &amp;quot;2 + 3 * 4&amp;quot; could be interpreted as either &amp;quot;(2 + 3) * 4&amp;quot; or as &amp;quot;2 + (3 * 4)&amp;quot;. The latter interpretation is that which is normally used - multiplication &amp;quot;*&amp;quot; is said to have a higher priority than addition &amp;quot;+&amp;quot; - so the example also needs to incorporate this priority concept into the grammar. Furthermore, consecutive operators of the same priority are applied from left to right, so that &amp;quot;8 - 2 + 3&amp;quot; is interpreted as &amp;quot;(8 - 2) + 3&amp;quot; = 9, rather than as &amp;quot;8 - (2 + 3)&amp;quot; = 3.  This ordering must also be built in to the grammar.&lt;br /&gt;
&lt;br /&gt;
To avoid distracting side-issues, this example only deals with numbers which consist solely of a single digit. The example is a simplified version of the definition of an arithmetic expression given in the Revised Algol 60 Report (Section 3.3.1)&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.masswerk.at/algol60/report.htm&lt;br /&gt;
| title = Revised Report on the Algorithmic Language Algol 60&lt;br /&gt;
| accessdate = 2012-04-22&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ''Expression'' -&amp;gt; ''Term''&lt;br /&gt;
 ''Expression'' -&amp;gt; ''Expression'' ''AddSubOp'' ''Term''&lt;br /&gt;
 ''Term''       -&amp;gt; ''Primary''&lt;br /&gt;
 ''Term''       -&amp;gt; ''Term'' ''MulDivOp'' ''Primary''&lt;br /&gt;
&lt;br /&gt;
 ''Primary''    -&amp;gt; ''Number''&lt;br /&gt;
 ''Primary''    -&amp;gt; '''(''' ''Expression'' ''')'''&lt;br /&gt;
&lt;br /&gt;
 ''MulDivOp''   -&amp;gt; '''*'''. '''/'''&lt;br /&gt;
 ''AddSubOp''   -&amp;gt; '''+'''. '''-'''&lt;br /&gt;
 ''Number''     -&amp;gt; '''0''', '''1''', ... '''9'''&lt;br /&gt;
&lt;br /&gt;
===Level 1===&lt;br /&gt;
&lt;br /&gt;
===Level 0==&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[category:linguistics]]&lt;br /&gt;
[[Category:Computer Science]]&lt;/div&gt;</summary>
		<author><name>RolandPlankton</name></author>
	</entry>
	<entry>
		<id>https://www.conservapedia.com/index.php?title=Chomsky_hierarchy&amp;diff=977160</id>
		<title>Chomsky hierarchy</title>
		<link rel="alternate" type="text/html" href="https://www.conservapedia.com/index.php?title=Chomsky_hierarchy&amp;diff=977160"/>
		<updated>2012-04-22T15:28:24Z</updated>

		<summary type="html">&lt;p&gt;RolandPlankton: /* Chomsky hierarchy */ start detailing context-free grammars&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The '''Chomsky hierarchy''', sometimes known as the '''Chomsky-Schützenberger hierarchy''', is a hierarchy of formal grammatical systems for describing various classes of languages; the hierarchy can apply to both human and computer languages. This hierarchy was first published in 1956 by [[Noam Chomsky|Chomsky]].&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite journal &lt;br /&gt;
| title = Three models for the description of language &lt;br /&gt;
| year = 1956 &lt;br /&gt;
| last = Chomsky &lt;br /&gt;
| first = Noam &lt;br /&gt;
| journal = IRE Transactions on Information Theory &lt;br /&gt;
| volume = 2 &lt;br /&gt;
| pages = 113–124 &lt;br /&gt;
| url = http://www.chomsky.info/articles/195609--.pdf &lt;br /&gt;
| accessdate = 2012-04-08&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
These grammatical systems were referred to by Chomsky as ''transformational grammars''.  Other linguists have since developed a variety of similar grammars; together these are known as ''generative grammars''. &lt;br /&gt;
&lt;br /&gt;
The basic idea of a '''generative grammar''' is to provide a set of rules which are capable of generating all possible grammatical sentences in some language; the rules must constrain the generation so that only grammatical sentences are generated. The rules can also be used in reverse to parse a sentence and check if it is grammatical.&lt;br /&gt;
&lt;br /&gt;
==Example of a very simple generative grammar==&lt;br /&gt;
This very simple example can handle only a tiny subset of English and should not be taken seriously as a guide to English grammar or vocabulary. It is based on an example by David Crystal&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite book &lt;br /&gt;
| last = Crystal &lt;br /&gt;
| first = David  &lt;br /&gt;
| title = The Cambridge Encyclopedia of Language &lt;br /&gt;
| publisher = Cambridge University Press &lt;br /&gt;
| year = 1987 &lt;br /&gt;
| isbn = 0-521-42443-7&lt;br /&gt;
| pages = page 97&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; and is a slight extension of an example on slide 9 of this lecture.&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.cs.princeton.edu/~rywang/99f126/slides/16th.pdf&lt;br /&gt;
| title = Lecture notes: Formal Languages&lt;br /&gt;
| accessdate = 2012-04-07}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase''         # A ''Sentence'' consists of a ''NounPhrase'' followed by a ''VerbPhrase''&lt;br /&gt;
 ''NounPhrase'' -&amp;gt;  ''Determiner'' ''Noun''               # A ''NounPhrase'' consists of a ''Determiner'' followed by a ''Noun''&lt;br /&gt;
 ''VerbPhrase'' -&amp;gt;  ''Verb'' ''NounPhrase''               # A ''VerbPhrase'' consists of a ''Verb'' followed by a ''NounPhrase''&lt;br /&gt;
 ''Determiner'' -&amp;gt;  '''a''', '''the'''                        # A ''Determiner''  is one of: '''a''' or '''the'''&lt;br /&gt;
 ''Noun''       -&amp;gt;  '''boy''', '''girl''', '''dog'''                # A ''Noun'' is one of: '''boy''' or '''girl''' or '''dog'''  &lt;br /&gt;
 ''Verb''       -&amp;gt;  '''chased''', '''heard''', '''saw'''            # A ''Verb'' is one of: '''chased''' or '''heard''' or '''saw'''&lt;br /&gt;
&lt;br /&gt;
Notation used above: &lt;br /&gt;
:The symbol &amp;quot;-&amp;gt;&amp;quot; means &amp;quot;can be replaced by&amp;quot;.  &lt;br /&gt;
:When there are several items on the right hand side separated by commas, just one of these items can be selected. &lt;br /&gt;
:The comments preceded by &amp;quot;#&amp;quot; are not part of the generative grammar, but hopefully will help folks understand the example a little better.&lt;br /&gt;
&lt;br /&gt;
By making appropriate substitutions we can generate such sentences as:&lt;br /&gt;
:The dog chased a girl.&lt;br /&gt;
:The girl heard the dog.&lt;br /&gt;
:The boy saw a girl.&lt;br /&gt;
&lt;br /&gt;
The stages in the generation of these examples are as follows:&lt;br /&gt;
:''Sentence''&lt;br /&gt;
:-&amp;gt; ''NounPhrase'' ''VerbPhrase''&lt;br /&gt;
:-&amp;gt; ''Determiner'' ''Noun'' ''Verb'' ''NounPhrase''&lt;br /&gt;
:-&amp;gt; ''Determiner'' ''Noun'' ''Verb'' ''Determiner'' ''Noun''&lt;br /&gt;
&lt;br /&gt;
By appropriate selection of words to substitute for ''Determiner'', ''Noun'', and ''Verb'' we can produce the 3 example sentences above.&lt;br /&gt;
&lt;br /&gt;
The simple grammar defines a few words which can be substituted for ''Determiner'', ''Noun'', and ''Verb''. There are two possibilities for ''Determiner'', three for ''Noun'', and three for ''Verb'', with both ''Determiner'' and ''Noun'' appearing twice in the expansion. Hence the total number of grammatical sentences which can be generated by this simple grammar is 108 (= 2 * 3 * 3 * 2 * 3). In this particular case the possible words have been carefully chosen so that all of these 108 sentences also actually mean something.&lt;br /&gt;
&lt;br /&gt;
Note that the use of ''italics'' and '''boldface''' in this example is merely a convenient way of indicating the difference between items which can be expanded further (e.g. concepts such as ''NounPhrase'') and items which can not be expanded further (e.g. words such as '''girl'''). In the linguistic literature, items which can be expanded further are referred to as 'non-terminal' items, while items which can't be expanded further are known as 'terminal' items.&lt;br /&gt;
&lt;br /&gt;
The 'comma' notation for alternatives is a form of shorthand. In some formulations this would be shown as several separate rules, so that:&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''a''', '''the''' &lt;br /&gt;
could be shown as two rules:&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''a'''&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''the''' &lt;br /&gt;
&lt;br /&gt;
==Caution==&lt;br /&gt;
While a generative grammar may produce sentences which are grammatically correct, there is no certainty that such sentences will actually mean anything. The classic example of such a meaningless sentence is from Chomsky's book&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite book &lt;br /&gt;
| last = Chomsky &lt;br /&gt;
| first = Noam &lt;br /&gt;
| title = Syntactic Structures &lt;br /&gt;
| year = 1957 &lt;br /&gt;
| publisher = Mouton &lt;br /&gt;
| location = The Hague/Paris &lt;br /&gt;
| pages = page 15 &lt;br /&gt;
| isbn = 3-11-017279-8&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; with the grammatically correct sentence:&lt;br /&gt;
&lt;br /&gt;
:&amp;quot;Colorless green ideas sleep furiously.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
:This example illustrates the difference between grammar/syntax and meaning/semantics.&lt;br /&gt;
&lt;br /&gt;
Another problem when analysing a sentence is that many English words have multiple meanings, so that there may be more than one way to interpret a sentence. A simple example is the sentence: &lt;br /&gt;
:&amp;quot;Time flies.&amp;quot; &lt;br /&gt;
:Is this an instruction to check how fast flies are flying, or an indication that time appears to be passing quickly? &lt;br /&gt;
:A varied and entertaining selection of such ambiguities has been compiled by Jeff Gray.&amp;lt;ref&amp;gt;{{Cite web &lt;br /&gt;
| title = Collection of Ambiguous or Inconsistent/Incomplete Statements  &lt;br /&gt;
| url = http://www.gray-area.org/Research/Ambig/ &lt;br /&gt;
| author = Jeff Gray&lt;br /&gt;
| accessdate = 2012-04-10&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Formal grammar==&lt;br /&gt;
'''Note''': this section and subsequent sections are, by necessity, slightly more technical/formal than the earlier parts of this article, though specialist notation has been largely avoided. Make sure that you understand the 'Simple example' above before proceeding further, since references will be made to that example to help explain the technicalities, and variations on that example will be used to illustrate new ideas. An attempt has been made to avoid formal linguistic abbreviations and unexplained jargon.&lt;br /&gt;
&lt;br /&gt;
A formal generative grammar has four components (see slide 19 of this lecture&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://adammikeal.org/courses/compute/Chomsky%20Presentation.pdf&lt;br /&gt;
| title = The Chomsky Hierarchy&lt;br /&gt;
| accessdate = 2012-04-06&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
):&lt;br /&gt;
# a finite number of non-terminal concepts (e.g. ''VerbPhrase'' in the example, or anything else in ''italics''),&lt;br /&gt;
# a finite number of terminal items (e.g. '''girl''' in the example, or anything else in '''bold-face''').&lt;br /&gt;
# a finite set of rules for transforming non-terminal items (e.g. the example has 6 rules).&lt;br /&gt;
# a single starting point (e.g. ''Sentence'' in the example).&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
:Any item which appears on the left-hand side of a transformation rule is non-terminal since it can be replaced by something else; apart from the starting point, all other non-terminals must also appear somewhere on the right-hand side of transformation rule.&lt;br /&gt;
:An item which appears only on the right-hand side of a transformation rule is a terminal item, since it can not be transformed further.&lt;br /&gt;
:A list of all the terminal items is effectively the vocabulary from which sentences are built.&lt;br /&gt;
:Linguists have developed various classes of grammars by using constraints to govern what sort of rules can be used for any particular grammar.&lt;br /&gt;
&lt;br /&gt;
===Changing the rules===&lt;br /&gt;
An relatively small change to even a single rule can make a large change in the language which can be generated. For example, change the first rule in the simple example to read:&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''NounPhrase'' ''VerbPhrase'' '''and''' ''NounPhrase'' ''VerbPhrase''&lt;br /&gt;
This means that a ''Sentence'' is either a ''NounPhrase'' followed by a ''VerbPhrase'' or a ''NounPhrase'' followed by a ''VerbPhrase'' followed by '''and''' followed by a ''NounPhrase'' followed by a ''VerbPhrase''. In addition to the shorter sentences already discussed, this could also generate a sentence such as: &amp;quot;A dog saw a girl and the dog chased the girl&amp;quot;. The total number of grammatically-correct sentences which can be generated by this modified grammar is now 11,772 (108 + 108*108), though some of these may not be very meaingful.&lt;br /&gt;
&lt;br /&gt;
===Towards infinity===&lt;br /&gt;
A significantly different rule change can have an astounding effect. Consider changing the first rule to read:&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''NounPhrase'' ''VerbPhrase'' '''and''' ''Sentence''&lt;br /&gt;
This can generate a potentially infinite number of sentences (any number of these five-word sentences linked by '''and'''). This is an example of what is known as a [[Recursion|recursive]] definition, whereby a ''Sentence'' is partially defined in terms of itself. In such a recursive rule there must be at least one transformation option which does not involve ''Sentence'', otherwise the transformation could never stop.&lt;br /&gt;
&lt;br /&gt;
The above change is known as right-recursive; a left-recursive formulation is also possible, and can in this example generate exactly the same sentences.&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''Sentence'' '''and''' ''NounPhrase'' ''VerbPhrase'' &lt;br /&gt;
&lt;br /&gt;
The distinction between left- and right-recursive grammars becomes important when trying to parse/analyse a sentence; some types of parser work best with left-recursive grammars, while other types work best with right-recursive grammars. This distinction is particularly relevant in connection with [[compiler|compiling or translating]] a program written in some high-level [[programming language]] so that it can be used on a [[computer]].&lt;br /&gt;
&lt;br /&gt;
==Chomsky hierarchy==&lt;br /&gt;
By imposing different constraints&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.cs.uaf.edu/2011/spring/cs331/lectures/cs331_20110124_grammar.html&lt;br /&gt;
| title = Lecture notes: Languages &amp;amp; Grammars&lt;br /&gt;
| accessdate = 2012-04-07&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; &lt;br /&gt;
as to what sort of transformation rules could be used, Chomsky was able to define four strictly nested transformational grammars, which he numbered from 0 to 3. As the grammar number increases, the generated language becomes simpler. As the grammar number decreases, parsing a sentence in that language becomes more difficult. The following table provides a summary, which is then explained further in the subsequent subsections.&lt;br /&gt;
&lt;br /&gt;
In the late 1950's, [[John Backus]] and Peter Naur developed a notation for describing [[programming language]]s. This notation is known as Backus Naur Form (or BNF) and turns out to be equivalent to Chomsky's grammar number two (context-free grammar), although it was developed independently of Chomsky's work. Backus-Naur Form was first used in the Algol 60 Report to specify the syntax of Algol 60, and has since been used for specifying the syntax of other programming languages. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!| Chomsky&amp;lt;br&amp;gt;number || linguistic name || Rule constraints || Recogniser+ || Notes &lt;br /&gt;
|-&lt;br /&gt;
| 0 || recursively enumerable || [anything] -&amp;gt; [anything] || Turing machine || most human languages &lt;br /&gt;
|-&lt;br /&gt;
| 1 || context-sensitive || X ''A'' Y -&amp;gt; X [anything] Y || linear bounded automaton || X and Y provide the context in which ''A'' can be transformed &lt;br /&gt;
|-&lt;br /&gt;
| 2 || context-free || ''A'' -&amp;gt; [anything] || non-deterministic push-down automaton || syntax analysis for most programming languages &lt;br /&gt;
|-&lt;br /&gt;
| 3 || regular || ''A'' -&amp;gt; [nothing]&amp;lt;br&amp;gt;''A'' -&amp;gt; '''xyz'''&amp;lt;br&amp;gt;''A'' -&amp;gt; '''xyz''' ''B'' || finite automaton&amp;lt;br&amp;gt;or finite state machine || lexical analysis (combining characters into words/tokens)  &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''+''' The '''recogniser''' column indicates the type of mathematical or computer science theoretical model needed to recognise that a sentence belongs to a language, essentially by applying the transformation rules in reverse to work backwards from the actual words in order to finish up with a ''sentence'' (in programming languages the starting concept is usually a ''program''). A finite automaton uses only a small fixed amount of memory, operates in time proportional to the length of the input, and always reaches a decision, while a Turing machine may use an infinite amount of memory and time and may fail to reach a decision (may never stop).&lt;br /&gt;
&lt;br /&gt;
In the linguistic literature, [nothing] is often represented by the symbol '''ε'''.&lt;br /&gt;
&lt;br /&gt;
The descriptions of the various Chomsky levels which follows are presented in reverse order, so as to work up from a simple case to a rather complicated case.&lt;br /&gt;
&lt;br /&gt;
===Level 3: regular grammar===&lt;br /&gt;
The transformation rules for regular grammars are required to be very simple. &lt;br /&gt;
*Only a single non-terminal item can appear on the left-hand side of a rule.&lt;br /&gt;
*The right-hand side of any rule must be one of:&lt;br /&gt;
**[nothing].&lt;br /&gt;
**a terminal item.&lt;br /&gt;
**a terminal item followed by a non-terminal item.&lt;br /&gt;
Note that instead of a terminal item we could have a non-terminal item whose transformation rule immediately resolves to a single terminal item, or to one of several terminal items.&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
Informally we can define a 'word' as a sequence of one or more ''Letter''s. The following regular grammar provides a more formal definition; for simplicity it is restricted to lower-case letters.&lt;br /&gt;
&lt;br /&gt;
 ''Word''     -&amp;gt; ''Letter'' ''PartWord''&lt;br /&gt;
 ''PartWord'' -&amp;gt; [nothing]&lt;br /&gt;
 ''PartWord'' -&amp;gt; ''Letter'' ''PartWord''&lt;br /&gt;
 ''Letter''   -&amp;gt; '''a''', '''b''', ... '''z'''&lt;br /&gt;
&lt;br /&gt;
Note that ''PartWord'' is recursively defined, with the recursion stopping if it is transformed into [nothing].&lt;br /&gt;
&lt;br /&gt;
For one-letter words we expand as: &lt;br /&gt;
:''Word'' -&amp;gt; ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' [nothing] -&amp;gt; ''Letter''&lt;br /&gt;
&lt;br /&gt;
For two-letter words we expand as: &lt;br /&gt;
:''Word'' -&amp;gt; ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' ''Letter'' [nothing] -&amp;gt;  ''Letter'' ''Letter''&lt;br /&gt;
&lt;br /&gt;
Obviously, words of any length can be constructed, though they may well not actually be words from any language. &lt;br /&gt;
&lt;br /&gt;
====Discussion====&lt;br /&gt;
Trying to devise transformation rules to produce words which are more English-like is much more difficult - how do you insist on at least one vowel or on no more than 5 consecutive consonants (e.g. as in 'strengths').&lt;br /&gt;
&lt;br /&gt;
Further examples in [[Regular grammar]] show how numbers can be defined via a regular grammar, and also show how a hyphenated word could be defined.&lt;br /&gt;
&lt;br /&gt;
One of the limitations of a regular grammar is that it can't cope with nested matching brackets, so that it is impossible to write a regular grammar to describe an expression such as '''2 * (3+4)''' where that grammar is expected to allow brackets nested to any depth. A context-free grammar is needed for this, as described in the next section.&lt;br /&gt;
&lt;br /&gt;
Regular grammars or equivalent are widely used by [[compiler]]s in the lexical analysis of programming languages.&lt;br /&gt;
&lt;br /&gt;
===Level 2: context-free grammar===&lt;br /&gt;
The transformation rules for context-free grammars don't appear that much different from those for regular grammars. &lt;br /&gt;
*Only a single non-terminal item can appear on the left-hand side of a rule.&lt;br /&gt;
*The right-hand side of any rule must be one of:&lt;br /&gt;
**[nothing].&lt;br /&gt;
**any combination of terminal items and non-terminal items.&lt;br /&gt;
&lt;br /&gt;
The key difference is that in a regular grammar, any non-empty rule must effectively start with terminal item so that every rule transformation makes some immediate progress, while in a context-free grammar a rule could start with a non-terminal item which itself could be subject to arbitrary further transformations.&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
This example shows how context-free grammars can cope with arithmetic expressions involving possibly nested brackets. Also an expression such as &amp;quot;2 + 3 * 4&amp;quot; could be interpreted as either &amp;quot;(2 + 3) * 4&amp;quot; or as &amp;quot;2 + (3 * 4)&amp;quot;. The latter interpretation is that which is normally used - multiplication &amp;quot;*&amp;quot; is said to have a higher priority than addition &amp;quot;+&amp;quot; - so the example also needs to incorporate this priority concept into the grammar. &lt;br /&gt;
&lt;br /&gt;
To avoid distracting side-issues, this example deals with numbers consisting solely of a single digit.&lt;br /&gt;
&lt;br /&gt;
===Level 1===&lt;br /&gt;
&lt;br /&gt;
===Level 0===&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[category:linguistics]]&lt;br /&gt;
[[Category:Computer Science]]&lt;/div&gt;</summary>
		<author><name>RolandPlankton</name></author>
	</entry>
	<entry>
		<id>https://www.conservapedia.com/index.php?title=Chomsky_hierarchy&amp;diff=977154</id>
		<title>Chomsky hierarchy</title>
		<link rel="alternate" type="text/html" href="https://www.conservapedia.com/index.php?title=Chomsky_hierarchy&amp;diff=977154"/>
		<updated>2012-04-22T15:05:23Z</updated>

		<summary type="html">&lt;p&gt;RolandPlankton: /* Formal grammar */ specialist notation has been largely avoided&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The '''Chomsky hierarchy''', sometimes known as the '''Chomsky-Schützenberger hierarchy''', is a hierarchy of formal grammatical systems for describing various classes of languages; the hierarchy can apply to both human and computer languages. This hierarchy was first published in 1956 by [[Noam Chomsky|Chomsky]].&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite journal &lt;br /&gt;
| title = Three models for the description of language &lt;br /&gt;
| year = 1956 &lt;br /&gt;
| last = Chomsky &lt;br /&gt;
| first = Noam &lt;br /&gt;
| journal = IRE Transactions on Information Theory &lt;br /&gt;
| volume = 2 &lt;br /&gt;
| pages = 113–124 &lt;br /&gt;
| url = http://www.chomsky.info/articles/195609--.pdf &lt;br /&gt;
| accessdate = 2012-04-08&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
These grammatical systems were referred to by Chomsky as ''transformational grammars''.  Other linguists have since developed a variety of similar grammars; together these are known as ''generative grammars''. &lt;br /&gt;
&lt;br /&gt;
The basic idea of a '''generative grammar''' is to provide a set of rules which are capable of generating all possible grammatical sentences in some language; the rules must constrain the generation so that only grammatical sentences are generated. The rules can also be used in reverse to parse a sentence and check if it is grammatical.&lt;br /&gt;
&lt;br /&gt;
==Example of a very simple generative grammar==&lt;br /&gt;
This very simple example can handle only a tiny subset of English and should not be taken seriously as a guide to English grammar or vocabulary. It is based on an example by David Crystal&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite book &lt;br /&gt;
| last = Crystal &lt;br /&gt;
| first = David  &lt;br /&gt;
| title = The Cambridge Encyclopedia of Language &lt;br /&gt;
| publisher = Cambridge University Press &lt;br /&gt;
| year = 1987 &lt;br /&gt;
| isbn = 0-521-42443-7&lt;br /&gt;
| pages = page 97&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; and is a slight extension of an example on slide 9 of this lecture.&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.cs.princeton.edu/~rywang/99f126/slides/16th.pdf&lt;br /&gt;
| title = Lecture notes: Formal Languages&lt;br /&gt;
| accessdate = 2012-04-07}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase''         # A ''Sentence'' consists of a ''NounPhrase'' followed by a ''VerbPhrase''&lt;br /&gt;
 ''NounPhrase'' -&amp;gt;  ''Determiner'' ''Noun''               # A ''NounPhrase'' consists of a ''Determiner'' followed by a ''Noun''&lt;br /&gt;
 ''VerbPhrase'' -&amp;gt;  ''Verb'' ''NounPhrase''               # A ''VerbPhrase'' consists of a ''Verb'' followed by a ''NounPhrase''&lt;br /&gt;
 ''Determiner'' -&amp;gt;  '''a''', '''the'''                        # A ''Determiner''  is one of: '''a''' or '''the'''&lt;br /&gt;
 ''Noun''       -&amp;gt;  '''boy''', '''girl''', '''dog'''                # A ''Noun'' is one of: '''boy''' or '''girl''' or '''dog'''  &lt;br /&gt;
 ''Verb''       -&amp;gt;  '''chased''', '''heard''', '''saw'''            # A ''Verb'' is one of: '''chased''' or '''heard''' or '''saw'''&lt;br /&gt;
&lt;br /&gt;
Notation used above: &lt;br /&gt;
:The symbol &amp;quot;-&amp;gt;&amp;quot; means &amp;quot;can be replaced by&amp;quot;.  &lt;br /&gt;
:When there are several items on the right hand side separated by commas, just one of these items can be selected. &lt;br /&gt;
:The comments preceded by &amp;quot;#&amp;quot; are not part of the generative grammar, but hopefully will help folks understand the example a little better.&lt;br /&gt;
&lt;br /&gt;
By making appropriate substitutions we can generate such sentences as:&lt;br /&gt;
:The dog chased a girl.&lt;br /&gt;
:The girl heard the dog.&lt;br /&gt;
:The boy saw a girl.&lt;br /&gt;
&lt;br /&gt;
The stages in the generation of these examples are as follows:&lt;br /&gt;
:''Sentence''&lt;br /&gt;
:-&amp;gt; ''NounPhrase'' ''VerbPhrase''&lt;br /&gt;
:-&amp;gt; ''Determiner'' ''Noun'' ''Verb'' ''NounPhrase''&lt;br /&gt;
:-&amp;gt; ''Determiner'' ''Noun'' ''Verb'' ''Determiner'' ''Noun''&lt;br /&gt;
&lt;br /&gt;
By appropriate selection of words to substitute for ''Determiner'', ''Noun'', and ''Verb'' we can produce the 3 example sentences above.&lt;br /&gt;
&lt;br /&gt;
The simple grammar defines a few words which can be substituted for ''Determiner'', ''Noun'', and ''Verb''. There are two possibilities for ''Determiner'', three for ''Noun'', and three for ''Verb'', with both ''Determiner'' and ''Noun'' appearing twice in the expansion. Hence the total number of grammatical sentences which can be generated by this simple grammar is 108 (= 2 * 3 * 3 * 2 * 3). In this particular case the possible words have been carefully chosen so that all of these 108 sentences also actually mean something.&lt;br /&gt;
&lt;br /&gt;
Note that the use of ''italics'' and '''boldface''' in this example is merely a convenient way of indicating the difference between items which can be expanded further (e.g. concepts such as ''NounPhrase'') and items which can not be expanded further (e.g. words such as '''girl'''). In the linguistic literature, items which can be expanded further are referred to as 'non-terminal' items, while items which can't be expanded further are known as 'terminal' items.&lt;br /&gt;
&lt;br /&gt;
The 'comma' notation for alternatives is a form of shorthand. In some formulations this would be shown as several separate rules, so that:&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''a''', '''the''' &lt;br /&gt;
could be shown as two rules:&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''a'''&lt;br /&gt;
   ''Determiner'' -&amp;gt;  '''the''' &lt;br /&gt;
&lt;br /&gt;
==Caution==&lt;br /&gt;
While a generative grammar may produce sentences which are grammatically correct, there is no certainty that such sentences will actually mean anything. The classic example of such a meaningless sentence is from Chomsky's book&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite book &lt;br /&gt;
| last = Chomsky &lt;br /&gt;
| first = Noam &lt;br /&gt;
| title = Syntactic Structures &lt;br /&gt;
| year = 1957 &lt;br /&gt;
| publisher = Mouton &lt;br /&gt;
| location = The Hague/Paris &lt;br /&gt;
| pages = page 15 &lt;br /&gt;
| isbn = 3-11-017279-8&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; with the grammatically correct sentence:&lt;br /&gt;
&lt;br /&gt;
:&amp;quot;Colorless green ideas sleep furiously.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
:This example illustrates the difference between grammar/syntax and meaning/semantics.&lt;br /&gt;
&lt;br /&gt;
Another problem when analysing a sentence is that many English words have multiple meanings, so that there may be more than one way to interpret a sentence. A simple example is the sentence: &lt;br /&gt;
:&amp;quot;Time flies.&amp;quot; &lt;br /&gt;
:Is this an instruction to check how fast flies are flying, or an indication that time appears to be passing quickly? &lt;br /&gt;
:A varied and entertaining selection of such ambiguities has been compiled by Jeff Gray.&amp;lt;ref&amp;gt;{{Cite web &lt;br /&gt;
| title = Collection of Ambiguous or Inconsistent/Incomplete Statements  &lt;br /&gt;
| url = http://www.gray-area.org/Research/Ambig/ &lt;br /&gt;
| author = Jeff Gray&lt;br /&gt;
| accessdate = 2012-04-10&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Formal grammar==&lt;br /&gt;
'''Note''': this section and subsequent sections are, by necessity, slightly more technical/formal than the earlier parts of this article, though specialist notation has been largely avoided. Make sure that you understand the 'Simple example' above before proceeding further, since references will be made to that example to help explain the technicalities, and variations on that example will be used to illustrate new ideas. An attempt has been made to avoid formal linguistic abbreviations and unexplained jargon.&lt;br /&gt;
&lt;br /&gt;
A formal generative grammar has four components (see slide 19 of this lecture&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://adammikeal.org/courses/compute/Chomsky%20Presentation.pdf&lt;br /&gt;
| title = The Chomsky Hierarchy&lt;br /&gt;
| accessdate = 2012-04-06&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
):&lt;br /&gt;
# a finite number of non-terminal concepts (e.g. ''VerbPhrase'' in the example, or anything else in ''italics''),&lt;br /&gt;
# a finite number of terminal items (e.g. '''girl''' in the example, or anything else in '''bold-face''').&lt;br /&gt;
# a finite set of rules for transforming non-terminal items (e.g. the example has 6 rules).&lt;br /&gt;
# a single starting point (e.g. ''Sentence'' in the example).&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
:Any item which appears on the left-hand side of a transformation rule is non-terminal since it can be replaced by something else; apart from the starting point, all other non-terminals must also appear somewhere on the right-hand side of transformation rule.&lt;br /&gt;
:An item which appears only on the right-hand side of a transformation rule is a terminal item, since it can not be transformed further.&lt;br /&gt;
:A list of all the terminal items is effectively the vocabulary from which sentences are built.&lt;br /&gt;
:Linguists have developed various classes of grammars by using constraints to govern what sort of rules can be used for any particular grammar.&lt;br /&gt;
&lt;br /&gt;
===Changing the rules===&lt;br /&gt;
An relatively small change to even a single rule can make a large change in the language which can be generated. For example, change the first rule in the simple example to read:&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''NounPhrase'' ''VerbPhrase'' '''and''' ''NounPhrase'' ''VerbPhrase''&lt;br /&gt;
This means that a ''Sentence'' is either a ''NounPhrase'' followed by a ''VerbPhrase'' or a ''NounPhrase'' followed by a ''VerbPhrase'' followed by '''and''' followed by a ''NounPhrase'' followed by a ''VerbPhrase''. In addition to the shorter sentences already discussed, this could also generate a sentence such as: &amp;quot;A dog saw a girl and the dog chased the girl&amp;quot;. The total number of grammatically-correct sentences which can be generated by this modified grammar is now 11,772 (108 + 108*108), though some of these may not be very meaingful.&lt;br /&gt;
&lt;br /&gt;
===Towards infinity===&lt;br /&gt;
A significantly different rule change can have an astounding effect. Consider changing the first rule to read:&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''NounPhrase'' ''VerbPhrase'' '''and''' ''Sentence''&lt;br /&gt;
This can generate a potentially infinite number of sentences (any number of these five-word sentences linked by '''and'''). This is an example of what is known as a [[Recursion|recursive]] definition, whereby a ''Sentence'' is partially defined in terms of itself. In such a recursive rule there must be at least one transformation option which does not involve ''Sentence'', otherwise the transformation could never stop.&lt;br /&gt;
&lt;br /&gt;
The above change is known as right-recursive; a left-recursive formulation is also possible, and can in this example generate exactly the same sentences.&lt;br /&gt;
 ''Sentence''   -&amp;gt;  ''NounPhrase'' ''VerbPhrase'', ''Sentence'' '''and''' ''NounPhrase'' ''VerbPhrase'' &lt;br /&gt;
&lt;br /&gt;
The distinction between left- and right-recursive grammars becomes important when trying to parse/analyse a sentence; some types of parser work best with left-recursive grammars, while other types work best with right-recursive grammars. This distinction is particularly relevant in connection with [[compiler|compiling or translating]] a program written in some high-level [[programming language]] so that it can be used on a [[computer]].&lt;br /&gt;
&lt;br /&gt;
==Chomsky hierarchy==&lt;br /&gt;
By imposing different constraints&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
| url = http://www.cs.uaf.edu/2011/spring/cs331/lectures/cs331_20110124_grammar.html&lt;br /&gt;
| title = Lecture notes: Languages &amp;amp; Grammars&lt;br /&gt;
| accessdate = 2012-04-07&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; &lt;br /&gt;
as to what sort of transformation rules could be used, Chomsky was able to define four strictly nested transformational grammars, which he numbered from 0 to 3. As the grammar number increases, the generated language becomes simpler. As the grammar number decreases, parsing a sentence in that language becomes more difficult. The following table provides a summary, which is then explained further in the subsequent subsections.&lt;br /&gt;
&lt;br /&gt;
In the late 1950's, [[John Backus]] and Peter Naur developed a notation for describing [[programming language]]s. This notation is known as Backus Naur Form (or BNF) and turns out to be equivalent to Chomsky's grammar number two (context-free grammar), although it was developed independently of Chomsky's work. Backus-Naur Form was first used in the Algol 60 Report to specify the syntax of Algol 60, and has since been used for specifying the syntax of other programming languages. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!| Chomsky&amp;lt;br&amp;gt;number || linguistic name || Rule constraints || Recogniser+ || Notes &lt;br /&gt;
|-&lt;br /&gt;
| 0 || recursively enumerable || [anything] -&amp;gt; [anything] || Turing machine || most human languages &lt;br /&gt;
|-&lt;br /&gt;
| 1 || context-sensitive || X ''A'' Y -&amp;gt; X [anything] Y || linear bounded automaton || X and Y provide the context in which ''A'' can be transformed &lt;br /&gt;
|-&lt;br /&gt;
| 2 || context-free || ''A'' -&amp;gt; [anything] || non-deterministic push-down automaton || syntax analysis for most programming languages &lt;br /&gt;
|-&lt;br /&gt;
| 3 || regular || ''A'' -&amp;gt; [nothing]&amp;lt;br&amp;gt;''A'' -&amp;gt; '''xyz'''&amp;lt;br&amp;gt;''A'' -&amp;gt; '''xyz''' ''B'' || finite automaton&amp;lt;br&amp;gt;or finite state machine || lexical analysis (combining characters into words/tokens)  &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''+''' The '''recogniser''' column indicates the type of mathematical or computer science theoretical model needed to recognise that a sentence belongs to a language, essentially by applying the transformation rules in reverse to work backwards from the actual words in order to finish up with a ''sentence'' (in programming languages the starting concept is usually a ''program''). A finite automaton uses only a small fixed amount of memory, operates in time proportional to the length of the input, and always reaches a decision, while a Turing machine may use an infinite amount of memory and time and may fail to reach a decision (may never stop).&lt;br /&gt;
&lt;br /&gt;
In the linguistic literature, [nothing] is often represented by the symbol '''ε'''.&lt;br /&gt;
&lt;br /&gt;
The descriptions of the various Chomsky levels which follows are presented in reverse order, so as to work up from a simple case to a rather complicated case.&lt;br /&gt;
&lt;br /&gt;
===Level 3: regular grammar===&lt;br /&gt;
The transformation rules for regular grammars are required to be very simple. &lt;br /&gt;
*Only a single non-terminal item can appear on the left-hand side of a rule.&lt;br /&gt;
*The right-hand side of any rule must be one of:&lt;br /&gt;
**[nothing].&lt;br /&gt;
**a terminal item.&lt;br /&gt;
**a terminal item followed by a non-terminal item.&lt;br /&gt;
Note that instead of a terminal item we could have a non-terminal item whose transformation rule immediately resolves to a single terminal item, or to one of several terminal items.&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
Informally we can define a 'word' as a sequence of one or more ''Letter''s. The following regular grammar provides a more formal definition; for simplicity it is restricted to lower-case letters.&lt;br /&gt;
&lt;br /&gt;
 ''Word''     -&amp;gt; ''Letter'' ''PartWord''&lt;br /&gt;
 ''PartWord'' -&amp;gt; [nothing]&lt;br /&gt;
 ''PartWord'' -&amp;gt; ''Letter'' ''PartWord''&lt;br /&gt;
 ''Letter''   -&amp;gt; '''a''', '''b''', ... '''z'''&lt;br /&gt;
&lt;br /&gt;
Note that ''PartWord'' is recursively defined, with the recursion stopping if it is transformed into [nothing].&lt;br /&gt;
&lt;br /&gt;
For one-letter words we expand as: &lt;br /&gt;
:''Word'' -&amp;gt; ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' [nothing] -&amp;gt; ''Letter''&lt;br /&gt;
&lt;br /&gt;
For two-letter words we expand as: &lt;br /&gt;
:''Word'' -&amp;gt; ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' ''Letter'' ''PartWord'' -&amp;gt; ''Letter'' ''Letter'' [nothing] -&amp;gt;  ''Letter'' ''Letter''&lt;br /&gt;
&lt;br /&gt;
Obviously, words of any length can be constructed, though they may well not actually be words from any language. &lt;br /&gt;
&lt;br /&gt;
====Discussion====&lt;br /&gt;
Trying to devise transformation rules to produce words which are more English-like is much more difficult - how do you insist on at least one vowel or on no more than 5 consecutive consonants (e.g. as in 'strengths').&lt;br /&gt;
&lt;br /&gt;
Further examples in [[Regular grammar]] show how numbers can be defined via a regular grammar, and also show how a hyphenated word could be defined.&lt;br /&gt;
&lt;br /&gt;
One of the limitations of a regular grammar is that it can't cope with nested matching brackets, so that it is impossible to write a regular grammar to describe an expression such as '''2 * (3+4)''' where that grammar is expected to allow brackets nested to any depth. A context-free grammar is needed for this, as described in the next section.&lt;br /&gt;
&lt;br /&gt;
Regular grammars or equivalent are widely used by [[compiler]]s in the lexical analysis of programming languages.&lt;br /&gt;
&lt;br /&gt;
===Level 2===&lt;br /&gt;
&lt;br /&gt;
===Level 1===&lt;br /&gt;
&lt;br /&gt;
===Level 0===&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[category:linguistics]]&lt;br /&gt;
[[Category:Computer Science]]&lt;/div&gt;</summary>
		<author><name>RolandPlankton</name></author>
	</entry>
</feed>