CFG para definir un idioma
Frecuentes
Visto 47 equipos
0
I need to generate a context free grammar for this language L= { a^i b^j c^k | i, j, k ≥ 0 , i = j or i = k }
what I already have is S : aSc | T | abS T : bT | cT | ԑ
Do you guys think that the above grammar can correctly define the language? if not, is there any better suggestion?
1 Respuestas
0
No, that grammar does not correctly define the language. It accepts "bc", for instance.
contestado el 28 de mayo de 14 a las 14:05
No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas compiler-construction computer-science context-free-grammar or haz tu propia pregunta.
Thanks, I guess I can generate two grammars, one for i = j and the other for i = k, then combine both grammars to define the language. - Lucy