RACSO
R
DFA
CFG
Operations:
Reg
,
CF
PDA
Reductions:
K
,
WP
,
CFG
,
NP
,
SAT
ANTLR:
lex
,
syn
Exams
log in
,
register
,
guest
This site uses cookies only for the purpose of identifying user sessions. This is required to properly register actions.
Exercise 1
›
:
Unambiguous CFG for
{
a
n
b
n
∣
n
≥
0
}
\{ a^n b^n \mid n\geq 0 \}
{
a
n
b
n
∣
n
≥
0
}
Write an
unambiguous
CFG generating the language over
{
a
,
b
}
\{a,b\}
{
a
,
b
}
where the first half of each word only contains
a
a
a
’s and the second half only contains
b
b
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->. Rules can also be given in separate lines, as done // in this alternative solution: // // S -> aSb // S -> // // Finally, you can also use additional variables. For instance, // the following two lines represent another valid solution: // // S -> aXb | // X -> aSb | // // where S is assumed to be the starting variable of the CFG // since it appears first.
To be able to submit you need to
log in
,
register
, or
become a guest
.