RACSO
DFA
CFG
Operations:
Reg
,
CF
PDA
Reductions:
K
,
WP
,
CFG
,
NP
,
SAT
ANTLR:
lexical
,
syntactic
Exams
log in
,
register
,
become guest
This site uses cookies only for the purpose of identifying user sessions. This is required to properly register actions.
Exercise 1
›
:
Non-ambiguous CFG for
{
a
n
b
n
∣
n
≥
0
}
\{ a^n b^n \mid n\geq 0 \}
{
a
n
b
n
∣
n
≥
0
}
Write a
non-ambiguous
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->. 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
.