ebook img

Formal Language and Automata Theory PDF

481 Pages·2015·17.556 MB·
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Formal Language and Automata Theory

FORMAL LANGUAGES AND AUTOMATA THEORY K.V.N. SUNITHA N. KALYANI Formal Languages and Automata Theory K. V. N Sunitha Principal BVRIT Hyderabad College of Engineering for Women Nizampet, Hyderabad N. Kalyani Professor Department of Computer Science Engineering G. Narayanamma Institute of Technology and science Hyderabad FM.indd 1 1/30/2015 6:38:43 PM Copyright © 2016 Pearson India Education Services Pvt. Ltd Published by Pearson India Education Services Pvt. Ltd, CIN: U72200TN2005PTC057128, formerly known as TutorVista Global Pvt. Ltd, licensee of Pearson Education in South Asia. No part of this eBook may be used or reproduced in any manner whatsoever without the publisher’s prior written consent. This eBook may or may not include all assets that were part of the print version. The publisher reserves the right to remove any material in this eBook at any time. ISBN 978-93-325-3728-6 eISBN 978-93-325-4164-1 Head Office: A-8 (A), 7th Floor, Knowledge Boulevard, Sector 62, Noida 201 309, Uttar Pradesh, India. Registered Office: Module G4, Ground Floor, Elnet Software City, TS-140, Block 2 & 9, Rajiv Gandhi Salai, Taramani, Chennai 600 113, Tamil Nadu, India. Fax: 080-30461003, Phone: 080-30461060 www.pearson.co.in, Email: [email protected] Dedicated To our parents Late Sri K. Subbaiah and Smt K. Subba Lakshamma and Late Sri Nara China Rangaiah and Mrs N. Vengamma To our in-laws Late Mr M. Chidambaram and Mrs Rama Subbamma and Mr and Mrs J. Musaliah, Mr and Mrs T. Venkataiah for instilling in us the thirst for knowledge and the quest for excellence. To our families Mr M. Chidambhara Murthy, Charan Teja and Uday Teja and Mr J. Ch. Subbarao, Pranavi and Akhilesh for their love, encouragement and support. FM.indd 3 1/30/2015 6:38:43 PM This page is intentionally left blank Brief Contents Preface xv Acknowledgements xviii List of Important Symbols xix List of Important Abbreviations xxiii About the Authors xxv 1. Mathematical Preliminaries and Formal Languages 1 2. Finite Automata 31 3. Regular Languages and Regular Grammars 101 4. Context Free Grammars and Context Free Languages 149 5. Push Down Automata 201 6. Turing Machines 237 7. Undecidability and Computability 281 8. Non-deterministic Polynomial Completeness 309 9. LR(k) and LL(1) Grammars 327 Appendix A: Proposition and Predicate Logic 353 Appendix B: Frequently Asked University Questions with Solutions 365 References 449 Index 451 FM.indd 5 1/30/2015 6:38:43 PM This page is intentionally left blank Contents Preface xv Acknowledgements xviii List of Important Symbols xix List of Important Abbreviations xxiii About the Authors xxv 1. Mathematical Preliminaries and Formal Languages 1 1.1 Set Theory—1 1.1.1 Describing a Set 2 1.1.2 Empty Set 2 1.1.3 Identity and Cardinality 3 1.1.4 Subset 3 1.1.5 Power Sets 3 1.1.6 Operations on Sets: Union, Intersection 3 1.1.7 Set Theoretic Equalities 5 1.1.8 Sequence versus Set 6 1.1.9 Ordered Pairs 6 1.1.10 Cartesian Product 6 1.2 Relations—6 1.2.1 Binary Relation 7 1.2.2 Domain and Range of Relation 7 1.2.3 Operations on Relations 7 1.2.4 Properties of Relations 8 1.3 Functions—9 1.3.1 Definitions 9 1.3.2 Types of Functions 10 1.4 Alphabet, String and Language—11 1.4.1 Operations on Language 12 1.4.2 Grammars 13 1.4.3 Types of Grammars–Chomsky Hierarchy 13 FM.indd 7 1/30/2015 6:38:43 PM viii Contents 1.5 Graphs and Trees—16 1.5.1 Directed Graph 16 1.5.2 Undirected Graph 17 1.5.3 Trees 17 1.6 Theorem Proving—18 1.6.1 Proof by Induction 19 1.6.2 Proof by Contradiction 20 1.6.3 Proof by Example 21 Summary 21 Short Answers 22 Fill in the Blanks 23 Objective Question Bank 24 Exercises 27 2. Finite Automata 31 2.1 Finite-state Machine—31 2.1.1 Finite-Automaton Model 32 2.1.2 Properties of Transition Function ‘c’ 33 2.1.3 Transition Diagram 34 2.1.4 Transition Table 34 2.2 Language Acceptance—35 2.3 Two Types of Finite Automata—37 2.3.1 Deterministic Finite Automata (DFA) 37 2.3.2 Non-deterministic Finite Automaton (NFA) 40 2.3.3 Acceptance of NFA 40 2.4 Equivalence of DFAs and NFAs—42 2.5 Converting NFA (M ) to DFA (M )—Subset N D Construction—43 2.6 NFA with Epsilon-(e) Transitions—46 2.6.1 Epsilon Closure (e-closure) 47 2.6.2 Eliminating e-Transitions 48 2.6.3 Converting NFA with e-Transition to NFA without e-Transition 48 2.6.4 Converting NFA with e-Transition to DFA 50 2.7 Comparison Method for Testing Equivalence of Two FAs—52 2.8 Reduction of Number of States in FA—53 2.8.1 Indistinguishable States 53 2.8.2 Equivalent Classes 53 2.8.3 Minimization of DFA 54 2.8.4 Minimization of DFA Using Myhill Nerode Theorem 58 FM.indd 8 1/30/2015 6:38:43 PM Contents ix 2.9 Finite Automata with Output—60 2.9.1 Moore Machine 61 2.9.2 Mealy Machine 61 2.9.3 Equivalence Between Moore and Mealy Machines 63 2.9.4 Interconversions Between Machines 63 2.10 Applications of Finite Automata with Output—65 2.10.1 The Full-adder 65 2.10.2 The String Sequence Detector 67 Solved Problems 68 Summary 91 Short Answers 91 Fill in the Blanks 92 Objective Question Bank 93 Exercises 98 3. Regular Languages and Regular Grammars 101 3.1 Regular Expressions—101 3.2 Regular Sets—102 3.3 Identity Rules for Regular Expressions—104 3.4 Algebraic Laws for Regular Expressions—104 3.5 Equivalence of Finite Automata with Regular Expressions—105 3.6 Constructing Regular Expression for Given DFA—109 3.6.1 Arden’s Theorem 111 3.6.2 Arden’s Theorem in Construction of RE 112 3.6.3 Construction of RE Using Generalized NFA 113 3.7 Pumping Lemma of Regular Expressions—114 3.7.1 Formal Definition of the Pumping Lemma 114 3.8 Regular Grammar—115 3.8.1 Equivalence of Regular Grammar and Finite Automata 115 3.8.2 Converting Finite Automaton to Regular Grammar 118 3.9 Closure Properties of Regular Sets—120 3.10 Applications of Regular Expressions—121 3.10.1 Lexical Analysis 121 3.10.2 Finding Patterns 122 3.11 Decision Properties of Regular Languages—123 3.11.1 Conversion from NFA to DFA 123 FM.indd 9 1/30/2015 6:38:43 PM

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.