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
  • 280,205
  • 27
  • 317
  • 514
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.
  • 167,959
  • 22
  • 232
  • 500