Formal Languages and Theory of Computation Taj Mahal

  • Slides: 48
Download presentation
Formal Languages and Theory of Computation Taj Mahal in India Wen-Hsiang Tsai 蔡文祥 講座教授

Formal Languages and Theory of Computation Taj Mahal in India Wen-Hsiang Tsai 蔡文祥 講座教授 2011/9 1

Chapter 0 Introduction Opera House in Sidney, Australia 2

Chapter 0 Introduction Opera House in Sidney, Australia 2

Outline n 0. 0 Reasons for Taking This Course n 0. 1 General Concepts

Outline n 0. 0 Reasons for Taking This Course n 0. 1 General Concepts n 0. 2 Problems Studied in Theory of Computation n 0. 3 Fields Related to Theory of Computation n 0. 4 Applications of Theory of Computation n 0. 5 Brief History of Theory of Computation n 0. 6 Textbooks and Course Grading 3

0. 0 Reasons for Taking This Course n Philosophy of computer science (CS) n

0. 0 Reasons for Taking This Course n Philosophy of computer science (CS) n Indispensable for complete study of CS n Broadening views in all fields of CS n Enhancing problem solving capability n Basic training for undergraduate students n Background course for graduate students n Qualification exam topic for Ph. D. students. 4

0. 1 General Concepts n Course title --- “Formal Languages and Theory of Computation”

0. 1 General Concepts n Course title --- “Formal Languages and Theory of Computation” (正規語言與計算理論) n Scope of course: n Formal languages n Automata theory n Computability n Computational complexity 5

0. 1 General Concepts n Formal Languages --- n Definition --- Study of “strings

0. 1 General Concepts n Formal Languages --- n Definition --- Study of “strings of symbols, ” including their n descriptions, properties, n generations, recognitions, n compiling, applications, … 6

0. 1 General Concepts n Formal Languages --- n Concepts (1/2) --- Strings of

0. 1 General Concepts n Formal Languages --- n Concepts (1/2) --- Strings of symbols include those of n natural languages, n computer n discrete languages, signals, … 7

0. 1 General Concepts n Formal Languages --- n Concepts (2/2) --- n Results

0. 1 General Concepts n Formal Languages --- n Concepts (2/2) --- n Results of study of automatic processing of symbolic information n Parallel to numerical mathematical processing n Similar to the role of set theory (集合論) in mathematics 8

0. 1 General Concepts n Automata n. A Theory --- question --- n Do

0. 1 General Concepts n Automata n. A Theory --- question --- n Do you know how a vending machine works? Can you design one? Vending machine room seen in Hokkaido, Japan 2004 9

0. 1 General Concepts n Automata n An Theory --- example (1/3) --- How

0. 1 General Concepts n Automata n An Theory --- example (1/3) --- How to design a vending machine? Use a finite automaton! 10

0. 1 General Concepts n Automata n An Theory --- example (2/3) --- n

0. 1 General Concepts n Automata n An Theory --- example (2/3) --- n Assumptions (for simplicity): n Only NT 5 -dollar and 10 -dollar coins are used. n Only drinks all of 20 dollars are sold. 11

0. 1 General Concepts n Automata n Theory --- An example (3/3) --Requiring “memory”

0. 1 General Concepts n Automata n Theory --- An example (3/3) --Requiring “memory” called “states” for the design. $5 start $0 $5 $5 $10 n $10 $15 $5 $10 $20 $5 transition diagram Notes: see next page. 12

0. 1 General Concepts n Automata n Theory --- Notes for the last diagram:

0. 1 General Concepts n Automata n Theory --- Notes for the last diagram: n $10 n start n $20 $5 is returned as “output” (not shown) $0 “Start state” “Final state” 13

0. 1 General Concepts n Automata Theory --- n Definition --- Study of dynamic

0. 1 General Concepts n Automata Theory --- n Definition --- Study of dynamic behaviors of “discreteparameter information systems” in form of “abstract computing devices” or “machines. ” 14

0. 1 General Concepts n Automata Theory --- n Examples of discrete-parameter information systems

0. 1 General Concepts n Automata Theory --- n Examples of discrete-parameter information systems --n digital systems, nerve systems, languages n information transmission systems n human-environment interactions, … 15

0. 1 General Concepts n Automata n Three Theory --- major models of automata

0. 1 General Concepts n Automata n Three Theory --- major models of automata --- n generator n acceptor --- with output and without input --- with input and without output n transducer --- both with input and with output Yes or No trigger signal generator acceptor transducer 16

0. 1 General Concepts n Automata Theory --- n Examples --- n generator n

0. 1 General Concepts n Automata Theory --- n Examples --- n generator n “natural --language” grammar (generating “sentences” spoken by people) n reception robot (speaking organized words and sentences) n context-free grammar (generating strings of symbols) *** Reception robot --- Expo 2005 (*** abstract models studied in this course) 17

