1 Theory of Computation 計算理論 2 Instructor: 顏嗣鈞 Web: Time: 9:10-12:10 PM, Monday Place: BL.

Slides:



Advertisements
Similar presentations
CS 345: Chapter 9 Algorithmic Universality and Its Robustness
Advertisements

8/25/2009 Sofya Raskhodnikova Intro to Theory of Computation L ECTURE 1 Theory of Computation Course information Overview of the area Finite Automata Sofya.
Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Fall 2009.
The Big Picture Chapter 3. We want to examine a given computational problem and see how difficult it is. Then we need to compare problems Problems appear.
1 CSCI-2400 Models of Computation. 2 Computation CPU memory.
Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Fall 2008.
Fall 2005Costas Busch - RPI1 CSCI-2400 Models of Computation.
CS311 Automata and Complexity Theory. Admistrative Stuff Instructor: Shahab Baqai Room # 428, Ext 4428 Lectures:Mon & Wed 1530 – 1710.
Normal forms for Context-Free Grammars
Costas Busch - RPI1 CSCI-2400 Models of Computation.
Fall 2006Costas Busch - RPI1 CSCI-2400 Models of Computation.
Grammars, Languages and Finite-state automata Languages are described by grammars We need an algorithm that takes as input grammar sentence And gives a.
Nathan Brunelle Department of Computer Science University of Virginia Theory of Computation CS3102 – Spring 2014 A tale.
Final Exam Review Cummulative Chapters 0, 1, 2, 3, 4, 5 and 7.
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 7 Mälardalen University 2010.
Introduction to the Theory of Computation
1 Introduction to Automata Theory Reading: Chapter 1.
CS 454 Theory of Computation Sonoma State University, Fall 2012 Instructor: B. (Ravi) Ravikumar Office: 116 I Darwin Hall.
1 Theory of Computation 計算理論 2 Instructor: 顏嗣鈞 Web: Time: 9:10-12:10 PM, Monday Place: BL 103.
Lei Bu Preliminary Introduction to the Theory of Computation.
Introduction to the Theory of Computation
CS 390 Introduction to Theoretical Computer Science.
1 An Introduction to Formal Languages and Automata Provided by : Babak Salimi webAdd:
CS/IT 138 THEORY OF COMPUTATION Chapter 1 Introduction to the Theory of Computation.
© M. Winter COSC/MATH 4P61 - Theory of Computation COSC/MATH 4P61 Theory of Computation Michael Winter –office: J323 –office hours: Mon & Fri, 10:00am-noon.
AUTOMATA THEORY Reference Introduction to Automata Theory Languages and Computation Hopcraft, Ullman and Motwani.
1 Unit 1: Automata Theory and Formal Languages Readings 1, 2.2, 2.3.
Review Byron Gao. Overview Theory of computation: central areas: Automata, Computability, Complexity Computability: Is the problem solvable? –solvable.
1 INFO 2950 Prof. Carla Gomes Module Modeling Computation: Language Recognition Rosen, Chapter 12.4.
CS 3813: Introduction to Formal Languages and Automata
Saeid Pashzadeh Jan 2009 Theory of Computation 1.
CSC312 Automata Theory Lecture # 1 Introduction.
1 Theory of Computation 計算理論 2 Instructor: 顏嗣鈞 Web: Time: 2:20-5:10 PM, Tuesday Place: BL 112.
Models of Computation. Computation: Computation is a general term for any type of information processing information processing CPU memory.
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
CS130: Theory of Computation An introductory course on the theory of automata and formal languages: models of machines, languages and grammars, relationship.
CSCI 2670 Introduction to Theory of Computing October 13, 2005.
Why Study Automata? What the Course is About Administrivia 1 Welcome to CSE309.
1 Course Overview Why this course “formal languages and automata theory?” What do computers really do? What are the practical benefits/application of formal.
Grammar Set of variables Set of terminal symbols Start variable Set of Production rules.
Theory of Computation Automata Theory Dr. Ayman Srour.
CS 154 Formal Languages and Computability May 12 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron Mak.
Week 14 - Friday.  What did we talk about last time?  Simplifying FSAs  Quotient automata.
CS6800 Advance Theory of Computation Spring 2016 Nasser Alsaedi
Computation Theory Asia Mahdi. Textbooks Programs, Machines and Computation: An Introduction to the Theory of Computing - Authors: Keith Clark and Don.
Theory of Computation. Introduction to The Course Lectures: Room ( Sun. & Tue.: 8 am – 9:30 am) Instructor: Dr. Ayman Srour (Ph.D. in Computer Science).
Introduction to Automata Theory
Theory of Computation. Introduction We study this course in order to answer the following questions: What are the fundamental capabilities and limitations.
Why Study Automata Theory and Formal Languages?
Formal Foundations-II [Theory of Automata]
Introduction to formal languages and automata
Welcome to Automata Theory Course
Why Study Automata? What the Course is About Administrivia
Introduction to the Theory of Computation
CS-300 Theory of Computation 2nd Sem 2017 Lecture 1.
Introduction to the Theory of Computation
Welcome to Automata Theory Course
Linear Bounded Automata LBAs
Pushdown automata Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section
G. Pullaiah College of Engineering and Technology
Introduction to Automata Theory
CSCI-2400 Models of Computation Costas Busch - RPI.
Pushdown automata Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section
Pushdown automata Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section
Lecture One: Automata Theory Amjad Ali
Pushdown automata Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section
Formal Languages and Automata Theory BODDEDA HARITHA LAKSHMI,
Pushdown automata Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section
Pushdown automata Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section
Automata theory and formal languages COS 3112 – AUTOMATA THEORY PRELIM PERIOD WEEK 1 AND 2.
Presentation transcript:

