Jump to content

context-free language and grammar

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
2 replies to this topic

#1
Apprentice123

Apprentice123

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 430 posts
What is the language generated by this grammar:
G=({S,X,Y,Z,A,B}, {a,b,u,v}, P, S)
S -> XYZ
X -> AXA | BXB | Z | E
Y -> AYB | BYA | Z | E
A -> a
B -> b
Z -> Zu | Zv | E


I have not found
I think is 2 b's more than a ou 2 a's more than b. But u and v ?

#2
JCoder

JCoder

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 245 posts
abbaababuv
abbabaababbaaababababbuuuuuuuuuuuuvuvvvvvvvvuuuuuuuuuvuuuuuuuuuuuuuv

and so on

:D

#3
Apprentice123

Apprentice123

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 430 posts
OK. But how can I set this language?