SlideShare a Scribd company logo
2
Most read
9
Most read
16
Most read
Lecture # 8
Automata Theory and formal languages
(CSC-307)
Muhammad Shahzeb
Example
Consider the language L of strings of, defined
over Σ = {a, b}, beginning and ending in
different letters.
The language L may be expressed by RE
a(a + b)*b + b(a + b)*a
The language L may be accepted by the following
GTG
Example Continued …
Another option of GTG for above language L
Example Continued …
Example
Consider the language L of strings, defined over
Σ={a, b}, having triple a or triple b.
The language L may be expressed by RE
(a+b)* (aaa + bbb) (a+b)*
This language may be accepted by the following
GTG
Example Continued …
OR
NonDeterminism
TGs and GTGs provide certain relaxations i.e.
there may exist more than one path for a certain
string or there may not be any path for a certain
string, this property creates nondeterminism
and it can also help in differentiating TGs or
GTGs from FAs.
Hence an FA is also called a Deterministic Finite
Automaton (DFA).
Kleene’s Theorem
If a language can be expressed by
1. FA or
2. TG or
3. RE
then it can also be expressed by other two as well.
 It may be noted that the theorem is proved,
proving the following three parts
Kleene’s Theorem continued …
Kleene’s Theorem Part I
If a language can be accepted by an FA then it
can be accepted by a TG as well.
Kleene’s Theorem Part II
If a language can be accepted by a TG then it can
be expressed by an RE as well.
Kleene’s Theorem Part III
If a language can be expressed by a RE then it
can be accepted by an FA as well
Kleene’s Theorem continued …
Proof(Kleene’s Theorem Part I)
Since every FA can be considered to be a TG as
well, therefore there is nothing to prove.
Kleene’s Theorem continued …
Proof(Kleene’s Theorem Part II)
To prove part II of the theorem, an algorithm
consisting of different steps, is explained showing
how a RE can be obtained corresponding to the
given TG. For this purpose the notion of TG is
changed to that of GTG i.e. the labels of
transitions are corresponding REs.
Kleene’s Theorem part II cont …
Objective of Algorithm:
Basically this algorithm converts the given TG to
GTG with one initial state along with a single loop,
or one initial state connected with one final state
by a single transition edge. The label of the loop or
the transition edge will be the required RE.
Kleene’s Theorem part II cont …
Step 1
If a TG has more than one start states, then
introduce a new start state connecting the new
state to the old start states by the transitions
labeled by Λ and make the old start states the non-
start states. This step can be shown by the
following example
Example
Example Continued ...
Kleene’s Theorem part II
Step 2:
If a TG has more than one final states, then
introduce a new final state, connecting the old
final states to the new final state by the
transitions labeled by Λ.
This step can be shown by the previous example
of TG, where the step 1 has already been
processed
Example continued …
Kleene’s Theorem part II
Step 3:
If a state has two (more than one) incoming
transition edges labeled by the corresponding
REs, from the same state (including the
possibility of loops at a state), then replace all
these transition edges with a single transition
edge labeled by the sum of corresponding REs.
This step can be shown by a part of TG in the
following example
Example
The above TG can be reduced to
Note
The step 3 can be generalized to any finite
number of transitions as shown below
The above TG can be reduced to
Kleene’s Theorem part II
Step 4 (bypass and state elimination)
If three states in a TG, are connected in sequence
then eliminate the middle state and connect the
first state with the third by a single transition
(include the possibility of circuit as well) labeled by
the RE which is the concatenation of
corresponding two REs in the existing sequence.
This step can be shown by a part of TG in the
following example
Example
To eliminate state 5 the above can be reduced to
Consider the following example containing a
circuit
Example
Consider the part of a TG, containing a circuit at
a state, as shown below
To eliminate state 3 the above TG can be reduced
to

More Related Content

PPT
Lecture 5
PPT
Lecture 6
PPT
Lecture 7
PPT
Lecture 1,2
PPT
Lecture 3,4
PPT
PPT
Lecture 3,4
PPT
Lecture 5
Lecture 6
Lecture 7
Lecture 1,2
Lecture 3,4
Lecture 3,4

