Introduction
Introduction
Introduction
Prof. Dr. Muhammad Saleem Vighio (PhD)
Monday, 14/10/2024
1
Course Introduction
• Course C.Hs:
• 03 C.Hs:
- Theoretical work
• Recommended Textbooks:
• Introduction to Automata Theory, Languages and Computation
J.E. Hopcroft, R. Motwani, J.D. Ullman
3rd Edition (Addison Wesley/Pearson)
• Introduction to the Theory of Computation, 2nd Ed.
Michael Sipser
• Introduction to Computer Theory
Daniel I.A. Cohen
• Theory of Automata, Formal Languages and Computation
S. P. Eugene Xavier
• Online Literature
Course Introduction
• Teaching plan:
• 02 tests:
- At the end of 12th and 35th lectures respectively
• Class exercises
• Short presentations
• Practical exercises
Course Introduction
Lecture slides/announcements/results can be found at
course home page:
http://saleem.quest.edu.pk/
https://sites.google.com/a/quest.edu.pk/saleem/
Course Outline
• Introduction
• Regular Languages and their descriptors
- Finite state automata
- Non-deterministic automata
- Regular expressions
- Algorithms to decide questions about regular languages,
e.g., is it empty?
- Closure properties of regular languages.
• Context Free Languages and their descriptors
- Context free grammars
- Pushdown automata
• Turing Machines and TM Variants
• Decidable and Undecidable Languages
• Time and Space Complexities
Lecture Outline
• Introduction
• Models of Computation
• Languages
What is Automata Theory?
• Automata, plural of “automaton” is a Greek word
meaning “self-acting, self-willed, self-moving".
Alan Turing
History
• 1943 - Finite automata – simple model of computation
• Originally proposed to model brain function
Noam Chomsky
History
14
Finite Automaton
temporary memory
input memory
Finite
Automaton
output memory
input memory
Pushdown
Automaton
output memory
input memory
Turing
Machine
output memory
19
A language is a set of strings
20
Alphabets and Strings
We will use small alphabets: = a, b
Strings
a
ab u = ab
abba v = bbbaaa
baba w = abba
aaabbbaabab
21
String Operations: Concatenation
Concatenation
22
String Operations: Reverse
Reverse
w = an a2 a1
R
bbbaaababa
23
String Operations: String Length
w = a1a2 an
Length: w =n
Examples abba = 4
aa = 2
a =1
24
String Operations:
Length of Concatenation
uv = u + v
Examples u = aab, u = 3
v = abaab, v = 5
uv = aababaab = 8
uv = u + v = 3 + 5 = 8
25
String Operations: Empty String
A string with no letters:
Observations: =0
w = w = w
String Substring
abbab ab
abbab abba
abbab b
abbab bbab
27
String Operations: Prefix and Suffix
Example: abbab
prefixes Suffixes
abbab w = uv
a bbab
prefix
ab bab
suffix
abb ab
abba b
abbab
28
String Operations: Power
Wn = W1W2 Λ Wn
Definition: w =
0
(abba ) =
0
29
String Operations: The * Operation
* : the set of all possible strings from
alphabet
= a, b
* = , a, b, aa, ab, ba, bb, aaa, aab,
30
String Operations: The + Operation
+ : the set of all possible strings from
alphabet except
= a, b
* = , a, b, aa, ab, ba, bb, aaa, aab,
+
= * −
+
= a, b, aa, ab, ba, bb, aaa, aab,
31
Languages
A language is any subset of *
Example: = a, b
Languages:
a, aa, aab
{ , abba, baba, aa, ab, aaaaaa}
32
Note that:
Sets = { } {}
Set size {} = = 0
An infinite language L = {a b : n 0}
n n
ab
L abb L
aabb
aaaaabbbbb
34
Operations on Languages
The usual set operations
35
Operations on Languages: Reverse
Definition: L = {w : w L}
R R
L = {a b : n 0}
n n
L = {b a : n 0}
R n n
36
Operations on Languages: Concatenation
37
Operations on Languages: Power
Definition: L =
n
LL L
n
Example:
L = {a b : n 0}
n n
L = {a b a b : n, m 0}
2 n n m m
aabbaaabbb L 2
39
Operations on Languages:
Star-Closure (Kleene *)
Definition: L* = L L L
0 1 2
Example:
,
a, bb,
a, bb* =
aa , abb , bba , bbbb,
aaa, aabb, abba, abbbb,
40
Operations on Languages:
Positive Closure
Definition: +
L = L L
1 2
= L * −
a, bb,
+
a, bb = aa, abb, bba, bbbb,
aaa, aabb, abba, abbbb,
41
Automata Theory & Model Checking
• UPPAAL (https://uppaal.org/)
• SPIN
• PRISIM
• TLC, etc
Modelling & Verification Tools
• Recommended Tools:
• UPPAAL
http://www.uppaal.org/
UPPAAL
Application Bugs
Storm surge barrier Rotterdam
Storm Surge Barrier Rotterdam
Storm Surge Barrier Rotterdam
Storm Surge Barrier Rotterdam
• Year 1953
• Storm kills 1835 people in Netherlands
• Killed 200000 cattle,
• Flooding 2000 kilometer of land,
• Destroying 43000 homes,
• Forcing 720000 people to flee
Storm Surge Barrier Rotterdam
https://www.youtube.com/watch?v=TkF6v
_YwS1A
https://www.youtube.com/watch?v=i6DRR
HXt-PA