Prim's algorithm: Difference between revisions

From formulasearchengine
Jump to navigation Jump to search
en>JohnBlackburne
Reverted 1 edit by DarrylNester (talk): Adding links to personal site to multiple articles. (TW)
en>Runner1928
See also: Added links
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
In [[computer science]] and [[formal language]] theory, a [[context-free grammar]] is in '''Greibach normal form''' (GNF) if the right-hand sides of all [[production (computer science)|production]] rules start with a [[terminal symbol]], optionally followed by some variables. A non-strict form allows one exception to this format restriction for allowing the [[empty word]] (epsilon, ε) to be a member of the described language. The normal form bears the name of [[Sheila Greibach]].
Nice to satisfy you, I am Marvella Shryock. What I adore performing is to gather badges but I've been taking on new things lately. Since she was 18 she's been working as a meter reader but she's usually wanted her own business. My family members lives in Minnesota and my family enjoys it.<br><br>My blog [http://www.videokeren.com/blog/14593 www.videokeren.com]
 
More precisely, a context-free grammar is in Greibach normal form, if all production rules are of the form:
:<math>A \to \alpha A_1 A_2 \cdots A_n</math>
or
:<math>S \to \varepsilon</math>
where <math>A</math> is a [[nonterminal symbol]], <math>\alpha</math> is a terminal symbol,
<math>A_1 A_2 \ldots A_n</math> is a (possibly empty) sequence of nonterminal symbols not including the start symbol, ''S'' is the start symbol, and ''ε'' is the [[empty word]].
 
Observe that the grammar does not have [[left recursion]]s.
 
Every context-free grammar can be transformed into an equivalent grammar in Greibach normal form.<ref>{{cite journal | last=Greibach | first=Sheila | title=A New Normal-Form Theorem for Context-Free Phrase Structure Grammars |date=January 1965| work=Journal of the ACM | volume=12| issue=1}}</ref> Various constructions exist. Some do not permit the second form of rule and cannot transform context-free grammars that can generate the empty word. One such construction the size of the constructed grammar is ''O(n<sup>4</sup>)'' in the general case and ''O(n<sup>3</sup>)'' if no derivation of the original grammar consists of a single nonterminal symbol, where ''n'' is the size of the original grammar.<ref>{{cite journal | first1 = Norbert | last1 = Blum | first2 =  Robert | last2 = Koch | title = Greibach Normal Form Transformation Revisited | journal = Information and Computation | volume = 150 | issue = 1 | year = 1999 | pages = 112–118  | id = {{citeseerx|10.1.1.47.460}} }}</ref> This conversion can be used to prove that every [[context-free language]] can be accepted by a non-deterministic [[pushdown automaton]].
 
Given a grammar in GNF and a derivable string in the grammar with length ''n'', any [[top-down parsing|top-down parser]] will halt at depth ''n''.
 
== See also ==
*[[Backus-Naur form]]
*[[Chomsky normal form]]
*[[Kuroda normal form]]
 
==Notes==
<references/>
 
== References ==
* {{cite book | first1 = John E. | last1 = Hopcroft | first2 = Jeffrey D. | last2 = Ullman | title = Introduction to Automata Theory, Languages and Computation | publisher = Addison-Wesley Publishing | location = Reading, Massachusetts | year = 1979 | isbn = 0-201-02988-X | postscript =  }} ''(See chapter 4.)''
 
[[Category:Formal languages]]

Latest revision as of 00:28, 13 December 2014

Nice to satisfy you, I am Marvella Shryock. What I adore performing is to gather badges but I've been taking on new things lately. Since she was 18 she's been working as a meter reader but she's usually wanted her own business. My family members lives in Minnesota and my family enjoys it.

My blog www.videokeren.com