How to do this question Contextfree grammars are sometimes u
How to do this question?
Context-free grammars are sometimes used to model natural languages. In this problem you will model a fragment of the English language using context-free grammars. Consider the following English sentences:
Solution
The girl that the teacher that the staff that the reporter interview saw knows met the boy.
(a)
Noun -> staff | reporter | boy |interview
verb -> knows | met
determiner -> the | that
pronoun -> me | I | you | it
proper-Noun -> girl | teacher
S -> NP VP
NP -> pronoun | proper-Noun | Nominal | NP
Nominal -> Noun
VP -> Verb | Verb NP
-----------------------------------------------------------------------------------------------------------
(b)
This grammar is not regular, since we can generate other sequences of sentences too.
--------------------------------------------------------------------------------------------------------------------------
(c)
One of the example that is in G but not sense to common english is ..
S -> NP VP
S -> you NP VP
S -> you teacher NP VP
S-> you teacher girl VP
S-> you teacher girl knows VP
S-> you teacher girl knows met
This sentence is \"you teacher girl knows met\" not sense to common english, but we are able to generate using Grammar G.
