user4088686
user4088686

Reputation:

Converting to chomsky normal form

I'm currently learning about CNF and I'm a bit confused.

Given this grammar:

S -> ab | aSb

will result to CNF:

S -> AB | XB

X -> AY

Y -> AB | XB

A -> a

B -> b

How about this:

S -> c | aSa | bSb

Can someone boost me up a little on this one. thanks.

Upvotes: 1

Views: 77

Answers (0)

Related Questions