1 Theory of Computation 計算理論

2 Instructor: 顏嗣鈞 Web: Time: 9:10-12:10 PM, Monday Place: BL 103 Office hours: by appointment Class web page:

3 TEXTBOOK Introduction to Automata Theory, Languages, and Computation 3rd Edition John E. Hopcroft, Rajeev Motwani, Jeffrey D. Ullman, (Addison-Wesley, 2006)

4 Introduction to Automata Theory, Languages, and Computation John E. Hopcroft, Rajeev Motwani, Jeffrey D. Ullman, (2nd Ed. Addison-Wesley, 2001) 2 nd Edition

5 Introduction to Automata Theory, Languages, and Computation John E. Hopcroft, Jeffrey D. Ullman, (Addison-Wesley, 1979) 1 st Edition

6 Grading HW/Project : 20% Midterm exam.: 40% Final exam.: 40%

7 A simple computer BATTERY SWITCH input: switch output: light bulb actions: flip switch states: on, off

8 A simple “ computer ” BATTERY SWITCH off on start f 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

9 Another “ computer ” BATTERY off start 1 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 off on

10 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 ?

11 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

12 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

13 Different kinds of automata This was only one example of a computational device, and there are others We will look at different devices, and look at the following questions: –What can a given type of device compute, and what are its limitations? –Is one type of device more powerful than another?

14 Some devices we will see finite automataDevices with a finite amount of memory. Used to model “ small ” computers. push-down automata Devices with infinite memory that can be accessed in a restricted way. Used to model parsers, etc. Turing MachinesDevices with infinite memory. Used to model any computer. time-bounded Turing Machines Infinite memory, but bounded running time. Used to model any computer program that runs in a “ reasonable ” amount of time.

15 Why Study Automata Theory? Finite automata are a useful model for important kinds of hardware and software: Software for designing and checking digital circuits. Lexical analyzer of compilers. Finding words and patterns in large bodies of text, e.g. in web pages. Verification of systems with finite number of states, e.g. communication protocols.

16 Why Study Automata Theory? (2) The study of Finite Automata and Formal Languages are intimately connected. Methods for specifying formal languages are very important in many areas of CS, e.g.: Context Free Grammars are very useful when designing software that processes data with recursive structure, like the parser in a compiler. Regular Expressions are very useful for specifying lexical aspects of programming languages and search patterns.

17 Why Study Automata Theory? (3) Automata are essential for the study of the limits of computation. Two issues: What can a computer do at all? (Decidability) What can a computer do efficiently? (Intractability)