What's hot (20)

PPT
PPT
PPT
NFA or Non deterministic finite automata
PPT
DOC
Generalized transition graphs
PDF
Language
PPT
FInite Automata
PDF
Lecture: Automata
PPTX
Regular Expression in Compiler design
PPTX
NFA Converted to DFA , Minimization of DFA , Transition Diagram
PPT
PPTX
Alphabets , strings, languages and grammars
PPTX
Automata Theory - Turing machine
PPT
Regular Languages
PPT
Theory of Automata Lesson 02
PPT
pushdown automata
PPTX
Deterministic Finite Automata
PDF
Ch3 4 regular expression and grammar
PPTX
Equivalence and minimization of DFA
PDF
Formal Languages and Automata Theory unit 2
NFA or Non deterministic finite automata
Generalized transition graphs
Language
FInite Automata
Lecture: Automata
Regular Expression in Compiler design
NFA Converted to DFA , Minimization of DFA , Transition Diagram
Alphabets , strings, languages and grammars
Automata Theory - Turing machine
Regular Languages
Theory of Automata Lesson 02
pushdown automata
Deterministic Finite Automata
Ch3 4 regular expression and grammar
Equivalence and minimization of DFA
Formal Languages and Automata Theory unit 2
Ad

Similar to Lecture 8 (20)

