FAFL Final Lecture 26.2 CMH
FAFL Final Lecture 26.2 CMH
Lecture 26.2
Simplification of CFG : Removal of ԑ production
S c h o o l o f C o m p u t i n g a n d I n f o r m a t i o n Te c h n o l o g y
Chaithra M H
AY:2020-2021
OUTLINE
Lecture Discussion
• Definition of ԑ production
• Eliminating ԑ-productions examples
• Definition of unit production
• Eliminating of unit-productions examples
• Summary
Simplification of CFG : Removal of ԑ
production
Recap of Previous Lecture
• Substitution with
examples
• Definition of Left
recursion with
ԑ production
examples CFG : Removal of
Simplification of
• Definition of Useless
Course Description
productions with
examples
• Summary
• Quiz RECAP OF PREVIOUS LECTURE
Simplification of CFG : Removal of ԑ
production
To p i c o f t h e L e c t u r e
• Definition of ԑ
production
• Eliminating ԑ-
productions examples ԑ production
CFG : Removal of
• Definition of unit Simplification of
production
• Eliminating of unit-
productions examples
• Summary
TOPIC OF THE LECTURE
Simplification of CFG : Removal of ԑ production
Introduction of ԑ-production
INTRODUCTION OF ԑ [EPSILON]
The language generated from a grammar G does not derive any empty string and
grammar consists of Ԑ - productions. Such Ԑ - productions can be removed.
S A B C a S A B C a | B C a | A C a | A B a | C a V’ = { S, A, B, C, D}
T’ = { a, b, c, d }
|Aa|Ba|a
P’ = {
SABCa|BCa|ACa|ABa|
SbD SbD
Ca|Aa|Ba|a|bD
ABC|b ABC|B|C|b ABC|B|C|b
Bb
Bb|ԑ Bb Cc
Dd
Cc|ԑ Cc }
S = start symbol
Dd|ԑ Dd
PROBLEMS ON Ԑ-PRODUCTIONS
Example-2
Eliminate all Ԑ- productions from the grammar:
SBAAB
A0A2|2A0|Ԑ
BAB|1B|Ԑ
Step-1 Ф A, B Aԑ
Bԑ
A, B A, B , S SBAAB
A, B , S A, B , S --
SBAAB SBAAB|AAB|BAB|BAA|AB V’ = { S, A, B }
|BB|BA|AA|A|B T’ = { 0, 1, 2 }
P’ = {
A0A2 A0A2|02 SBAAB|AAB|BAB|BA
A|AB|BB|BA|AA|A|B
A2A0 A2A0|20 A0A2|02|2A0|20
BAB|B|A|1B|1
BAB BAB|B|A }
S = start symbol
B1B B1B|1
Eliminating ԑ- Definition of ԑ-
productions examples production
SUMMARY OF THE LECTURE
DISCUSSION
5 MINUTES
//
RESOURCES AND TASK
• https:
als/
Optional and non-optional reading resources of the Lecture
tutori
mata-
Optional Resources auto
n-
Web
utatio
comp
resources y-of-
theor
g/
Non-Optional Resources eks.or
forge
John E Hopcroft, Rajeev Motwani, Jeffrey D. Ullman, Introduction to
geeks
Automata Theory, Languages and Computation, 3rd Edition, Pearson
www.
Education, 2009. //
• https:
Peter Linz, An Introduction to formal Languages and Automata, 4/ E, Jones
htm
and Bartlett Publishers, 2006. index.
res/
Lectu
www.tu
• https://
SUMMARY OF THE LECTURE s/
Reading resources for the next lecture
tutorial
a-
automat
ation-
comput
Web of-
resources theory-
/
eeks.org
eksforg
John E Hopcroft, Rajeev Motwani, Jeffrey D. Ullman, Introduction to
www.ge
Automata Theory, Languages and Computation, 3rd Edition, Pearson
• https://
Education, 2009. m
index.ht
s/
Peter Linz, An Introduction to formal Languages and Automata, 4/ E, Jones
Lecture
and Bartlett Publishers, 2006. /
CptS317
h/
~anant
QUIZ TIME
10 MINUTES
C) P → ε D) P → Q t R r
A) S->A B) A->e
C) A->aA D) B->bA
6. Given:
S->…->xAy->…->w
if ____________, then A is useful, else useless symbol.
C) w Î L D) w Ë L
Thank you