18 Applications Theoretical Computer Science Automata Theory, Formal Languages, Computability, Complexity … Compiler Prog. languages Comm. protocols circuits Pattern recognition Supervisory control Quantum computing Computer-AidedVerification...

19 Aims of the Course To familiarize you with key Computer Science concepts in central areas like - Automata Theory - Formal Languages - Models of Computation - Complexity Theory To equip you with tools with wide applicability in the fields of CS and EE, e.g. for - Complier Construction - Text Processing - XML

20 Fundamental Theme What are the capabilities and limitations of computers and computer programs? –What can we do with computers/programs? –Are there things we cannot do with computers/programs?

21 Studying the Theme How do we prove something CAN be done by SOME program? How do we prove something CANNOT be done by ANY program?

22 Example: The Halting Problem (1) Consider the following program. Does it terminate for all values of n  1? while (n > 1) { if even(n) { n = n / 2; } else { n = n * 3 + 1; }

23 Example: The Halting Problem (2) Not as easy to answer as it might first seem. Say we start with n = 7, for example: 7, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1 In fact, for all numbers that have been tried (a lot!), it does terminate but in general?

24 Example: The Halting Problem (3) Then the following important undecidability result should perhaps not come as a total surprise: It is impossible to write a program that decides if another, arbitrary, program terminates (halts) or not. What might be surprising is that it is possible to prove such a result. This was first done by the British mathematician Alan Turing.

25 Our focus Automata Computability Complexity

26 Topics 1. Finite automata, Regular languages, Regular grammars: deterministic vs. nondeterministic, one-way vs. two-way finite automata, minimization, pumping lemma for regular sets, closure properties. 2. Pushdown automata, Context-free languages, Context-free grammars: deterministic vs. nondeterministic, one-way vs. two-way PDAs, reversal bounded PDAs, linear grammars, counter machines, pumping lemma for CFLs, Chomsky normal form, Greibach normal form, closure properties. 3.

27 Topics (cont’d) 3. Linear bounded automata, Context- sensitive languages, Context-sensitive grammars. 4. Turing machines, Recursively enumerable sets, Type 0 grammars: variants of Turing machines, halting problem, undecidability, Post correspondence problem, valid and invalid computations of TMs.

28 Topics (cont’d) 5. Basic recursive function theory 6. Basic complexity theory: Various resource bounded complexity classes, including NLOGSPACE, P, NP, PSPACE, EXPTIME, and many more. reducibility, completeness. 7. Advanced topics: Tree Automata, quantum automata, probabilistic automata, interactive proof systems, oracle computations, cryptography.

29 Who should take this course? YOU

30 Languages The terms language and word are used in a strict technical sense in this course: A language is a set of words. A word is a sequence (or string) of symbols.  (or ) denotes the empty word, the sequence of zero symbols.

31 Symbols and Alphabets What is a symbol, then? Anything, but it has to come from an alphabet which is a finite set. A common (and important) instance is  = {0, 1}. , the empty word, is never an symbol of an alphabet.

32 Computation CPU memory

33 CPU input memory output memory Program memory temporary memory

34 CPU input memory output memory Program memory temporary memory compute Example:

35 CPU input memory output memory Program memory temporary memory compute

36 CPU input memory output memory Program memory temporary memory compute

37 CPU input memory output memory Program memory temporary memory compute

38 Automaton CPU input memory output memory Program memory temporary memory Automaton

39 Different Kinds of Automata Automata are distinguished by the temporary memory Finite Automata: no temporary memory Pushdown Automata: stack Turing Machines: random access memory

40 input memory output memory temporary memory Finite Automaton Finite Automaton Example: Vending Machines (small computing power)

41 input memory output memory Stack Pushdown Automaton Pushdown Automaton Example: Compilers for Programming Languages (medium computing power) Push, Pop

42 input memory output memory Random Access Memory Turing Machine Turing Machine Examples: Any Algorithm (highest computing power)

43 Finite Automata Pushdown Automata Turing Machine Power of Automata Less powerMore power Solve more computational problems