Exercise 21:

CFG for the well-parenthesized words over {[,],(,)}\{ [ , ] , ( , ) \}
Write a CFG generating the language of the well-parenthesized words over {[,],(,)}\{[,],(,)\}. For example, ()[()]()[()] and [[(()[])]][[(()[])]] are well-parenthesized words, whereas ][][ and (()(() are not. One way to define more precisely this language is to describe it as the set of words that can be reduced to the empty word by successive applications of the rewrite rules []λ[]\to\lambda and ()λ()\to\lambda.
Authors: Guillem Godoy / Documentation:
To be able to submit you need to either log in, register, or become a guest.