Chomsky and Greibach Normal Forms

60
Chomsky and Greibach Normal Forms Chomsky and Greibach Normal Forms – p.1/24

Transcript of Chomsky and Greibach Normal Forms

Page 1: Chomsky and Greibach Normal Forms

Chomsky and Greibach NormalForms

Chomsky and Greibach Normal Forms – p.1/24

Page 2: Chomsky and Greibach Normal Forms

Simplifying a CFG

� It is often convenient to simplify CFG

One of the simplest and most useful simplified forms ofCFG is called the Chomsky normal form

Another normal form usually used in algebraicspecifications is Greibach normal form

Note the difference between grammar cleaning and simplification

Chomsky and Greibach Normal Forms – p.2/24

Page 3: Chomsky and Greibach Normal Forms

Simplifying a CFG

� It is often convenient to simplify CFG

� One of the simplest and most useful simplified forms ofCFG is called the Chomsky normal form

Another normal form usually used in algebraicspecifications is Greibach normal form

Note the difference between grammar cleaning and simplification

Chomsky and Greibach Normal Forms – p.2/24

Page 4: Chomsky and Greibach Normal Forms

Simplifying a CFG

� It is often convenient to simplify CFG

� One of the simplest and most useful simplified forms ofCFG is called the Chomsky normal form

� Another normal form usually used in algebraicspecifications is Greibach normal form

Note the difference between grammar cleaning and simplification

Chomsky and Greibach Normal Forms – p.2/24

Page 5: Chomsky and Greibach Normal Forms

Simplifying a CFG

� It is often convenient to simplify CFG

� One of the simplest and most useful simplified forms ofCFG is called the Chomsky normal form

� Another normal form usually used in algebraicspecifications is Greibach normal form

Note the difference between grammar cleaning and simplification

Chomsky and Greibach Normal Forms – p.2/24

Page 6: Chomsky and Greibach Normal Forms

Note

Normal forms are useful when more advanced topics in

computation theory are approached, as we shall see further

Chomsky and Greibach Normal Forms – p.3/24

Page 7: Chomsky and Greibach Normal Forms

Definition

A context-free grammar

is in Chomsky normal form ifevery rule is of the form:

� � � � �

� � � �

where � is a terminal,�

��

are nonterminals, and

��

may not be the start variable (the axiom)

Chomsky and Greibach Normal Forms – p.4/24

Page 8: Chomsky and Greibach Normal Forms

Note

The rule

� � � �, where

is the start variable, is not ex-

cluded from a CFG in Chomsky normal form.

Chomsky and Greibach Normal Forms – p.5/24

Page 9: Chomsky and Greibach Normal Forms

Theorem 2.9

Any context-free language is generated by a context-freegrammar in Chomsky normal form.

Proof idea:

Show that any CFG can be converted into a CFG inChomsky normal form

Conversion procedure has several stages where the rules thatviolate Chomsky normal form conditions are replaced withequivalent rules that satisfy these conditions

Order of transformations: (1) add a new start variable, (2)eliminate all -rules, (3) eliminate unit-rules, (4) convert other rules

Check that the obtained CFG defines the same language

Chomsky and Greibach Normal Forms – p.6/24

Page 10: Chomsky and Greibach Normal Forms

Theorem 2.9

Any context-free language is generated by a context-freegrammar in Chomsky normal form.

Proof idea:

Show that any CFG can be converted into a CFG inChomsky normal form

Conversion procedure has several stages where the rules thatviolate Chomsky normal form conditions are replaced withequivalent rules that satisfy these conditions

Order of transformations: (1) add a new start variable, (2)eliminate all -rules, (3) eliminate unit-rules, (4) convert other rules

Check that the obtained CFG defines the same language

Chomsky and Greibach Normal Forms – p.6/24

Page 11: Chomsky and Greibach Normal Forms

Theorem 2.9

Any context-free language is generated by a context-freegrammar in Chomsky normal form.

Proof idea:

Show that any CFG

can be converted into a CFG

� �

inChomsky normal form

Conversion procedure has several stages where the rules thatviolate Chomsky normal form conditions are replaced withequivalent rules that satisfy these conditions

Order of transformations: (1) add a new start variable, (2)eliminate all -rules, (3) eliminate unit-rules, (4) convert other rules

Check that the obtained CFG defines the same language