0. 1 General Concepts n Automata Theory --- n Examples n acceptor n digital

0. 1 General Concepts n Automata Theory --- n Examples n acceptor n digital ----- lock (accepting digits) n lexical analyzer (recognizing computer language keywords) n finite automaton (accepting valid strings of symbols) Digital lock *** (*** abstract models studied in this course) 18

0. 1 General Concepts n Automata Theory --- n Examples --- n transducer ---

0. 1 General Concepts n Automata Theory --- n Examples --- n transducer --- n Interpreter (translating natural languages) n Compiler (translating high-level languages into machine codes) n Turing machine (transforming strings of symbols) *** (*** abstract models studied in this course) “Interpreter” 雙面翻譯 (a movie) 19

0. 1 General Concepts n Computability n Definition --- Study of problem solving capabilities

0. 1 General Concepts n Computability n Definition --- Study of problem solving capabilities of computational models. 20

0. 1 General Concepts n Computability n Problem --- types based on resources ---

0. 1 General Concepts n Computability n Problem --- types based on resources --- n Impossible problems n Possible-with-unlimited-resources-but- impossible-with-limited-resources problems n Possible-with-limited-resources problems 21

0. 1 General Concepts n Computability n Problem --- types based on time ---

0. 1 General Concepts n Computability n Problem --- types based on time --- n Undecidable n Intractable n Tractable problems 22

0. 1 General Concepts n Computability n Advantage --- Studies of computability help us

0. 1 General Concepts n Computability n Advantage --- Studies of computability help us not to waste time on “unsolvable problems” already investigated before. 23

0. 1 General Concepts n Computational n Definition complexity --- Study of “efficiency” of

0. 1 General Concepts n Computational n Definition complexity --- Study of “efficiency” of problem solving. 24

0. 1 General Concepts n Computational n Concepts n To complexity --- (1/2) ---

0. 1 General Concepts n Computational n Concepts n To complexity --- (1/2) --- unify comparison, an abstract model is needed as the machine for executing problem solutions. n Usually the most famous “Turing machine” (an automaton) is used. 25

0. 1 General Concepts n Computational n Concepts n Turing complexity --- (2/2) ---

0. 1 General Concepts n Computational n Concepts n Turing complexity --- (2/2) --- machine, though simple, has been proved to be able to simulate any problem solving steps (“algorithms”) designed by human beings! n Turing machine is the foundation for development of modern computation theory! 26

0. 2 Problems Studied in Theory of Computation n Essential n “What problems studied

0. 2 Problems Studied in Theory of Computation n Essential n “What problems studied --- are the fundamental capabilities and limitations of computers? ” n What can a computer do at all? --- studied in the domain of Computability! n What can a computer do efficiently? --- studied in the domain of Computational complexity! 27

0. 2 Problems Studied in Theory of Computation n. A basic concept --- n.

0. 2 Problems Studied in Theory of Computation n. A basic concept --- n. A Turing machine conceptually is no more than a pen and a paper with several reasoning rules! Turing machine 28

0. 3 Fields Related to Scope of Theory of Computation Fields Related theory Compiling

0. 3 Fields Related to Scope of Theory of Computation Fields Related theory Compiling theory Formal languages Switching circuit theory Automata theory Algorithm analysis Computational complexity Natural language processing Formal languages Syntactic pattern recognition Formal languages Programming languages Formal languages Artificial intelligence Formal languages and automata theory Neural networks Automata theory 29

0. 4 Applications of Theory of Computation n Applications n Text --- analysis ---

0. 4 Applications of Theory of Computation n Applications n Text --- analysis --- n text search (文辭搜尋) n text editing (文句編輯) n Compiler design (編譯器設計) n lexical analysis (辭彙分析) n parser generation (剖析器產生) 30

0. 4 Applications of Theory of Computation n Applications n Language --- design n

0. 4 Applications of Theory of Computation n Applications n Language --- design n programming language design (程式語言設 計) n document description language design (公文 描述語言設計) n e. g. , n picture n e. g. , n special HTML, XML, … language design (圖畫語言設計) SVG, VHML, … language design (特別語言設計) 31

0. 4 Applications of Theory of Computation n Applications n Digital --- system design

0. 4 Applications of Theory of Computation n Applications n Digital --- system design n computer design (計算機設計) n special digital system design (特殊數位系統 設計) n Protocol modeling and verification (網路 協定模式化與驗証) n Expert system design(專家系統設計) n Cryptography(密碼學) … 32

0. 4 Applications of Theory of Computation n A specific application --- special digital

