0% found this document useful (0 votes)
252 views33 pages

11-Regular Expression To FA-19!01!2023

1) The document discusses converting regular expressions to finite automata. 2) There is a theorem that states that every regular language defined by a regular expression is also defined by a finite automata and vice versa. 3) The document provides examples of constructing finite automata from various regular expressions and discusses algorithms like the subset construction method.

Uploaded by

Devam Saini
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
252 views33 pages

11-Regular Expression To FA-19!01!2023

1) The document discusses converting regular expressions to finite automata. 2) There is a theorem that states that every regular language defined by a regular expression is also defined by a finite automata and vice versa. 3) The document provides examples of constructing finite automata from various regular expressions and discusses algorithms like the subset construction method.

Uploaded by

Devam Saini
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 33

Module - 3

Regular Expressions to
Finite Automata
Dr. S K Somasundaram
Assistant Professor Senior Grade 2
School of Computer Science and Engineering,
Vellore Institute of Technology,
Vellore – 632014
Phone No: +91 9843665115
Mail ID: [email protected]
Location: PRP Block – 218D
Finite Automata and Regular Expression
• Theorem
• Every regular language defined by a regular expression is also defined
by the finite automata
• Every regular language defined by the finite automata is also defined
by the regular expression

• To Prove
L(M) = L(R)
Where L(R) => Language for the regular expression ‘R’
L(M) => Language for some NFA-

Winter 2022-23 S K Somasundaram, AP-SCOPE, VIT, Vellore 2


ng rules

Winter 2022-23 S K Somasundaram, AP-SCOPE, VIT, Vellore 3


& r2

Winter 2022-23 S K Somasundaram, AP-SCOPE, VIT, Vellore 4


r2

Winter 2022-23 S K Somasundaram, AP-SCOPE, VIT, Vellore 5


Winter 2022-23 S K Somasundaram, AP-SCOPE, VIT, Vellore 6
Winter 2022-23 S K Somasundaram, AP-SCOPE, VIT, Vellore 7
Converting Regular Expression to Finite
Automata
• Construct the FA for the regular expression, R = 01

• Construct the FA for the regular expression, R = 0+1

Winter 2022-23 S K Somasundaram, AP-SCOPE, VIT, Vellore 8


RE to FA – cont…
• Construct the FA for the regular expression, R = 0*

• Construct the FA for the regular expression, R = (0+1)*

Winter 2022-23 S K Somasundaram, AP-SCOPE, VIT, Vellore 9


RE to FA – cont…
• Construct the FA for the regular expression, R = (01)* + 1

Winter 2022-23 S K Somasundaram, AP-SCOPE, VIT, Vellore 10


Practice Problems
• a(a+b)*
• a*+b*
• 0(00)*
• (0+1)*(00+11)
• 10+(0+11)0*1
• (a+b)*abb
• ((10)+(0+1))*01

Winter 2022-23 S K Somasundaram, AP-SCOPE, VIT, Vellore 11


Converting RE to FA – Subset method
Design a NFA from given regular
expression 1 (1* 01* 01*)*.
RE to DFA – Using Thomson’s and subset
construction method
1. Convert RE to DFA: (a/b)* ab

Winter 2022-23 S K Somasundaram, AP-SCOPE, VIT, Vellore 21


Winter 2022-23 S K Somasundaram, AP-SCOPE, VIT, Vellore 22
Winter 2022-23 S K Somasundaram, AP-SCOPE, VIT, Vellore 23
Winter 2022-23 S K Somasundaram, AP-SCOPE, VIT, Vellore 24
Winter 2022-23 S K Somasundaram, AP-SCOPE, VIT, Vellore 25
Winter 2022-23 S K Somasundaram, AP-SCOPE, VIT, Vellore 26
Winter 2022-23 S K Somasundaram, AP-SCOPE, VIT, Vellore 27
Winter 2022-23 S K Somasundaram, AP-SCOPE, VIT, Vellore 28
Winter 2022-23 S K Somasundaram, AP-SCOPE, VIT, Vellore 29
Winter 2022-23 S K Somasundaram, AP-SCOPE, VIT, Vellore 30
Winter 2022-23 S K Somasundaram, AP-SCOPE, VIT, Vellore 31
Winter 2022-23 S K Somasundaram, AP-SCOPE, VIT, Vellore 32
Practice
• Generate DFA for (a/b)+ using Thompson’s and subset
construction.

Note: (a/b)+ = (a/b).(a/b)*

Winter 2022-23 S K Somasundaram, AP-SCOPE, VIT, Vellore 33

You might also like