Chomsky and Greibach Normal Forms – p.6/24

Page 12: Chomsky and Greibach Normal Forms

Theorem 2.9

Any context-free language is generated by a context-freegrammar in Chomsky normal form.

Proof idea:

Show that any CFG

can be converted into a CFG

� �

inChomsky normal form

Conversion procedure has several stages where the rules thatviolate Chomsky normal form conditions are replaced withequivalent rules that satisfy these conditions

Order of transformations: (1) add a new start variable, (2)eliminate all -rules, (3) eliminate unit-rules, (4) convert other rules

Check that the obtained CFG defines the same language

Chomsky and Greibach Normal Forms – p.6/24

Page 13: Chomsky and Greibach Normal Forms

Theorem 2.9

Any context-free language is generated by a context-freegrammar in Chomsky normal form.

Proof idea:

Show that any CFG

can be converted into a CFG

� �

inChomsky normal form

Conversion procedure has several stages where the rules thatviolate Chomsky normal form conditions are replaced withequivalent rules that satisfy these conditions

Order of transformations: (1) add a new start variable, (2)eliminate all �-rules, (3) eliminate unit-rules, (4) convert other rules

Check that the obtained CFG defines the same language

Chomsky and Greibach Normal Forms – p.6/24

Page 14: Chomsky and Greibach Normal Forms

Theorem 2.9

Any context-free language is generated by a context-freegrammar in Chomsky normal form.

Proof idea:

Show that any CFG

can be converted into a CFG

� �

inChomsky normal form

Conversion procedure has several stages where the rules thatviolate Chomsky normal form conditions are replaced withequivalent rules that satisfy these conditions

Order of transformations: (1) add a new start variable, (2)eliminate all �-rules, (3) eliminate unit-rules, (4) convert other rules

Check that the obtained CFG

� �

defines the same language

Chomsky and Greibach Normal Forms – p.6/24

Page 15: Chomsky and Greibach Normal Forms

Proof

Let

� � � ��

��

��

� �

be the original CFG.

Step 1: add a new start symbol to , and the rule to

Note: this change guarantees that the start symbol of does not occur

on the of any rule

Chomsky and Greibach Normal Forms – p.7/24

Page 16: Chomsky and Greibach Normal Forms

Proof

Let

� � � ��

��

��

� �

be the original CFG.

Step 1: add a new start symbol

��� to

, and the rule

��� � � �

to

Note: this change guarantees that the start symbol of does not occur

on the of any rule

Chomsky and Greibach Normal Forms – p.7/24

Page 17: Chomsky and Greibach Normal Forms

Proof

Let

� � � ��

��

��

� �

be the original CFG.

Step 1: add a new start symbol

��� to

, and the rule

��� � � �

to

Note: this change guarantees that the start symbol of

� �

does not occur

on the � ��� of any rule

Chomsky and Greibach Normal Forms – p.7/24

Page 18: Chomsky and Greibach Normal Forms

Step 2: eliminate �-rules

Repeat

1. Eliminate the � rule

�� � � from

where�

is not the start symbol

2. For each occurrence of

on the � �� of a rule, add a new rule to

with that occurrence of

deletedExample: replace

� � �� ��� by� � �� � � �� � ;

replace

� � �� � � ��� by

� � �� � � ��� �� � ��� �� ��� � �� � �

3. Replace the rule

� � � �, (if it is present) by

� � � � �� unless the

rule

� � � � has been previously eliminated

until all � rules are eliminated

Chomsky and Greibach Normal Forms – p.8/24

Page 19: Chomsky and Greibach Normal Forms

Step 3: remove unit rules

Repeat

1. Remove a unit rule

�� � � � �

2. For each rule

� � �� � �

, add the rule�� �� to

, unless

� �� was a unit rule previously removed

until all unit rules are eliminated

Note: � is a string of variables and terminals

Chomsky and Greibach Normal Forms – p.9/24

Page 20: Chomsky and Greibach Normal Forms

Convert all remaining rules

Repeat1. Replace a rule

�� �� �� � � � �� � ,

� � �

, where each� � ,

� �

,is a variable or a terminal, by:

�� �� � � � ,

� � � �� � � � , � � �,

� ��� � � �� ��� �� �

where

� � ,

� � , � � �,

� ��� � are new variables

2. If

� �

replace any terminal� � with a new variable

� � and add therule

