0

cfg

My question is: What tips or ideas do you have when you're gonna construct a CFG out of these instructions? If we only had 0 < i <= k, it'd be more straight forward if you ask me, but when we have an OR there, how should I approach it?

edit:

enter image description here

I just realized I could rewrite the language and then define the CFG as S -> L1 | L2 whereas L1 and L2 is the union shown in the image

However, I still am not very sure if this would be the easiest way. Therefore, I'd still be happy if someone could show me an example of how to construct this CFG.

Raphael
  • 72,336
  • 29
  • 179
  • 389

0 Answers0