1

I'm trying to design a CFG that accept the words of the following language:

$$L = \{a^i(b+c)^jd^k \mid i<j+k; \quad i,j,k>0\}$$

My first approximation would be to do $i = j+k$ as something like:

$S\to aSd \mid X$

$X\to aXY \mid aY $

$Y\to b \mid c$

But then I don't know how to make the jump to the $<$.

Yuval Filmus
  • 276,994
  • 27
  • 311
  • 503
Xhark
  • 121
  • 3

1 Answers1

1

Whenever you see a condition $i<j+k$, you can translate that to the condition $i+\ell=j+k$ where $\ell>0$, then use the methods you know for handling $=$ instead of $<$.

See our reference question on this subject for more systematic answers.

D.W.
  • 159,275
  • 20
  • 227
  • 470
  • I'm sorry, I'm sure that make sense , but i don't really understand how to apply it to my problem. – Xhark Jun 26 '18 at 15:55
  • @Xhark, then I suggest you study the material in our reference question. That's why I linked it. I'm happy to help you understand concepts and learn new approaches to solve problems, but solving exercise-style problems for you wouldn't really help anyone. – D.W. Jun 26 '18 at 16:17