� � � �� �

until no rules of the form � � � � �� � � � � with

� �

remain

Chomsky and Greibach Normal Forms – p.10/24

Page 21: Chomsky and Greibach Normal Forms

Convert all remaining rules

Repeat1. Replace a rule

�� �� �� � � � �� � ,

� � �

, where each� � ,

� �

,is a variable or a terminal, by:

�� �� � � � ,

� � � �� � � � , � � �,

� ��� � � �� ��� �� �

where

� � ,

� � , � � �,

� ��� � are new variables

2. If

� �

replace any terminal� � with a new variable

� � and add therule

� � � �� �

until no rules of the form � � � � �� � � � � with

� �

remain

Chomsky and Greibach Normal Forms – p.10/24

Page 22: Chomsky and Greibach Normal Forms

Convert all remaining rules

Repeat1. Replace a rule

�� �� �� � � � �� � ,

� � �

, where each� � ,

� �

,is a variable or a terminal, by:

�� �� � � � ,

� � � �� � � � , � � �,

� ��� � � �� ��� �� �

where

� � ,

� � , � � �,

� ��� � are new variables

2. If

� �

replace any terminal� � with a new variable

� � and add therule

� � � �� �

until no rules of the form � � � � �� � � � � with

� �

remain

Chomsky and Greibach Normal Forms – p.10/24

Page 23: Chomsky and Greibach Normal Forms

Example CFG conversion

Consider the grammar

��� whose rules are:

� � � � � � � � �

� � � � �

� � � � ��

Notation: symbols removed are green and those added are red.

After first step of transformation we get:

�� � � �

� � � � � � �� �

�� � � � �

� � � � ��

Chomsky and Greibach Normal Forms – p.11/24

Page 24: Chomsky and Greibach Normal Forms

Example CFG conversion

Consider the grammar

��� whose rules are:

� � � � � � � � �

� � � � �

� � � � ��

Notation: symbols removed are green and those added are red.

After first step of transformation we get:

�� � � �

� � � � � � �� �

�� � � � �

� � � � ��

Chomsky and Greibach Normal Forms – p.11/24

Page 25: Chomsky and Greibach Normal Forms

Example CFG conversion

Consider the grammar

��� whose rules are:

� � � � � � � � �

� � � � �

� � � � ��

Notation: symbols removed are green and those added are red.

After first step of transformation we get:

�� � � �

� � � � � � �� �

�� � � � �

� � � � ��

Chomsky and Greibach Normal Forms – p.11/24

Page 26: Chomsky and Greibach Normal Forms

Removing � rules

Removing

� � �:

��� � � �

� � � � � � ��� � �

� � � � � �

� � � � Removing

� � �:

��� � � �

� � � � � � ��� ��� � � � � � � � �

� � � � � �

� � �

Chomsky and Greibach Normal Forms – p.12/24

Page 27: Chomsky and Greibach Normal Forms

Removing � rules

Removing

� � �:

��� � � �

� � � � � � ��� � �

� � � � � �

� � � � Removing

� � �:

��� � � �

� � � � � � ��� ��� � � � � � � � �

� � � � � �

� � �

Chomsky and Greibach Normal Forms – p.12/24

Page 28: Chomsky and Greibach Normal Forms

Removing � rules

Removing

� � �:

��� � � �

� � � � � � ��� � �

� � � � � �

� � � � Removing

� � �:

��� � � �

� � � � � � ��� ��� � � � � � � � �

� � � � � �

� � �

Chomsky and Greibach Normal Forms – p.12/24

Page 29: Chomsky and Greibach Normal Forms

Removing unit rule

Removing

� � �

:

��� � � �

� � � � � � ��� ��� � � � � � � � �

� � � � �

� � �

Removing

�� � �

:

��� � � � � � � � � � � � � � � � � �

� � � � � � ��� ��� � � � � � �

� � � � �

� � �

Chomsky and Greibach Normal Forms – p.13/24

Page 30: Chomsky and Greibach Normal Forms

Removing unit rule

Removing

� � �

:

��� � � �

� � � � � � ��� ��� � � � � � � � �

� � � � �

� � �

Removing

�� � �

:

��� � � � � � � � � � � � � � � � � �

� � � � � � ��� ��� � � � � � �

� � � � �

� � �

Chomsky and Greibach Normal Forms – p.13/24

