<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="de">
	<id>https://wiki-de.moshellshocker.dns64.de/index.php?action=history&amp;feed=atom&amp;title=Chomsky-Normalform</id>
	<title>Chomsky-Normalform - Versionsgeschichte</title>
	<link rel="self" type="application/atom+xml" href="https://wiki-de.moshellshocker.dns64.de/index.php?action=history&amp;feed=atom&amp;title=Chomsky-Normalform"/>
	<link rel="alternate" type="text/html" href="https://wiki-de.moshellshocker.dns64.de/index.php?title=Chomsky-Normalform&amp;action=history"/>
	<updated>2026-05-21T12:24:49Z</updated>
	<subtitle>Versionsgeschichte dieser Seite in Wikipedia (Deutsch) – Lokale Kopie</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://wiki-de.moshellshocker.dns64.de/index.php?title=Chomsky-Normalform&amp;diff=57275&amp;oldid=prev</id>
		<title>imported&gt;Esther Phalcard am 9. Oktober 2025 um 16:26 Uhr</title>
		<link rel="alternate" type="text/html" href="https://wiki-de.moshellshocker.dns64.de/index.php?title=Chomsky-Normalform&amp;diff=57275&amp;oldid=prev"/>
		<updated>2025-10-09T16:26:54Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Neue Seite&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Die &amp;#039;&amp;#039;&amp;#039;Chomsky-Normalform&amp;#039;&amp;#039;&amp;#039; (Abk.: &amp;#039;&amp;#039;&amp;#039;CNF&amp;#039;&amp;#039;&amp;#039;) ist in der [[Theoretische Informatik|theoretischen Informatik]] eine [[Kanonische Form|Normalform]] für [[Kontextfreie Grammatik|kontextfreie Grammatiken]]. Sie ist nach dem [[Linguist]]en [[Noam Chomsky]] benannt und kommt beim [[Cocke-Younger-Kasami-Algorithmus|CYK-Algorithmus]] zum Einsatz. Eine kontextfreie Grammatik in Chomsky-Normalform hat eine einfache Struktur der [[Produktionsregel]]n und erfüllt auch die Eigenschaften [[Kontextsensitive Grammatik|kontextsensitiver Grammatiken]].&lt;br /&gt;
