0
$\begingroup$

If a grammar has the same variable multiple times, is it the same as adding a $\mid$ between them? For example, is

$$\begin{align*}S &\to bB \\ S &\to \varepsilon \\ B &\to cB \\ B &\to \varepsilon \end{align*}$$

equal to the following?

$$\begin{align*}S &\to bB \mid \varepsilon \\ B &\to cB \mid \varepsilon \\ \end{align*}$$

$\endgroup$
0
$\begingroup$

Yes. (you are right, the "$\mid$" sign is a classical notation for the alternative rules for a variable.)

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.