PDF
Lesson 07 GTG-Kleens Theorem.ppt.pdf for Masters
PPT
Kleene's theorem
PPTX
Lecture-20 Kleene’s Theorem-1.pptx best for understanding the automata
PPTX
Lesson_10.pptx data science technology to create self-driving cars
PPTX
kleenes theorem and NFA ppt
PDF
Automata
PDF
Automata
PPT
PPT
re1.ppt
PPT
Re1 (3)
PPT
RegularExpressions-theory of computation and formal language
PPTX
Chapter Two - Regular Expression and Regular languages.pptx
PPT
Formal Languages and regular langugaes IN FLAG
PDF
TOC 5 | Regular Expressions
PPT
PPT 2.1.1(The Pumping Lemma for Regular sets, Application of the Pumping Lemm...
PDF
Chapter 3 REGULAR EXPRESSION.pdf
PPT
regular expression to automata toc flat,
PPT
regular expression smmlmmmmmmmmmmmmm.ppt
PPT
rs1.ppt
Lesson 07 GTG-Kleens Theorem.ppt.pdf for Masters
Kleene's theorem
Lecture-20 Kleene’s Theorem-1.pptx best for understanding the automata
Lesson_10.pptx data science technology to create self-driving cars
kleenes theorem and NFA ppt
Automata
Automata
re1.ppt
Re1 (3)
RegularExpressions-theory of computation and formal language
Chapter Two - Regular Expression and Regular languages.pptx
Formal Languages and regular langugaes IN FLAG
TOC 5 | Regular Expressions
PPT 2.1.1(The Pumping Lemma for Regular sets, Application of the Pumping Lemm...
Chapter 3 REGULAR EXPRESSION.pdf
regular expression to automata toc flat,
regular expression smmlmmmmmmmmmmmmm.ppt
rs1.ppt
Ad

Recently uploaded (20)

PPTX
Pharma ospi slides which help in ospi learning
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PPTX
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PPTX
master seminar digital applications in india
PDF
O7-L3 Supply Chain Operations - ICLT Program
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PPTX
Institutional Correction lecture only . . .
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
Basic Mud Logging Guide for educational purpose
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
Mark Klimek Lecture Notes_240423 revision books _173037.pdf
PDF
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PDF
Complications of Minimal Access Surgery at WLH
Pharma ospi slides which help in ospi learning
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
Module 4: Burden of Disease Tutorial Slides S2 2025
master seminar digital applications in india
O7-L3 Supply Chain Operations - ICLT Program
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
STATICS OF THE RIGID BODIES Hibbelers.pdf
Institutional Correction lecture only . . .
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Basic Mud Logging Guide for educational purpose
FourierSeries-QuestionsWithAnswers(Part-A).pdf
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
Mark Klimek Lecture Notes_240423 revision books _173037.pdf
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
Abdominal Access Techniques with Prof. Dr. R K Mishra
O5-L3 Freight Transport Ops (International) V1.pdf
Pharmacology of Heart Failure /Pharmacotherapy of CHF
Complications of Minimal Access Surgery at WLH

Lecture 8

  • 1. Lecture # 8 Automata Theory and formal languages (CSC-307) Muhammad Shahzeb
  • 2. Example Consider the language L of strings of, defined over Σ = {a, b}, beginning and ending in different letters. The language L may be expressed by RE a(a + b)*b + b(a + b)*a The language L may be accepted by the following GTG
  • 3. Example Continued … Another option of GTG for above language L
  • 5. Example Consider the language L of strings, defined over Σ={a, b}, having triple a or triple b. The language L may be expressed by RE (a+b)* (aaa + bbb) (a+b)* This language may be accepted by the following GTG
  • 7. NonDeterminism TGs and GTGs provide certain relaxations i.e. there may exist more than one path for a certain string or there may not be any path for a certain string, this property creates nondeterminism and it can also help in differentiating TGs or GTGs from FAs. Hence an FA is also called a Deterministic Finite Automaton (DFA).
  • 8. Kleene’s Theorem If a language can be expressed by 1. FA or 2. TG or 3. RE then it can also be expressed by other two as well.  It may be noted that the theorem is proved, proving the following three parts
  • 9. Kleene’s Theorem continued … Kleene’s Theorem Part I If a language can be accepted by an FA then it can be accepted by a TG as well. Kleene’s Theorem Part II If a language can be accepted by a TG then it can be expressed by an RE as well. Kleene’s Theorem Part III If a language can be expressed by a RE then it can be accepted by an FA as well
  • 10. Kleene’s Theorem continued … Proof(Kleene’s Theorem Part I) Since every FA can be considered to be a TG as well, therefore there is nothing to prove.
  • 11. Kleene’s Theorem continued … Proof(Kleene’s Theorem Part II) To prove part II of the theorem, an algorithm consisting of different steps, is explained showing how a RE can be obtained corresponding to the given TG. For this purpose the notion of TG is changed to that of GTG i.e. the labels of transitions are corresponding REs.
  • 12. Kleene’s Theorem part II cont … Objective of Algorithm: Basically this algorithm converts the given TG to GTG with one initial state along with a single loop, or one initial state connected with one final state by a single transition edge. The label of the loop or the transition edge will be the required RE.
  • 13. Kleene’s Theorem part II cont … Step 1 If a TG has more than one start states, then introduce a new start state connecting the new state to the old start states by the transitions labeled by Λ and make the old start states the non- start states. This step can be shown by the following example
  • 16. Kleene’s Theorem part II Step 2: If a TG has more than one final states, then introduce a new final state, connecting the old final states to the new final state by the transitions labeled by Λ. This step can be shown by the previous example of TG, where the step 1 has already been processed
  • 18. Kleene’s Theorem part II Step 3: If a state has two (more than one) incoming transition edges labeled by the corresponding REs, from the same state (including the possibility of loops at a state), then replace all these transition edges with a single transition edge labeled by the sum of corresponding REs. This step can be shown by a part of TG in the following example
  • 19. Example The above TG can be reduced to
  • 20. Note The step 3 can be generalized to any finite number of transitions as shown below The above TG can be reduced to
  • 21. Kleene’s Theorem part II Step 4 (bypass and state elimination) If three states in a TG, are connected in sequence then eliminate the middle state and connect the first state with the third by a single transition (include the possibility of circuit as well) labeled by the RE which is the concatenation of corresponding two REs in the existing sequence. This step can be shown by a part of TG in the following example
  • 22. Example To eliminate state 5 the above can be reduced to Consider the following example containing a circuit
  • 23. Example Consider the part of a TG, containing a circuit at a state, as shown below To eliminate state 3 the above TG can be reduced to