&lt;br /&gt;
Zu jeder kontextfreien Sprache gibt es eine Grammatik in Chomsky-Normalform. Aus jeder kontextfreien Grammatik &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt; kann eine Grammatik &amp;lt;math&amp;gt;G_{CNF}&amp;lt;/math&amp;gt; in Chomsky-Normalform konstruiert werden, die dieselbe Sprache erzeugt. Die Grammatik &amp;lt;math&amp;gt;G_{CNF}&amp;lt;/math&amp;gt; wird dann auch eine Chomsky-Normalform der kontextfreien Grammatik &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt; genannt.&lt;br /&gt;
&lt;br /&gt;
Eine weitere Normalform für kontextfreie Grammatiken ist die [[Greibach-Normalform]].&lt;br /&gt;
Eine Erweiterung der Chomsky-Normalform auf [[kontextsensitive Grammatik]]en stellt die [[Kuroda-Normalform]] dar.&lt;br /&gt;
Die Chomsky-Normalform wird auf Grund der gleichen Abkürzung leicht mit der [[Konjunktive Normalform|Konjunktiven Normalform]] (engl. conjunctive normal form) verwechselt.&lt;br /&gt;
&lt;br /&gt;
== Definition ==&lt;br /&gt;
&lt;br /&gt;
Eine [[formale Grammatik]] &amp;lt;math&amp;gt;G=(V,\Sigma,P,S)&amp;lt;/math&amp;gt; ist in Chomsky-Normalform, wenn jede Produktion aus &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; eine der folgenden Formen hat:&lt;br /&gt;
* &amp;lt;math&amp;gt;A \rightarrow BC&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;A \rightarrow a&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;S \rightarrow  \varepsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
wobei &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; und &amp;lt;math&amp;gt;C&amp;lt;/math&amp;gt; [[Nichtterminalsymbol]]e aus &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; sind und &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; ein [[Terminalsymbol]] aus &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt; ist. &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; ist das [[Startsymbol]] und &amp;lt;math&amp;gt;\varepsilon&amp;lt;/math&amp;gt; das [[leeres Wort|leere Wort]]. Wenn die Produktion &amp;lt;math&amp;gt;S \rightarrow \varepsilon&amp;lt;/math&amp;gt; zur Grammatik gehört, dann darf &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; nicht auf der rechten Seite einer Produktion stehen.&lt;br /&gt;
&lt;br /&gt;
Lässt man bei der ersten Produktion auf der rechten Seite beliebig viele anstatt zwei Nichtterminalsymbole zu, so spricht man von einer &amp;#039;&amp;#039;&amp;#039;schwachen Chomsky-Normalform&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
== Konstruktion einer Chomsky-Normalform ==&lt;br /&gt;
&lt;br /&gt;
Liegt eine kontextfreie Grammatik &amp;lt;math&amp;gt;G=(V,\Sigma,P,S)&amp;lt;/math&amp;gt; vor, so lässt sich daraus schrittweise eine Grammatik &amp;lt;math&amp;gt;G&amp;#039;&amp;lt;/math&amp;gt; in Chomsky-Normalform generieren, die dieselbe Sprache erzeugt:&lt;br /&gt;
&lt;br /&gt;
;Ausnahme &amp;lt;math&amp;gt;S\rightarrow\varepsilon&amp;lt;/math&amp;gt; behandeln&lt;br /&gt;
:Enthält die Grammatik &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt; die Regel &amp;lt;math&amp;gt;S\rightarrow\varepsilon&amp;lt;/math&amp;gt;, wird ein neues Startsymbol &amp;lt;math&amp;gt;S&amp;#039;&amp;lt;/math&amp;gt; für &amp;lt;math&amp;gt;G&amp;#039;&amp;lt;/math&amp;gt; eingeführt. Anschließend erhält die neue Grammatik die Regeln &amp;lt;math&amp;gt;S&amp;#039;\rightarrow\varepsilon&amp;lt;/math&amp;gt; und &amp;lt;math&amp;gt;S&amp;#039;\rightarrow S&amp;lt;/math&amp;gt;. Damit ist sichergestellt, dass die Grammatik weiterhin das leere Wort ermöglicht und das ursprüngliche Startsymbol weiterhin auf der rechten Seite verwendet werden kann.&lt;br /&gt;
&lt;br /&gt;
;Eine schwache Chomsky-Normalform erzeugen&lt;br /&gt;
:Jedem Terminalsymbol &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; wird ein Nichtterminalsymbol &amp;lt;math&amp;gt;X_a&amp;lt;/math&amp;gt; zugeordnet. Auf der rechten Seite jeder Produktion werden sämtliche Terminalsymbole &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; durch das entsprechende Nichtterminalsymbol &amp;lt;math&amp;gt;X_a&amp;lt;/math&amp;gt; ersetzt. Abschließend werden alle Produktionen &amp;lt;math&amp;gt;X_a \rightarrow a&amp;lt;/math&amp;gt; der Grammatik hinzugefügt.&lt;br /&gt;
&lt;br /&gt;
;Rechte Seiten mit mehr als zwei Nichtterminalen ersetzen&lt;br /&gt;
:Sind auf der rechten Seite einer Produktion mehr als zwei Nichtterminale, so werden zwei benachbarte Nichtterminale &amp;lt;math&amp;gt;AB&amp;lt;/math&amp;gt; durch ein neues Nichtterminal &amp;lt;math&amp;gt;Y_{AB}&amp;lt;/math&amp;gt; ersetzt. Die Produktion &amp;lt;math&amp;gt;Y_{AB} \rightarrow AB&amp;lt;/math&amp;gt; wird zur Grammatik hinzugefügt. Dies wiederholt man solange, bis keine Produktion mit mehr als zwei Nichtterminalen mehr vorkommt.&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;math&amp;gt;\varepsilon&amp;lt;/math&amp;gt;-Produktionen entfernen&lt;br /&gt;
:Streiche die Regeln &amp;lt;math&amp;gt;A \rightarrow \varepsilon&amp;lt;/math&amp;gt;, außer &amp;lt;math&amp;gt;S&amp;#039;\rightarrow \varepsilon&amp;lt;/math&amp;gt; (falls vorhanden).&lt;br /&gt;
:Gab es vorher genau eine Produktion mit &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; auf der linken Seite, so streiche das &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; überall auf den rechten Seiten der Produktionen, denn es kann nicht zu einem Terminal abgeleitet werden.&lt;br /&gt;
:Gab es vorher mehrere Produktionen mit &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; auf der linken Seite, so füge für jede Regel, die ein solches &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; auf der rechten Seite enthält, eine Regel hinzu, in der das &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; gestrichen wurde, denn es muss der Fall betrachtet werden, in dem das &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; als leeres Wort abgeleitet wurde oder etwa nicht.  Die Regel &amp;lt;math&amp;gt;C \rightarrow AB&amp;lt;/math&amp;gt; wird dann beispielsweise um die Regel &amp;lt;math&amp;gt;C\rightarrow B&amp;lt;/math&amp;gt; ergänzt.&lt;br /&gt;
:Aus &amp;lt;math&amp;gt;C \rightarrow AB&amp;lt;/math&amp;gt; wird also:&lt;br /&gt;
:&amp;lt;math&amp;gt;C\rightarrow B&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;C \rightarrow AB&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;Kettenregeln (Produktionen der Form A→B) entfernen&lt;br /&gt;
:Wenn man eine Kettenregel, d.&amp;amp;nbsp;h. eine Produktion der Form &amp;lt;math&amp;gt;A \rightarrow B&amp;lt;/math&amp;gt;, entfernt, fügt man für jede vorhandene Produktion der Form &amp;lt;math&amp;gt;B \rightarrow w&amp;lt;/math&amp;gt; eine neue Produktion &amp;lt;math&amp;gt;A \rightarrow w&amp;lt;/math&amp;gt; hinzu, falls diese keine bereits entfernte Kettenregel ergibt. &amp;lt;math&amp;gt;w&amp;lt;/math&amp;gt; ist hierbei ein beliebiges Wort; die vorangegangenen Änderungen gewährleisten aber, dass &amp;lt;math&amp;gt;w&amp;lt;/math&amp;gt; entweder genau ein Terminalsymbol ist oder ein Wort aus genau zwei Nichtterminalsymbolen.&lt;br /&gt;
&lt;br /&gt;
== Beispiel ==&lt;br /&gt;
Es gilt, die Grammatik über dem Alphabet &amp;lt;math&amp;gt;\Sigma = \{a,b\}&amp;lt;/math&amp;gt; mit den Regeln&lt;br /&gt;
* &amp;lt;math&amp;gt;S \rightarrow ASA | aB&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;A \rightarrow B | S&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;B \rightarrow b | \varepsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
in Chomsky-Normalform zu bringen.&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;1.&amp;#039;&amp;#039;&amp;#039; Neue Startvariable hinzufügen&lt;br /&gt;
* &amp;lt;math&amp;gt;S_{0} \rightarrow S&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;S \rightarrow ASA | aB&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;A \rightarrow B | S&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;B \rightarrow b | \varepsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;2.&amp;#039;&amp;#039;&amp;#039; &amp;lt;math&amp;gt;\varepsilon&amp;lt;/math&amp;gt;-Übergänge entfernen&lt;br /&gt;
* &amp;lt;math&amp;gt;S_{0} \rightarrow S&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;S \rightarrow ASA | aB |a&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;A \rightarrow B |\varepsilon | S&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;B \rightarrow b&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
Eine neue &amp;lt;math&amp;gt;\varepsilon&amp;lt;/math&amp;gt;-Regel ist entstanden, die wiederum gleich behandelt werden muss:&lt;br /&gt;
* &amp;lt;math&amp;gt;S_{0} \rightarrow S&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;S \rightarrow ASA | AS | SA | aB |a&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;A \rightarrow B | S&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;B \rightarrow b&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;3.&amp;#039;&amp;#039;&amp;#039; Alle Einheits-Regeln entfernen.  Diese sind &amp;lt;math&amp;gt;A \rightarrow B, A \rightarrow S&amp;lt;/math&amp;gt; und &amp;lt;math&amp;gt;S_{0} \rightarrow S&amp;lt;/math&amp;gt;.&lt;br /&gt;
* &amp;lt;math&amp;gt;S_{0} \rightarrow S&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;S \rightarrow ASA | AS | SA | aB |a&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;A \rightarrow S&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;B \rightarrow b&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;A \rightarrow b&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
danach &amp;lt;math&amp;gt;A \rightarrow S&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;S_{0} \rightarrow S&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;S \rightarrow ASA | AS | SA | aB |a&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;A \rightarrow ASA | AS | SA | aB |a |b&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;B \rightarrow b&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
und zum Schluss &amp;lt;math&amp;gt;S_{0} \rightarrow S&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;S_{0} \rightarrow ASA | AS | SA | aB |a&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;S \rightarrow ASA | AS | SA | aB |a&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;A \rightarrow ASA | AS | SA | aB |a |b&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;B \rightarrow b&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;4.&amp;#039;&amp;#039;&amp;#039; Längere Verkettungen sind nicht erlaubt, deshalb führen wir eine zusätzliche Variable &amp;lt;Math&amp;gt;A_{1} &amp;lt;/math&amp;gt; ein und ersetzen &amp;lt;math&amp;gt;S\rightarrow ASA&amp;lt;/math&amp;gt; durch die Regel &amp;lt;math&amp;gt;S \rightarrow AA_{1}&amp;lt;/math&amp;gt; und &amp;lt;math&amp;gt;A_{1}\rightarrow SA&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;S_{0} \rightarrow AA_{1} | AS | SA | aB |a&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;S \rightarrow AA_{1} | AS | SA | aB |a&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;A \rightarrow AA_{1} | AS | SA | aB |a |b&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;A_{1} \rightarrow SA&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;B \rightarrow b&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
Nun bleiben nur noch die Regeln &amp;lt;math&amp;gt;A \rightarrow aB&amp;lt;/math&amp;gt; und &amp;lt;math&amp;gt;S \rightarrow aB&amp;lt;/math&amp;gt;. Deshalb wird eine weitere Variable &amp;lt;math&amp;gt;X_a&amp;lt;/math&amp;gt; verwendet, die zusammen mit der Regel &amp;lt;math&amp;gt;X_a \rightarrow a&amp;lt;/math&amp;gt; das Terminalsymbol &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; in den genannten Regeln ersetzen kann.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;S_{0} \rightarrow AA_{1} | AS | SA | X_aB |a&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;S \rightarrow AA_{1} | AS | SA | X_aB |a&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;A \rightarrow AA_{1} | AS | SA | X_aB |a |b&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;A_{1} \rightarrow SA&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;X_a \rightarrow a&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;B \rightarrow b&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
Somit ist die Grammatik in Chomsky-Normalform umgewandelt.&lt;br /&gt;
&lt;br /&gt;
== Quellen ==&lt;br /&gt;
&lt;br /&gt;
* Grzegorz Rozenberg, Arto Salomaa: &amp;#039;&amp;#039;Handbook of Formal Languages&amp;#039;&amp;#039;. Volume 1: &amp;#039;&amp;#039;Word, Language, Grammar.&amp;#039;&amp;#039; Springer-Verlag, Berlin u. a. 1997, ISBN 3-540-60420-0, S. 124–125&lt;br /&gt;
&lt;br /&gt;
[[Kategorie:Compilerbau]]&lt;br /&gt;
[[Kategorie:Theorie formaler Sprachen]]&lt;br /&gt;
[[Kategorie:Normalform]]&lt;br /&gt;
[[Kategorie:Noam Chomsky]]&lt;/div&gt;</summary>
		<author><name>imported&gt;Esther Phalcard</name></author>
	</entry>
</feed>