Is there any specific methodology followed to specify a language for given grammar ?? i.e. Is it necessary to run all the production rules given in a grammar to determine the language it represents? I don’t have an example as such since the one I am working on is a homework question.
[edit]: adding an example, Describe, in English, the language defined by the grammar
<S> -> <A> <B> <C>
<A> -> a <A> | a
<B> -> b <B> | b
<C> -> c <C> | c
Regards,
darkie15
In you example, the part
recognizes exactly non empty lists of
aThe same goes for the two other productions,
<B>and<C>, with respectivelybandc.Thus, with
<S> -> <A> <B> <C>, you deduce that the language this grammar recognizes is any non empty list ofa, followed by a non empty list ofb, then a non empty list ofc, corresponding to the regular expressiona+b+c+.Proof is quite easy from there to show that each instance recognized by the regular expression is recognized by the grammar, using induction.