1 An Introduction to Formal Languages and Automata Provided by : Babak Salimi webAdd: //utopie.ir/...
-
Upload
rhoda-patterson -
Category
Documents
-
view
215 -
download
0
Transcript of 1 An Introduction to Formal Languages and Automata Provided by : Babak Salimi webAdd: //utopie.ir/...
![Page 1: 1 An Introduction to Formal Languages and Automata Provided by : Babak Salimi webAdd: //utopie.ir/ Email: bhm.salimi@gmail.com.](https://reader035.fdocuments.us/reader035/viewer/2022062518/56649e9e5503460f94ba045b/html5/thumbnails/1.jpg)
1
An Introduction to Formal Languages and Automata
Provided by : Babak SalimiwebAdd: http://utopie.ir/
Email: [email protected]
![Page 2: 1 An Introduction to Formal Languages and Automata Provided by : Babak Salimi webAdd: //utopie.ir/ Email: bhm.salimi@gmail.com.](https://reader035.fdocuments.us/reader035/viewer/2022062518/56649e9e5503460f94ba045b/html5/thumbnails/2.jpg)
2
Textbook:
Webadd: http://itla.ir/
![Page 3: 1 An Introduction to Formal Languages and Automata Provided by : Babak Salimi webAdd: //utopie.ir/ Email: bhm.salimi@gmail.com.](https://reader035.fdocuments.us/reader035/viewer/2022062518/56649e9e5503460f94ba045b/html5/thumbnails/3.jpg)
What is automata theory ?
• Automata theory is the study of abstract computational devices
• Abstract devices are (simplified) models of real computations
• Computations happen everywhere: On your laptop, on your cell phone, in nature, …
• Why do we need abstract models?
![Page 4: 1 An Introduction to Formal Languages and Automata Provided by : Babak Salimi webAdd: //utopie.ir/ Email: bhm.salimi@gmail.com.](https://reader035.fdocuments.us/reader035/viewer/2022062518/56649e9e5503460f94ba045b/html5/thumbnails/4.jpg)
A simple computer
BATTERY
SWITCH
input: switch
output: light bulb
actions: flip switch
states: on, off
![Page 5: 1 An Introduction to Formal Languages and Automata Provided by : Babak Salimi webAdd: //utopie.ir/ Email: bhm.salimi@gmail.com.](https://reader035.fdocuments.us/reader035/viewer/2022062518/56649e9e5503460f94ba045b/html5/thumbnails/5.jpg)
A simple “computer”
BATTERY
SWITCH
off onstartf
f
input: switch
output: light bulb
actions: f for “flip switch”
states: on, off
bulb is on if and only if there was an odd number of flips
![Page 6: 1 An Introduction to Formal Languages and Automata Provided by : Babak Salimi webAdd: //utopie.ir/ Email: bhm.salimi@gmail.com.](https://reader035.fdocuments.us/reader035/viewer/2022062518/56649e9e5503460f94ba045b/html5/thumbnails/6.jpg)
Another “computer”
BATTERY
off offstart1
inputs: switches 1 and 2
actions: 1 for “flip switch 1”
actions: 2 for “flip switch 2”
states: on, off
bulb is on if and only if both switches were flipped an odd number of times
1
2
1
off on1
1
2 2 2 2
![Page 7: 1 An Introduction to Formal Languages and Automata Provided by : Babak Salimi webAdd: //utopie.ir/ Email: bhm.salimi@gmail.com.](https://reader035.fdocuments.us/reader035/viewer/2022062518/56649e9e5503460f94ba045b/html5/thumbnails/7.jpg)
A design problem
Can you design a circuit where the light is on if and only if all the switches were flipped exactly the same number of times?
4
BATTERY
1
23
5?
![Page 8: 1 An Introduction to Formal Languages and Automata Provided by : Babak Salimi webAdd: //utopie.ir/ Email: bhm.salimi@gmail.com.](https://reader035.fdocuments.us/reader035/viewer/2022062518/56649e9e5503460f94ba045b/html5/thumbnails/8.jpg)
A design problem• Such devices are difficult to reason
about, because they can be designed in an infinite number of ways
• By representing them as abstract computational devices, or automata, we will learn how to answer such questions
![Page 9: 1 An Introduction to Formal Languages and Automata Provided by : Babak Salimi webAdd: //utopie.ir/ Email: bhm.salimi@gmail.com.](https://reader035.fdocuments.us/reader035/viewer/2022062518/56649e9e5503460f94ba045b/html5/thumbnails/9.jpg)
These devices can model many things
• They can describe the operation of any “small computer”, like the control component of an alarm clock or a microwave
• They are also used in lexical analyzers to recognize well formed expressions in programming languages:
ab1 is a legal name of a variable in C
5u= is not
![Page 10: 1 An Introduction to Formal Languages and Automata Provided by : Babak Salimi webAdd: //utopie.ir/ Email: bhm.salimi@gmail.com.](https://reader035.fdocuments.us/reader035/viewer/2022062518/56649e9e5503460f94ba045b/html5/thumbnails/10.jpg)
10
Computation
CPU memory
Outline of the course contents
![Page 11: 1 An Introduction to Formal Languages and Automata Provided by : Babak Salimi webAdd: //utopie.ir/ Email: bhm.salimi@gmail.com.](https://reader035.fdocuments.us/reader035/viewer/2022062518/56649e9e5503460f94ba045b/html5/thumbnails/11.jpg)
11
CPU
input
output
Program memory
temporary memory
![Page 12: 1 An Introduction to Formal Languages and Automata Provided by : Babak Salimi webAdd: //utopie.ir/ Email: bhm.salimi@gmail.com.](https://reader035.fdocuments.us/reader035/viewer/2022062518/56649e9e5503460f94ba045b/html5/thumbnails/12.jpg)
12
CPU
input
outputProgram memory
temporary memory
3)( xxf
compute xx
compute xx 2
Example:
![Page 13: 1 An Introduction to Formal Languages and Automata Provided by : Babak Salimi webAdd: //utopie.ir/ Email: bhm.salimi@gmail.com.](https://reader035.fdocuments.us/reader035/viewer/2022062518/56649e9e5503460f94ba045b/html5/thumbnails/13.jpg)
13
CPU
input
outputProgram memory
temporary memory
3)( xxf
compute xx
compute xx 2
2x
![Page 14: 1 An Introduction to Formal Languages and Automata Provided by : Babak Salimi webAdd: //utopie.ir/ Email: bhm.salimi@gmail.com.](https://reader035.fdocuments.us/reader035/viewer/2022062518/56649e9e5503460f94ba045b/html5/thumbnails/14.jpg)
14
CPU
input
outputProgram memory
temporary memory3)( xxf
compute xx
compute xx 2
2x
42*2 z82*)( zxf
![Page 15: 1 An Introduction to Formal Languages and Automata Provided by : Babak Salimi webAdd: //utopie.ir/ Email: bhm.salimi@gmail.com.](https://reader035.fdocuments.us/reader035/viewer/2022062518/56649e9e5503460f94ba045b/html5/thumbnails/15.jpg)
15
CPU
input
outputProgram memory
temporary memory3)( xxf
compute xx
compute xx 2
2x
42*2 z82*)( zxf
8)( xf
![Page 16: 1 An Introduction to Formal Languages and Automata Provided by : Babak Salimi webAdd: //utopie.ir/ Email: bhm.salimi@gmail.com.](https://reader035.fdocuments.us/reader035/viewer/2022062518/56649e9e5503460f94ba045b/html5/thumbnails/16.jpg)
16
Automaton
CPU
input
output
Program memory
temporary memory
Automaton
![Page 17: 1 An Introduction to Formal Languages and Automata Provided by : Babak Salimi webAdd: //utopie.ir/ Email: bhm.salimi@gmail.com.](https://reader035.fdocuments.us/reader035/viewer/2022062518/56649e9e5503460f94ba045b/html5/thumbnails/17.jpg)
17
Automaton
input
output
temporary memory
Automaton
state
transition
![Page 18: 1 An Introduction to Formal Languages and Automata Provided by : Babak Salimi webAdd: //utopie.ir/ Email: bhm.salimi@gmail.com.](https://reader035.fdocuments.us/reader035/viewer/2022062518/56649e9e5503460f94ba045b/html5/thumbnails/18.jpg)
18
Different Kinds of Automata
Automata are distinguished by the temporary memory
• Finite Automata: no temporary memory
• Pushdown Automata: stack
• Turing Machines: random access memory
![Page 19: 1 An Introduction to Formal Languages and Automata Provided by : Babak Salimi webAdd: //utopie.ir/ Email: bhm.salimi@gmail.com.](https://reader035.fdocuments.us/reader035/viewer/2022062518/56649e9e5503460f94ba045b/html5/thumbnails/19.jpg)
19
input
output
temporary memory
Finite Automaton
Finite Automaton
Example: Elevators, Vending Machines
(small computing power)
![Page 20: 1 An Introduction to Formal Languages and Automata Provided by : Babak Salimi webAdd: //utopie.ir/ Email: bhm.salimi@gmail.com.](https://reader035.fdocuments.us/reader035/viewer/2022062518/56649e9e5503460f94ba045b/html5/thumbnails/20.jpg)
20
input
output
Stack
Pushdown
Automaton
Pushdown Automaton
Example: Compilers for Programming Languages
(medium computing power)
Push, PopTemp.memory
![Page 21: 1 An Introduction to Formal Languages and Automata Provided by : Babak Salimi webAdd: //utopie.ir/ Email: bhm.salimi@gmail.com.](https://reader035.fdocuments.us/reader035/viewer/2022062518/56649e9e5503460f94ba045b/html5/thumbnails/21.jpg)
21
input
output
Random Access Memory
Turing
Machine
Turing Machine
Examples: Any Algorithm
(highest computing power)
Temp.memory
![Page 22: 1 An Introduction to Formal Languages and Automata Provided by : Babak Salimi webAdd: //utopie.ir/ Email: bhm.salimi@gmail.com.](https://reader035.fdocuments.us/reader035/viewer/2022062518/56649e9e5503460f94ba045b/html5/thumbnails/22.jpg)
22
Finite
Automata
Pushdown
Automata
Turing
Machine
Power of Automata
Less power More power
Solve more
computational problems
Simple problems
More complexproblems
Hardestproblems
![Page 23: 1 An Introduction to Formal Languages and Automata Provided by : Babak Salimi webAdd: //utopie.ir/ Email: bhm.salimi@gmail.com.](https://reader035.fdocuments.us/reader035/viewer/2022062518/56649e9e5503460f94ba045b/html5/thumbnails/23.jpg)
23
Turing Machine is the most powerful computational model known
Question: Are there computational problems that a Turing Machine cannot solve?
Answer: Yes (unsolvable problems)