CP-414: Consider the Context Free Grammar With the Rules - IT Assignment Help

Download Solution Order New Solution
Assignment Task 

Task:

1. Consider the context-free grammar with the rules (E is start variable)
E ® E + T | E - T | T
T ® T  ? F | T / F | F
F ® ( E ) | x | y
Give parse tree and leftmost derivation for each string
a) y+y ?y-x
b) x/y+x
c) (y+x)  ? (y-x) - y
d) ((((y))))
2. Convert CFG from question 1 to an equivalent PDA using the procedure given in Theorem 2.20.
3. Consider the context free grammar with the rules (S is start variable, A and B are variables, 0 and 1 are terminals):
S ® A | B | 0
A ® 1S
B ® 1S0S
Show that this grammar is ambiguous, i.e., give an example of a string in language that has two different leftmost derivations, Show your work (in particular show those derivations).

4. Convert the following CFG (S is start variable) into an equivalent CFG in Chomsky normal form, using the procedure given in Theorem 9. Show all intermediate steps.
S ® ASB | AB | A01
B ® AS | A
A ® 11 | e

5. Use pumping lemma to show that the following language is not context-free: {xmyn xm | n>m>0}. Provide detailed proof.
6. Give a context-free grammar generating the language of all strings over alphabet {0,1} with twice as many 0s as 1s. For example, strings 001010, 110000, 010, 100, 010001 are in this language, while strings 0110, 1, 0, 0000000001 are not. Justify correctness of your grammar.

7. Consider two languages: L1={ an bn cmam | n>0,m>=0} and L2={ an bn cn am | n>0,m>=0}. Show that one of them is context-free (by providing a context-free grammar that defies this language) and another is not context-free (by using closure properties of context-free and regular languages). Do not use pumping lemma!

 

This CP-414 IT Assignment has been solved by our IT Experts at My Uni Paper. Our Assignment Writing Experts are efficient to provide a fresh solution to this question. We are serving more than 10000+ Students in Australia, UK & US by helping them to score HD in their academics. Our Experts are well trained to follow all marking rubrics & referencing style.

Be it a used or new solution, the quality of the work submitted by our assignment experts remains unhampered. You may continue to expect the same or even better quality with the used and new assignment solution files respectively. There’s one thing to be noticed that you could choose one between the two and acquire an HD either way. You could choose a new assignment solution file to get yourself an exclusive, plagiarism (with free Turnitin file), expert quality assignment or order an old solution file that was considered worthy of the highest distinction.

Get It Done! Today

Country
Applicable Time Zone is AEST [Sydney, NSW] (GMT+11)
+

Every Assignment. Every Solution. Instantly. Deadline Ahead? Grab Your Sample Now.