Introduction to Theory of Automata, Formal Languages, and Computation
Introduction to Theory of Automata, Formal Languages, and Computation Debidas Ghosh Professor and Founder-Head Department of Computer Science & Engineering Former Director-in-Charge National Institute of Technology Durgapur and Former Pro-Vice-Chancellor KIIT University, Bhubaneswar Delhi-110092 2013
Introduction to Theory of Automata, Formal Languages, and Computation Debidas Ghosh 2013 by PHI Learning Private Limited, Delhi. All rights reserved. No part of this book may be reproduced in any form, by mimeograph or any other means, without permission in writing from the publisher. ISBN-978-81-203-4807-3 The export rights of this book are vested solely with the publisher. Published by Asoke K. Ghosh, PHI Learning Private Limited, Rimjhim House, 111, Patparganj Industrial Estate, Delhi-110092 and Printed by Raj Press, New Delhi-110012.
To the Memory of My Parents
Contents Preface xiii Acknowledgements Notation xix xvii 1. Preliminary Mathematical Review 1 22 1.1 Sets and Subsets 1 1.1.1 Venn Diagram 2 1.1.2 Properties of Set Operations 6 1.1.3 Two Special Properties of Set Operations 7 1.2 Relations and Functions 8 1.2.1 Relations 8 1.2.2 Function 10 1.2.3 Types of Function 11 1.2.4 Notation of Permutation 12 1.3 Graphs 13 1.3.1 Some Terminologies 13 1.4 Trees 18 1.5 Proof Techniques 18 1.5.1 Proof by Induction 19 1.5.2 Proof by Contradiction 19 Exercises 20 2. Three Basic Concepts: Grammar, Languages and Automata 23 34 2.1 Strings and Languages 23 2.1.1 Some Basic Terminologies 23 2.1.2 Some Properties of String Concatenation 24 2.1.3 Some Basic Language Operations 25 2.2 Grammars 26 2.2.1 Equivalent Grammars 28 2.2.2 Chomsky Hierarchy of Grammars 30 2.3 Automata 31 Exercises 32 vii
viii Contents 3. Finite Automata 35 56 3.1 Description of Finite Automata 35 3.1.1 Deterministic Finite Automata and Transition Graph 36 3.1.2 Languages and DFA 39 3.1.3 Regular Languages 40 3.2 Non-deterministic Finite Automata 40 3.2.1 Languages and NFA 41 3.3 Equivalence of Deterministic and Non-deterministic Finite Automata 42 3.3.1 Conversion from NFA to DFA 42 3.4 Non-deterministic Finite Automaton with l-transitions 44 3.5 Finite Automata with Binary Output 45 3.5.1 Mealy Machine 46 3.5.2 Moore Machine 47 3.5.3 Transformation of Mealy to Moore Machines 48 3.5.4 Transformation from Moore Machine to Mealy Machine 50 3.6 Reduction of Number of States in Finite Automata 51 Exercises 54 4. Regular Languages and Regular Grammars 57 75 4.1 Regular Expressions 57 4.1.1 Formal Definition of a Regular Expression 57 4.2 Regular Languages (RLs) 58 4.3 Regular Sets 60 4.4 Equivalence of Two Regular Expressions 61 4.5 Connection between REs and RLs 62 4.6 Finite Automata and Regular Expression 64 4.7 Regular Grammars 68 4.7.1 Right-Linear Grammar 69 4.7.2 Left-Linear Grammar 69 4.8 Equivalence between Regular Languages and Regular Grammars 72 Exercises 73 5. Properties of Regular Languages 76 85 5.1 Closure Properties of Regular Languages 76 5.1.1 Closure with Respect to Set Operations 76 5.1.2 Closure with Respect to Other Operations 77 5.2 Identifying Non-regular Languages 80 5.2.1 The Pigeonhole Principle 80 5.2.2 Pumping Lemma for Regular Languages 81 Exercises 84 6. Context-Free Languages 86 107 6.1 Context-Free Grammars 86 6.1.1 Leftmost and Rightmost Derivations 88 6.1.2 Derivation Trees 89
Contents ix 6.1.3 Partial Derivation Trees 89 6.1.4 Relation between Sentential Form and Derivation Tree 90 6.2 Parsing and Ambiguity 91 6.2.1 Parsing 91 6.2.2 Ambiguity 94 6.2.3 Inherently Ambiguous 96 6.3 Context-Free Grammar and Programming Language 96 6.4 Simple Grammar 98 6.5 Simplification of Context-Free Grammars 98 6.5.1 Substitution Rule 98 6.5.2 Useless Production Removal 99 6.5.3 l-production Removal 100 6.5.4 Unit Production Removal 101 6.6 Normal Forms 102 6.6.1 Chomsky Normal Form (CNF) 103 6.6.2 Greibach Normal Form (GNF) 105 Exercises 106 7. Pushdown Automata 108 129 7.1 Non-deterministic Pushdown Automata 108 7.1.1 Configuration 109 7.1.2 NPDA and Context-Free Languages 111 7.2 Context-free Grammars for Pushdown Automata 123 7.3 Deterministic Pushdown Automata 124 7.4 Deterministic Context-Free Languages 125 7.5 Grammars for Deterministic Context-Free Languages 126 Exercises 127 8. Properties of Context-Free Languages 130 136 8.1 Pumping Lemma for Context-Free Languages 130 8.2 Pumping Lemma for Linear Language 132 8.3 Closure Properties of Context-Free Languages 133 Exercises 135 9. Turing Machine 137 153 9.1 Standard Turing Machine Model 137 9.2 Representation of Turing Machine 139 9.2.1 Instantaneous Move Description 139 9.2.2 Representation by Transition Table 141 9.2.3 Representation by Transition Diagram 141 9.3 Turing Machine as Language Accepter 142 9.4 Turing Machine as Transducers 143 9.5 Church Turing Thesis 145 9.6 Design of a Turing Machine 147 Exercises 150
Introduction To Theory Of Automata,Formal Languages And Computation 30% OFF Publisher : PHI Learning ISBN : 978812034 8073 Author : Debidas Ghosh Type the URL : http://www.kopykitab.com/product/7571 Get this ebook