Page 31: Chomsky and Greibach Normal Forms

Removing unit rule

Removing

� � �

:

��� � � �

� � � � � � ��� ��� � � � � � � � �

� � � � �

� � �

Removing

�� � �

:

��� � � � � � � � � � � � � � � � � �

� � � � � � ��� ��� � � � � � �

� � � � �

� � �

Chomsky and Greibach Normal Forms – p.13/24

Page 32: Chomsky and Greibach Normal Forms

More unit rules

Removing

� � �

:

� � � � � � � ��� ��� � � � � � �

� � � � � � ��� ��� � � � � � �

� � � � � � �

� � �

Removing

� � �

:

� � � � � � � ��� ��� � � � � � �

� � � � � � ��� ��� � � � � � �

� � � � � � � � � � �� �� � � � � � �

� � �

Chomsky and Greibach Normal Forms – p.14/24

Page 33: Chomsky and Greibach Normal Forms

More unit rules

Removing

� � �

:

� � � � � � � ��� ��� � � � � � �

� � � � � � ��� ��� � � � � � �

� � � � � � �

� � �

Removing

� � �

:

� � � � � � � ��� ��� � � � � � �

� � � � � � ��� ��� � � � � � �

� � � � � � � � � � �� �� � � � � � �

� � �

Chomsky and Greibach Normal Forms – p.14/24

Page 34: Chomsky and Greibach Normal Forms

More unit rules

Removing

� � �

:

� � � � � � � ��� ��� � � � � � �

� � � � � � ��� ��� � � � � � �

� � � � � � �

� � �

Removing

� � �

:

� � � � � � � ��� ��� � � � � � �

� � � � � � ��� ��� � � � � � �

� � � � � � � � � � �� �� � � � � � �

� � �

Chomsky and Greibach Normal Forms – p.14/24

Page 35: Chomsky and Greibach Normal Forms

Converting remaining rules

�� � � � � � � � � � � � � � � � �

� � � � � � � � � � � � � � � � �

�� � � � � � � � � � �� � � � � � �

� � � � � �

� � � �

� � � �

Chomsky and Greibach Normal Forms – p.15/24

Page 36: Chomsky and Greibach Normal Forms

Converting remaining rules

�� � � � � � � � � � � � � � � � �

� � � � � � � � � � � � � � � � �

�� � � � � � � � � � �� � � � � � �

� � � � � �

� � � �

� � � �

Chomsky and Greibach Normal Forms – p.15/24

Page 37: Chomsky and Greibach Normal Forms

Converting remaining rules

�� � � � � � � � � � � � � � � � �

� � � � � � � � � � � � � � � � �

�� � � � � � � � � � �� � � � � � �

� � � � � �

� � � �

� � � �

Chomsky and Greibach Normal Forms – p.15/24

Page 38: Chomsky and Greibach Normal Forms

Note

� The conversion procedure produces severalvariables along with several rules � .

� Since all these represent the same rule, wemay simplify the result using a single variable

and a single rule �

Chomsky and Greibach Normal Forms – p.16/24

Page 39: Chomsky and Greibach Normal Forms

Note

� The conversion procedure produces severalvariables along with several rules � .

� Since all these represent the same rule, wemay simplify the result using a single variable

and a single rule �

Chomsky and Greibach Normal Forms – p.16/24

Page 40: Chomsky and Greibach Normal Forms

Note

� The conversion procedure produces severalvariables along with several rules � .

� Since all these represent the same rule, wemay simplify the result using a single variable

and a single rule �

Chomsky and Greibach Normal Forms – p.16/24

Page 41: Chomsky and Greibach Normal Forms

Greibach Normal Form

A context-free grammar � �� � �

� �is in

Greibach normal form if each rule � � has theproperty:

�� � � � � , �� � � � � � , � � and

� �

.

Note: Greibach normal form provides a justifica-

tion of operator prefix-notation usually employed

in algebra.

Chomsky and Greibach Normal Forms – p.17/24

Page 42: Chomsky and Greibach Normal Forms

Greibach Normal Form

A context-free grammar � �� � �

� �is in

Greibach normal form if each rule � � has theproperty:

�� � � � � , �� � � � � � , � � and

� �

.

Note: Greibach normal form provides a justifica-

tion of operator prefix-notation usually employed

in algebra.

Chomsky and Greibach Normal Forms – p.17/24

