Jump to content

Simplification grammar

- - - - -

  • Please log in to reply
No replies to this topic

#1
Apprentice123

Apprentice123

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 430 posts
Simplification the grammar
S -> XYZ
X -> AXA | BXB | Z | E
Y -> AYB | BYA | Z | E
A -> a
B -> b
Z -> Zu | Zv | E


First step: Deleting empty productions
I find:

S -> XYZ | XY | XZ | YZ | X | Y | Z
X -> AXA | BXB | Z | AA | BB
Y -> AYB | BYA | Z | AB | BA
A -> a
B -> b
Z -> Zu | Zv | u | v

The first step is correct?




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users