Lesson_17
Lesson_17
Σ = {a,b}
productions:
S→aS
S→bS
S→a
S→b
S→Λ
This grammar also defines the language
expressed by (a+b)*.
Example
Σ = {a,b}
productions:
S→XaaX
X→aX
X→bX
X→Λ
This grammar defines the language
expressed by (a+b)*aa(a+b)*.
Example
Σ = {a,b}
productions:
S → SS
S → XS
S→Λ
S → YSY
X → aa
X → bb
Y → ab
Y → ba
This grammar generates EVEN-EVEN language.
Example
Σ = {a,b}
productions:
S → aB S → bA
A→a A → aS A → bAA
B→b B → bS B → aBB
This grammar generates the language
EQUAL(The language of strings, with
number of a’s equal to number of b’s).
Note