## Exercise 1›:

Non-ambiguous CFG for $\{ a^n b^n \mid n\geq 0 \}$
Write a non-ambiguous CFG generating the language over $\{a,b\}$ where the first half of each word only contains $a$’s and the second half only contains $b$’s.
Authors: Guillem Godoy / Documentation:
 // In the first problem on CFGs we directly propose a solution, // in order to show which is the syntax to represent CFGs. You // just have to uncomment (remove //) the following line and // submit. // // S -> aSb | // // Note that the previous line represents the two rules S->aSb and // S->. As an alternative solution you can uncomment the following // two lines: // // S -> aSb // S -> // // In such case the two rules are not given compressed in just // one line. Finally, you can also use more than one variable. // In particular, the following two lines represent a solution // using two variables: // // S -> aXb | // X -> aSb | // // Since S appears first, it is supposed to be the starting // variable of the CFG. To be able to submit you need to either log in, register, or become a guest.