<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-14919694</id><updated>2011-04-21T11:51:20.311-07:00</updated><title type='text'>Automata...</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://apuraliezl.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14919694/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://apuraliezl.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Liezl</name><uri>http://www.blogger.com/profile/01245911737444222875</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>4</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-14919694.post-112790039821193065</id><published>2005-09-28T02:36:00.000-07:00</published><updated>2005-09-28T02:39:58.216-07:00</updated><title type='text'>A website that explain PDA...</title><content type='html'>&lt;div align="left"&gt;                            &lt;span style="font-size:130%;"&gt; &lt;/span&gt;&lt;a href="http://en.wikipedia.org/wiki/Pushdown_automata"&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="font-size:130%;"&gt;http://en.wikipedia.org/wiki/Pushdown_automata&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14919694-112790039821193065?l=apuraliezl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://apuraliezl.blogspot.com/feeds/112790039821193065/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14919694&amp;postID=112790039821193065' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14919694/posts/default/112790039821193065'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14919694/posts/default/112790039821193065'/><link rel='alternate' type='text/html' href='http://apuraliezl.blogspot.com/2005/09/website-that-explain-pda.html' title='A website that explain PDA...'/><author><name>Liezl</name><uri>http://www.blogger.com/profile/01245911737444222875</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14919694.post-112324377800907643</id><published>2005-08-05T05:04:00.000-07:00</published><updated>2005-08-05T05:09:38.016-07:00</updated><title type='text'>Assignment # 3</title><content type='html'>Dessign an algorithm that will explain yhe process of creating CNF.&lt;br /&gt; &lt;br /&gt;  Project Implementation The project is to implement the CYK algorithm on p 139-141 in text book.Your computer program, in the language of your choice, will&lt;br /&gt;1) read a grammar as defined above from a file. (fixed name or command line)&lt;br /&gt;2a) print the grammar from your internal data structure.&lt;br /&gt;2b) print the grammar after converted to Chomsky Normal Form.&lt;br /&gt;3) read a string of terminal symbols from the keyboard,&lt;br /&gt;4) print the string that is read,&lt;br /&gt;5) print "accepted" or "rejected" depending on the string being in the grammar or not being in the grammar.&lt;br /&gt;Your program should loop back and read another string until end of file.i.e. keep repeating steps 3) 4) and 5) until end of file.&lt;br /&gt;   &lt;br /&gt; Below are three grammars (pick 3 or 3a) and four strings for each grammar.Run them and turn in:&lt;br /&gt;a) source code listing of your programb)&lt;br /&gt;b) output from three runs (four if you did variable with digits)&lt;br /&gt;&lt;br /&gt;But, you need Chomsky Normal Form&lt;br /&gt;The CYK algorithm expects the grammar in &lt;a href="http://www.csee.umbc.edu/%7Esquire/f98-451/cs451_lect.shtml#L16"&gt;Chomsky Normal Form, &lt;/a&gt;&lt;br /&gt;that is: productions can be one of two formats A -&gt; a or A -&gt; BCThe grammars will have the "simplification" steps 1), 2) and 3) outof the way, that is 1) No useless variables, 2) No nullable variables and3) no unit productions. But, the grammars are not in Chomsky Normal Form,so, either convert the grammar by hand, YUK!, or program in theconversion of the raw grammar to Chomsky Normal Form.Step 4) of "simplification" is the following algorithm: 'length' refers to the number of variables plus terminal symbols on the right side of a production. Loop through the productions For each production with length greater than 1 do Replace each terminal symbol with a new variable and add a production new variable -&gt; terminal symbol.&lt;br /&gt;(An optimization is to reuse a variable name that has an existing production variable name -&gt; terminal symbol and not add another production) Loop through the productions For each production with length grater than 2 do Replace two rightmost variables with a new variable and add a production new variable -&gt; two rightmost variables.&lt;br /&gt; (Repeat - either on a production or loop until no replacements.) Now the grammar, as represented by the productions, is in Chomsky Normal Form. proceed with CYK.&lt;br /&gt;An optimization is possible but not required, for any two productions with the same right side, delete the second production and replace all occurrences of the second productions left variable with the left variable of the first production in all productions.&lt;br /&gt;(This could be needed if you run out of upper case letters for variables.)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14919694-112324377800907643?l=apuraliezl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://apuraliezl.blogspot.com/feeds/112324377800907643/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14919694&amp;postID=112324377800907643' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14919694/posts/default/112324377800907643'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14919694/posts/default/112324377800907643'/><link rel='alternate' type='text/html' href='http://apuraliezl.blogspot.com/2005/08/assignment-3.html' title='Assignment # 3'/><author><name>Liezl</name><uri>http://www.blogger.com/profile/01245911737444222875</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14919694.post-112261886034119759</id><published>2005-07-28T23:21:00.000-07:00</published><updated>2005-07-28T23:34:20.350-07:00</updated><title type='text'>Assignment #2</title><content type='html'>#2.     Explain what is an ambigous grammar..&lt;br /&gt;          Ambiguous grammar&lt;br /&gt;From Wikipedia, the free encyclopedia.&lt;br /&gt;In &lt;a title="Computer science" href="http://en.wikipedia.org/wiki/Computer_science"&gt;computer science&lt;/a&gt;, a &lt;a title="Formal grammar" href="http://en.wikipedia.org/wiki/Formal_grammar"&gt;grammar&lt;/a&gt; is said to be an ambiguous grammar if there is some &lt;a title="String (computer science)" href="http://en.wikipedia.org/wiki/String_%28computer_science%29"&gt;string&lt;/a&gt; that it can generate in more than one way (i.e., the string has more than one &lt;a title="Parse tree" href="http://en.wikipedia.org/wiki/Parse_tree"&gt;parse tree&lt;/a&gt; or more than one &lt;a class="new" title="Leftmost derivation" href="http://en.wikipedia.org/w/index.php?title=Leftmost_derivation&amp;action=edit"&gt;leftmost derivation&lt;/a&gt;). A language is inherently ambiguous if it can only be generated by ambiguous grammars.&lt;br /&gt;For &lt;a title="Programming languages" href="http://en.wikipedia.org/wiki/Programming_languages"&gt;programming languages&lt;/a&gt;, ambiguous grammars can lead to difficulties for some &lt;a title="Compilers" href="http://en.wikipedia.org/wiki/Compilers"&gt;compilers&lt;/a&gt;.&lt;br /&gt;[&lt;a title="Ambiguous grammar" href="http://en.wikipedia.org/w/index.php?title=Ambiguous_grammar&amp;amp;action=edit&amp;section=1"&gt;edit&lt;/a&gt;]&lt;br /&gt;&lt;a id="Example" name="Example"&gt;&lt;/a&gt;&lt;br /&gt;Example&lt;br /&gt;The &lt;a title="Context free grammar" href="http://en.wikipedia.org/wiki/Context_free_grammar"&gt;context free grammar&lt;/a&gt;&lt;br /&gt;A → A + A  A − A  a&lt;br /&gt;is ambiguous since there are two leftmost derivations for the string a + a − a:&lt;br /&gt;   &lt;br /&gt;A&lt;br /&gt;→ A + A&lt;br /&gt;       &lt;br /&gt;A&lt;br /&gt;→ A − A&lt;br /&gt;   &lt;br /&gt;→ a + A&lt;br /&gt;       &lt;br /&gt;→ A + A − A&lt;br /&gt;   &lt;br /&gt;→ a + A − A&lt;br /&gt;       &lt;br /&gt;→ a + A − A&lt;br /&gt;   &lt;br /&gt;→ a + a − A&lt;br /&gt;       &lt;br /&gt;→ a + a − A&lt;br /&gt;   &lt;br /&gt;→ a + a − a&lt;br /&gt;       &lt;br /&gt;→ a + a − a&lt;br /&gt;Equivalently, it is ambiguous since there are two parse trees for the string a + a − a:&lt;br /&gt;&lt;a class="image" title=" " href="http://en.wikipedia.org/wiki/Image:Leftmostderivations_jaredwf.png"&gt;&lt;/a&gt;&lt;br /&gt;The language that it generates, however, is not inherently ambiguous; the following is a non-ambiguous grammar generating the same language:&lt;br /&gt;A → A + a  A − a  a&lt;br /&gt;[&lt;a title="Ambiguous grammar" href="http://en.wikipedia.org/w/index.php?title=Ambiguous_grammar&amp;action=edit&amp;amp;section=2"&gt;edit&lt;/a&gt;]&lt;br /&gt;&lt;a id="References" name="References"&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14919694-112261886034119759?l=apuraliezl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://apuraliezl.blogspot.com/feeds/112261886034119759/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14919694&amp;postID=112261886034119759' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14919694/posts/default/112261886034119759'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14919694/posts/default/112261886034119759'/><link rel='alternate' type='text/html' href='http://apuraliezl.blogspot.com/2005/07/assignment-2.html' title='Assignment #2'/><author><name>Liezl</name><uri>http://www.blogger.com/profile/01245911737444222875</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14919694.post-112261801214273157</id><published>2005-07-28T23:07:00.000-07:00</published><updated>2005-07-28T23:20:12.146-07:00</updated><title type='text'>Assignment #1</title><content type='html'>&lt;span style="font-family:arial;"&gt; #1. &lt;/span&gt;&lt;span &gt;Personal Profile of Kleene..&lt;/span&gt;&lt;br /&gt;                 &lt;span style="font-family:arial;"&gt; &lt;/span&gt;&lt;span &gt;    &lt;/span&gt;&lt;a href="http://www.brainyencyclopedia.com/encyclopedia/s/st/stephen_cole_kleene.html"&gt;&lt;span &gt;http://www.brainyencyclopedia.com/encyclopedia/s/st/stephen_cole_kleene.html&lt;/span&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14919694-112261801214273157?l=apuraliezl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://apuraliezl.blogspot.com/feeds/112261801214273157/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14919694&amp;postID=112261801214273157' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14919694/posts/default/112261801214273157'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14919694/posts/default/112261801214273157'/><link rel='alternate' type='text/html' href='http://apuraliezl.blogspot.com/2005/07/assignment-1.html' title='Assignment #1'/><author><name>Liezl</name><uri>http://www.blogger.com/profile/01245911737444222875</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
