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: I just realized I could rewrite the language and then define the CFGas S -> L1 | L2 whereas L1 and L2 is the union shown in the imageHowever, 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.
Constructing CFG from instructions where you have an OR
formal languages;context free;formal grammars