Virtual University of Pakistan

CS402 : Theory of Automata

Course Overview

Course Synopsis

This is an introductory course on Theory of Automata. Students are introduced to the concept of Formal Language and Automata. Formal Languages cover recursive definitions of languages, regular grammar, regular expression, context free grammar and language. In Automata they learn about finite automata (deterministic; non-deterministic),transition graphs and pushdown automata (deterministic; non-deterministic). They also learn about fundamental concept of Moore and Mealy machines and Turing machines.

Course Learning Outcomes

At the end of the course, you should be able to:

• Explain different methods for defining languages
• Discuss what Finite Automata is
• Differentiate between Regular Languages and NonRegular Languages
• Describe Context-free languages and context-free grammars, parse trees, derivations and ambiguity; Basic concepts of pushdown automata
• Explain basic definitions and relation to the notion of an algorithm or program

Course Calendar

 Topic Lecture Resource Page Introduction to the course 1 Handouts, Cohen (1996) 3-6, Chapter 2 Kleene Star Closure   Plus operation Recursive definition of languages Examples 2 Handouts, Cohen (1996) 7-8, Chapter 3 RE Recursive definition of RE Defining languages by RE Examples 3 Handouts, Cohen (1996) 9-9, Chapter 4 Regular expression of EVEN-EVEN language Difference between a* + b* and (a+b)* Equivalent regular expressions; sum, product and closure of regular expressions Regular languages. Introduction to finite automaton Definition of FA Transition table Transition diagram 4 Handouts, Cohen (1996) 10-12, Chapter 4,5 Different notations of transition diagrams Examples 5 Handouts, Cohen (1996) 13-14, Chapter 5 Assignment No. 01 More Examples of Fas 6 Handouts, Cohen (1996) 15-16, Chapter 2 FA corresponding to finite languages Transition graphs (TG) 7 Handouts, Cohen (1996) 17-18, Chapter 5,6 Examples of TGs 8 Handouts, Cohen (1996) 19-20, Chapter 6 More Examples TGs Definition of Generalized Transition Graph (GTG) 9 Handouts, Cohen (1996) 21-23, Chapter 6 Examples of GTG Nondeterminism Kleene’s theorem (part I part II, part III) Proof of Kleene’s theorem part I 10 Handouts, Cohen (1996) 24-25, Chapter 6,7 Proof of Kleene’s theorem part II (method with different steps).   Particular examples of TGs to determine corresponding REs. 11 Handouts, Cohen (1996) 26-29, Chapter 7 Examples of writing REs to the corresponding TGs Kleene’s theorem part III (method 1: union of FAs) Examples of FAs corresponding to simple REs Example of Kleene’s theorem part III (method 1) continued 12 Handouts, Cohen (1996) 30-33, Chapter 7 Assignment No. 2 Examples of Kleene’s theorem part III  (method 1) continued Kleene’s theorem part III  (method 2: Concatenation of FAs) Example of Kleene’s theorem part III  (method 2 : Concatenation of FAs) 13 Handouts, Cohen (1996) 34-36, Chapter 2 Examples of Kleene’s theorem part III (method 1) continued Kleene’s theorem part III (method 2: Concatenation of FAs) Examples of Kleene’s theorem part III(method 2:concatenation FAs) continued Kleene’s theorem part III (method 3:closure of an FA) Examples of Kleene’s theorem part III(method 3:Closure of an FA) continued 14 Handouts, Cohen (1996) 37-39, Chapter 2 Examples of Kleene’s theorem part III (method 3) NFA Examples Converting FA to NFA Examples Applying an NFA on an example of maze. 15 Handouts, Cohen (1996) 40-14, Chapter 2 Applying an NFA on an example of maze continued NFA with null string, Examples Converting NFA to FA (method 1,2,3), Examples 16 Handouts, Cohen (1996) 42-44, Chapter 2 Converting NFA to FA (method 3) Example NFA and Kleene’s theorem method 1 Examples NFA and Kleene’s theorem method 2 NFA corresponding to union of FAs Example 17 Handouts, Cohen (1996) 45-47, Chapter 2 NFA corresponding to union of FAs Example NFA corresponding to concatenation of FAs, Examples NFA corresponding to closure of an FA Example 18 Handouts, Cohen (1996) 48-51, Chapter 7 NFA corresponding to Closure of FA Examples Memory required to recognize a language, Example Distinguishing one string from another Example Theorem Proof 19 Handouts, Cohen (1996) 52-53, Chapter 7 Quiz No. 01 Example of previous Theorem Finite Automaton with output Moore machine Examples 20 Handouts, Cohen (1996) 55-56, Chapter 8 Example of Moore machine Mealy machine Examples complementing machine Incrementing machine 21 Handouts, Cohen (1996) 57-59, Chapter 8 Applications of complementing and incrementing machines Equivalent machines Moore equivalent to Mealy Proof Example Mealy equivalent to Moore, proof Example 22 Handouts, Cohen (1996) 60-62, Chapter 8 Mid Term Examination Mealy machines in terms of sequential circuit 23 Handouts, Cohen (1996) 63-64, Chapter 8 Regular languages Complement of a language Theorem Proof Example Intersection of two regular languages 24 Handouts, Cohen (1996) 65-67, Chapter 9 Intersection of two regular languages Examples Non regular language Example 25 Handouts, Cohen (1996) 68-71, Chapter 9,10 Example of nonregular language Pumping lemma version I, proof Examples 26 Handouts, Cohen (1996) 72-74, Chapter 10 Pumping lemma version II Proof Examples Myhill Nerode theorem, Examples 27 Handouts, Cohen (1996) 75-76, Chapter 10 Examples of Myhill Nerode theorem Quotient of a language, Examples Pseudo theorem: Quotient of a language is regular Prefixes of a language Example 28 Handouts, Cohen (1996) 77-78, Chapter 10 Assignment No. 3 Example of prefixes of a language Theorem: pref(Q in R) is regular Proof Example Decidability Deciding whether two languages are regular or not? Method 1, Example Method 2, Example 29 Handouts, Cohen (1996) 79-82, Chapter 10,11 Deciding whether two languages are equivalent or not Example Deciding whether an FA accept any string or not Method 3 Examples Finiteness of a language 30 Handouts, Cohen (1996) 83-86, Chapter 11,12 Context Free Grammar Terminals Non-terminals Productions CFG context Free language Examples 31 Handouts, Cohen (1996) 87-92, Chapter 12 Examples of CFLs Parsing tree Example 32 Handouts, Cohen (1996) 90-92, Chapter 12 Example of trees Polish Notation Examples Ambiguous CFG Example 33 Handouts, Cohen (1996) 93-95, Chapter 2 Example of Ambiguous Grammar Example of Unambiguous Grammar (PALINDROME) Total Language tree Examples, (Finite and infinite trees) Regular Grammar FA to CFG Semi word and Word Theorem Defining Regular Grammar Method to build TG for Regular Grammar. 34 Handouts, Cohen (1996) 96-98, Chapter 12,13 Examples of building TG’s corresponding to the Regular Grammar Null productions with examples Nullable productions with examples Unit production with example Definition of Chomsky Normal Form (CNF) 35 Handouts, Cohen (1996) 99-101, Chapter 13 Chomsky Normal Form Theorem regarding CNF Examples of converting CFG to be in CNF Example of an FA corresponding to Regular CFG Left most and Right most derivations New format of FAs 36 Handouts, Cohen (1996) 102-104, Chapter 13,14 New format for FAs input TAPE START ACCEPT REJECT READ states Examples of New Format of FA PUSH Down STACK PUSH and POP Example of PDA 37 Handouts, Cohen (1996) 105-108, Chapter 14 Example of PDA with table for running a string Equivalent PDA PDA for EVEN EVEN Language Non-Deterministic PDA, Example of Non-Deterministic PDA Definition of PUSH DOWN Automata Example of Non-Deterministic PDA. 38 Handouts, Cohen (1996) 109-113, Chapter 14 PDA corresponding to CFG Examples of PDA corresponding to CFG 39 Handouts, Cohen (1996) 114-117, Chapter 15 Graded Discussion Board (GDB) PDA corresponding to CFG continued CFG corresponding to PDA. Theorem HERE state Definition of Conversion form Different situations of PDA to be converted into conversion form 40 Handouts, Cohen (1996) 118-120, Chapter 15 PDA in conversion form continued Example of PDA in conversion form Joints of the machine New pictorial representation of PDA in conversion form Summary table Row sequence Row language 41 Handouts, Cohen (1996) 121-123, Chapter 15 Quizt No. 02 Row language Nonterminals defined from summary table Productions defined by rows Rules for defining productions All possible productions of CFG for row language of the example under consideration, CFG corresponding to the given PDA 42 Handouts, Cohen (1996) 124-126, Chapter 15 Non-Context-Free-languages Live Production Dead Production Theorem self- embedded nonterminal Pumping lemma for CFLs Examples 43 Handouts, Cohen (1996) 127-132, Chapter 16 Decidability and Parsing techniques 44 Handouts, Cohen (1996) 133-140, Chapter 17 Turing machine Examples DELETE subprogram Example INSERT subprogram Example. 45 Handouts, Cohen (1996) 140-144, Chapter 19 Final Term Examination