Page 43: Chomsky and Greibach Normal Forms

Greibach Normal Form

A context-free grammar � �� � �

� �is in

Greibach normal form if each rule � � has theproperty:

�� � � � � , �� � � � � � , � � and

� �

.

Note: Greibach normal form provides a justifica-

tion of operator prefix-notation usually employed

in algebra.

Chomsky and Greibach Normal Forms – p.17/24

Page 44: Chomsky and Greibach Normal Forms

Greibach Theorem

Every CFL

where � � �

can be generated by aCFG in Greibach normal form.Proof idea: Let

��� ���� �� �� �

be a CFG generating

. Assume that

is in Chomsky normal form

Let

� � � � �� � �� � � �� � � �

be an ordering of nonterminals.

Construct the Greibach normal form from Chomsky normal form

Chomsky and Greibach Normal Forms – p.18/24

Page 45: Chomsky and Greibach Normal Forms

Greibach Theorem

Every CFL

where � � �

can be generated by aCFG in Greibach normal form.Proof idea: Let

��� ���� �� �� �

be a CFG generating

. Assume that

is in Chomsky normal form

Let

� � � � �� � �� � � �� � � �

be an ordering of nonterminals.

Construct the Greibach normal form from Chomsky normal form

Chomsky and Greibach Normal Forms – p.18/24

Page 46: Chomsky and Greibach Normal Forms

Greibach Theorem

Every CFL

where � � �

can be generated by aCFG in Greibach normal form.Proof idea: Let

��� ���� �� �� �

be a CFG generating

. Assume that

is in Chomsky normal form

Let

� � � � �� � �� � � �� � � �

be an ordering of nonterminals.

Construct the Greibach normal form from Chomsky normal form

Chomsky and Greibach Normal Forms – p.18/24

Page 47: Chomsky and Greibach Normal Forms

Construction

1. Modify the rules in

so that if

� � � ��� � � �

then� �

2. Starting with

� � and proceeding to

� � this is done as follows:

(a) Assume that productions have been modified so that for

� �

,

� � � ��� � � �

only if� �

(b) If

� � � ��� � is a production with� � �

, generate a new set ofproductions substituting for the

� � the rhs of each

� �

production

(c) Repeating (b) at most� � �

times we obtain rules of the form� � � ��� �, � � �

(d) Replace rules� � � � � � by removing left-recursive rules

Chomsky and Greibach Normal Forms – p.19/24

Page 48: Chomsky and Greibach Normal Forms

Construction

1. Modify the rules in

so that if

� � � ��� � � �

then� �

2. Starting with

� � and proceeding to

� � this is done as follows:

(a) Assume that productions have been modified so that for

� �

,

� � � ��� � � �

only if� �

(b) If

� � � ��� � is a production with� � �

, generate a new set ofproductions substituting for the

� � the rhs of each

� �

production

(c) Repeating (b) at most� � �

times we obtain rules of the form� � � ��� �, � � �

(d) Replace rules� � � � � � by removing left-recursive rules

Chomsky and Greibach Normal Forms – p.19/24

Page 49: Chomsky and Greibach Normal Forms

Construction

1. Modify the rules in

so that if

� � � ��� � � �

then� �

2. Starting with

� � and proceeding to

� � this is done as follows:

(a) Assume that productions have been modified so that for

� �

,

� � � ��� � � �

only if� �

(b) If

� � � ��� � is a production with� � �

, generate a new set ofproductions substituting for the

� � the rhs of each

� �

production

(c) Repeating (b) at most� � �

times we obtain rules of the form� � � ��� �, � � �

(d) Replace rules� � � � � � by removing left-recursive rules

Chomsky and Greibach Normal Forms – p.19/24

Page 50: Chomsky and Greibach Normal Forms

Removing left-recursion

Left-recursion can be eliminated by the followingscheme:

If

� � ��� � � ��� � � � �� �� � are all

left recursive rules, and

� � � � � � � � � � �� ��� are all remaining�

-rules then chose a newnonterminal, say

Add the new

-rules

� � � � � � � �,

� �

Replace the

-rules by� � � � � � � �

,

� �

This construction preserve the language

.

Chomsky and Greibach Normal Forms – p.20/24

Page 51: Chomsky and Greibach Normal Forms

Removing left-recursion

