Let BAL be the set of all strings of left and right
parentheses that are balanced. A string of parentheses that
is balanced requires not only a right parenthesis for each
left parenthesis, but also correct nesting. Here is a context-free
grammar that describes BAL.
S -> S S
S -> ( S )
S -> epsilon
(where epsilon is the empty string).
Prove that BAL is not regular.