0

I need help constructing a Left Linear grammar for the language

L = { a^n b^m c^p | n>=2, m>=3, p>=4 }

Here is what I have so far, I know :

N = {S}

T = { a, b, c }

P = {

S -> Pcccc

P -> Pc

P -> M

M -> Mbbb

M ->Mb

M -> N

N ->Naa

N->a

}

I need help figuring out the productions. I am not sure if I am doing it right.

Mike
  • 477
  • 2
  • 7
  • 24
  • hint `S --> Pcccc`, P --> Pc, P --> M, M --> Mbbb, M --> Mb, ....` – Grijesh Chauhan Feb 17 '14 at 05:32
  • Second Hint is: RE for this is `aaa*bbbb*ccccc*` Now use [RE to grammar](http://stackoverflow.com/questions/13816439/left-linear-and-right-linear-grammars/13945932#13945932) – Grijesh Chauhan Feb 17 '14 at 05:33
  • @GrijeshChauhan Thank you for the hints. Could you please explain your first hint a little and what you had to do to come up with it? – Mike Feb 17 '14 at 05:47
  • Very Good, Just small mistake In left-liner grammar unite productions like `P --> M` are not allowed productions can be either in the form of `A -->Bccc` or `A --> b` **Hint**: you can combine `P -> M` and `M -> Mbbb` as `P --> Mbbb`. – Grijesh Chauhan Feb 17 '14 at 10:45

0 Answers0