Derivation Problem

[Ch. 1: Overview and History]
[Syntax]
[Names and Scope]
[Types and Type Systems]
[Semantics]
[Functions]
[Memory Management]
[Imperitive Programs and Functional Abstraction]
[Modular and Class Abstraction]
[Functional Programming]
[Logic Programming]

[ECFG for Tucker and Noonan's Clite Language]
[Plain C CFG]
[Abstract Syntax for for Tucker and Noonan's Clite Language]
[Derivation Problem]
[Regular Expression Problems]

Consider the following CFG:
S | → | B(S) | B | BC |

B | → | a B | b b B | b |

C | → | c C c | c | [B] |

**bbb**⇒- Yes. Replace
*S*with*B*and follow your nose.

- Yes. Replace
**bb**⇒- No. Starting from
*B*, if you introduce**b**, you must stop. So you introduce**bb**, but you cannot stop there, so there is no way to produce two**b**s. You can only make odd numbers of**b**s.

- No. Starting from
**ba**⇒- No. There is no way to introduce an
**a**at the end of the string.

- No. There is no way to introduce an
**abbb(bccc)**⇒- Yes. Use
*S*→*B*(*S*), then use*S*→*BC*on the second*S*.

- Yes. Use
**bbb[ab]**⇒- Yes. Start with
*S*→*BC*, and use*C*→**[***B***]**, then you can derive each part from*B*.

- Yes. Start with
**cabc**⇒- No. To generate a
**c**, you must introduce a*C*. From*S*, you can't use*S*→*B*(*S*) since you don't want the parens. You can't use*S*→*B*since you can never introduce a*C*. So you must start with*S*→*BC*. But anything that comes from*B*must start with**a**or**b**. So nothing can generate**cabc**.

- No. To generate a
**bbab(bc[b]c)**⇒- Yes. Start with
*S*→*B*(*S*) →*B*(*BC*) →*B*(*B***c***C***c**)→*B*(*B***c****[***B***]****c**). Proceed from there.

- Yes. Start with
**bbbccc**⇒- Yes. Start with
*S*→*BC*.

- Yes. Start with