0. 4 Applications of Theory of Computation n A specific application --- special digital system design n Mainly based on automata theory --- using finite automata or “sequential machines” (finite automata both with input and with output) n Some specific examples of digital systems --n Elevators, vending machines, traffic signal control systems … 33

0. 5 Brief History of Theory of Computation n At beginning of 19 th

0. 5 Brief History of Theory of Computation n At beginning of 19 th century, mathematicians believe: Axiomatization of mathematics (數學公理化) n That is, it is possible to decide the truth of any mathematical statement thru use of inference rules and axiom systems. 34

0. 5 Brief History of Theory of Computation n In 1931, Kurt Gödel proposed

0. 5 Brief History of Theory of Computation n In 1931, Kurt Gödel proposed the incompleteness theorem which says: the truth of certain mathematical statements cannot be proved by the use of mathematical axioms. n That is, some mathematical problems cannot be solved by algorithms. 35

0. 5 Brief History of Theory of Computation n From then, the ideal of

0. 5 Brief History of Theory of Computation n From then, the ideal of axiomatization of mathematics was broken. n Then, mathematicians started to n think the scope of algorithm capabilities, n design n study theoretical computational machines, & their capability limitations. 36

0. 5 Brief History of Theory of Computation n Many theories were proposed, but

0. 5 Brief History of Theory of Computation n Many theories were proposed, but the corresponding machines could not be manufactured at that time. 37

0. 5 Brief History of Theory of Computation n In 1936, Turing proposed the

0. 5 Brief History of Theory of Computation n In 1936, Turing proposed the model of universal algorithm machine, which later was called Turing machine mentioned before. 38

0. 5 Brief History of Theory of Computation n Some similar ideas were proposed

0. 5 Brief History of Theory of Computation n Some similar ideas were proposed by other scholars, including Stephen C. Kleene, Alonzo Church, Emil Post, etc. , in different forms of models. 39

0. 5 Brief History of Theory of Computation n In 1943, neural physiologists Warren

0. 5 Brief History of Theory of Computation n In 1943, neural physiologists Warren S. Mc. Culloch and Walter Pitts developed finite-state systems to simulate neural networks in biological systems. n They are pioneers of automata theory. 40

0. 5 Brief History of Theory of Computation n In late 1940’s,Von Neumann proposed

0. 5 Brief History of Theory of Computation n In late 1940’s,Von Neumann proposed the idea of stored program for computer models. 41

0. 5 Brief History of Theory of Computation n In 1951, a real computer

0. 5 Brief History of Theory of Computation n In 1951, a real computer following the idea of “stored program” was constructed: UNIVAC I, the world's first commercially available computer (manufactured by Eckert. Mauchly Computer Company). 42

0. 5 Brief History of Theory of Computation n In late 1950’s, linguist N.

0. 5 Brief History of Theory of Computation n In late 1950’s, linguist N. Chomsky proposed a mathematical model for grammars of natural languages. n In 1956, he proposed further the concept of context-free grammar, which may be used for defining computer languages. 43

0. 5 Brief History of Theory of Computation n In 1956, Kleene proposed the

0. 5 Brief History of Theory of Computation n In 1956, Kleene proposed the concept of finite automaton for simulating neural networks proposed by Mc. Culloch and Pitts. n He also proposed regular expressions to describe strings of symbols, and proved them equivalent to finite automata. 44

0. 5 Brief History of Theory of Computation n In 1959 and 1960, John

0. 5 Brief History of Theory of Computation n In 1959 and 1960, John W. Backus & Peter Naur proposed sequentially a special expression for computer language grammars, called later Backus-Naur form (BNF). n It was used to describe computer language ALGOL-60, leading to development of compiling theory. 45

0. 5 Brief History of Theory of Computation n In 1969, Stephen A. Cook

0. 5 Brief History of Theory of Computation n In 1969, Stephen A. Cook found that computation problems may be separated into tractable and intractable ones. n Intractable problems are also called NPhard problems. n Such problems cannot be solved by computers except very small instances (with only small-sized inputs). 46

0. 6 Textbooks and Course Grading n Textbook: n n Hopcroft, Motwani, Ullman, Introduction

0. 6 Textbooks and Course Grading n Textbook: n n Hopcroft, Motwani, Ullman, Introduction to Automata Theory, Languages, and Computation (3 rd Edition), Addison-Wesley, Boston, MA, USA, 2007 Reference textbook: n 蔡文祥, 正規語言與計算理論 (Formal Languages & Theory of Computation)(尚未 出版書籍;中文) (參考用) 47

0. 6 Textbooks and Course Grading n n Course grading: n Homeworks 33. 33%

0. 6 Textbooks and Course Grading n n Course grading: n Homeworks 33. 33% n mid-term exam 33. 33% n final exam 33. 33% Website for downloading course material and quizzes : http: //www. cis. nctu. edu. tw/~whtsai/ 48