Left-recursion can be eliminated by the followingscheme:

If

� � ��� � � ��� � � � �� �� � are all

left recursive rules, and

� � � � � � � � � � �� ��� are all remaining�

-rules then chose a newnonterminal, say

Add the new

-rules

� � � � � � � �,

� �

Replace the

-rules by� � � � � � � �

,

� �

This construction preserve the language

.

Chomsky and Greibach Normal Forms – p.20/24

Page 52: Chomsky and Greibach Normal Forms

Removing left-recursion

Left-recursion can be eliminated by the followingscheme:

If

� � ��� � � ��� � � � �� �� � are all

left recursive rules, and

� � � � � � � � � � �� ��� are all remaining�

-rules then chose a newnonterminal, say

Add the new

-rules

� � � � � � � �,

� �

Replace the

-rules by� � � � � � � �

,

� �

This construction preserve the language

.

Chomsky and Greibach Normal Forms – p.20/24

Page 53: Chomsky and Greibach Normal Forms

21-1

Page 54: Chomsky and Greibach Normal Forms

More on Greibach NF

See Introduction to Automata Theory, Languages,

and Computation, J.E, Hopcroft and J.D Ullman,

Addison-Wesley 1979, p. 94–96

Chomsky and Greibach Normal Forms – p.22/24

Page 55: Chomsky and Greibach Normal Forms

Example

Convert the CFG

��� � � � �� � �� ���

�� ��� � �� �� � �

where

�� � � � � � � ��� � � � ��

� � � �� �� � � � � � �� �

into Greibach normal form.

Chomsky and Greibach Normal Forms – p.23/24

Page 56: Chomsky and Greibach Normal Forms

Example

Convert the CFG

��� � � � �� � �� ���

�� ��� � �� �� � �

where

�� � � � � � � ��� � � � ��

� � � �� �� � � � � � �� �

into Greibach normal form.

Chomsky and Greibach Normal Forms – p.23/24

Page 57: Chomsky and Greibach Normal Forms

Example

Convert the CFG

��� � � � �� � �� ���

�� ��� � �� �� � �

where

�� � � � � � � ��� � � � ��

� � � �� �� � � � � � �� �

into Greibach normal form.

Chomsky and Greibach Normal Forms – p.23/24

Page 58: Chomsky and Greibach Normal Forms

Solution

1. Step 1: ordering the rules: (Only

�� rules violate ordering

conditions, hence only

�� rules need to be changed).

Following the procedure we replace

�� rules by:�

� � ��

� � ��

� � � � ��

� � ��

2. Eliminating left-recursion we get:�� � � ��

� � ��

�� ��

� � ���

� � � � ,

�� � � � ��

� � � � � ��

� � ��

3. All

�� rules start with a terminal. We use them to replace� � � � � �

� . This introduces the rules

�� � � � ��

� � � � � ��

� � ��

4. Use

� � production to make them start with a terminal

Chomsky and Greibach Normal Forms – p.24/24

Page 59: Chomsky and Greibach Normal Forms

Solution

1. Step 1: ordering the rules: (Only

�� rules violate ordering

conditions, hence only

�� rules need to be changed).

Following the procedure we replace

�� rules by:�

� � ��

� � ��

� � � � ��

� � ��

2. Eliminating left-recursion we get:�� � � ��

� � ��

�� ��

� � ���

� � � � ,

�� � � � ��

� � � � � ��

� � ��

3. All

�� rules start with a terminal. We use them to replace� � � � � �

� . This introduces the rules

�� � � � ��

� � � � � ��

� � ��

4. Use

� � production to make them start with a terminal

Chomsky and Greibach Normal Forms – p.24/24

Page 60: Chomsky and Greibach Normal Forms

Solution

1. Step 1: ordering the rules: (Only

�� rules violate ordering

conditions, hence only

�� rules need to be changed).

Following the procedure we replace

�� rules by:�

� � ��

� � ��

� � � � ��

� � ��

2. Eliminating left-recursion we get:�� � � ��

� � ��

�� ��

� � ���

� � � � ,

�� � � � ��

� � � � � ��

� � ��

3. All

�� rules start with a terminal. We use them to replace� � � � � �

� . This introduces the rules

�� � � � ��

� � � � � ��

� � ��

4. Use

� � production to make them start with a terminal

Chomsky and Greibach Normal Forms – p.24/24