ebook img

Formal Methods in Computer Science (Textbooks in Mathematics) PDF

313 Pages·2019·62.899 MB·English
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 Methods in Computer Science (Textbooks in Mathematics)

Formal Methods in  Computer Science Textbooks in Mathematics Series Editors Al Boggess and Ken Rosen ELEMENTARY DIFFERENTIAL EQUATIONS, SECOND EDITION Charles Roberts LINEAR METHODS FOR THE LIBERAL ARTS David Hecker and Stephen Andrilli CRYPTOGRAPHY: THEORY AND PRACTICE, FOURTH EDITION Douglas R. Stinson and Maura B. Paterson DISCRETE MATHEMATICS WITH DUCKS, SECOND EDITION Sarah-Marie Belcastro BUSINESS PROCESS MODELING, SIMULATION AND DESIGN, THIRD EDITION Manual Laguna and Johan Marklund GRAPH THEORY AND ITS APPLICATIONS, THIRD EDITION Jonathan L. Gross, Jay Yellen and Mark Anderson A FIRST COURSE IN FUZZY LOGIC, FOURTH EDITION Hung T. Nguyen, Carol L. Walker, and Elbert A. Walker EXPLORING LINEAR ALGEBRA Crista Arangala A TRANSITION TO PROOF: AN INTRODUCTION TO ADVANCED MATHEMATICS Neil R. Nicholson COMPLEX VARIABLES: A PHYSICAL APPROACH WITH APPLICATIONS, SECOND EDITION Steven G. Krantz GAME THEORY: A MODELING APPROACH Richard Alan Gillman and David Housman FORMAL METHODS IN COMPUTER SCIENCE Jiacun Wang and William Tepfenhart Textbooks in Mathematics Series Editors Formal Methods Al Boggess and Ken Rosen ELEMENTARY DIFFERENTIAL EQUATIONS, SECOND EDITION in  Computer Science Charles Roberts LINEAR METHODS FOR THE LIBERAL ARTS David Hecker and Stephen Andrilli CRYPTOGRAPHY: THEORY AND PRACTICE, FOURTH EDITION Douglas R. Stinson and Maura B. Paterson DISCRETE MATHEMATICS WITH DUCKS, SECOND EDITION Sarah-Marie Belcastro BUSINESS PROCESS MODELING, SIMULATION AND DESIGN, THIRD EDITION Manual Laguna and Johan Marklund GRAPH THEORY AND ITS APPLICATIONS, THIRD EDITION Jonathan L. Gross, Jay Yellen and Mark Anderson A FIRST COURSE IN FUZZY LOGIC, FOURTH EDITION Jiacun Wang Hung T. Nguyen, Carol L. Walker, and Elbert A. Walker EXPLORING LINEAR ALGEBRA William Tepfenhart Crista Arangala A TRANSITION TO PROOF: AN INTRODUCTION TO ADVANCED MATHEMATICS Neil R. Nicholson COMPLEX VARIABLES: A PHYSICAL APPROACH WITH APPLICATIONS, SECOND EDITION Steven G. Krantz GAME THEORY: A MODELING APPROACH Richard Alan Gillman and David Housman FORMAL METHODS IN COMPUTER SCIENCE Jiacun Wang and William Tepfenhart CRC Press Taylor & Francis Group 6000 Broken Sound Parkway NW, Suite 300 Boca Raton, FL 33487-2742 © 2020 by Taylor & Francis Group, LLC CRC Press is an imprint of Taylor & Francis Group, an Informa business No claim to original U.S. Government works Printed on acid-free paper International Standard Book Number-13: 978-0-367-22570-4 (Hardback) 978-1-4987-7532-8 (Paperback) This book contains information obtained from authentic and highly regarded sources. Reasonable efforts have been made to publish reliable data and information, but the author and publisher cannot assume responsibility for the validity of all materials or the consequences of their use. The authors and publishers have attempted to trace the copyright holders of all material reproduced in this publication and apologize to copyright holders if permission to publish in this form has not been obtained. If any copyright material has not been acknowledged please write and let us know so we may rectify in any future reprint. Except as permitted under U.S. Copyright Law, no part of this book may be reprinted, reproduced, transmitted, or utilized in any form by any electronic, mechanical, or other means, now known or here- after invented, including photocopying, microfilming, and recording, or in any information storage or retrieval system, without written permission from the publishers. For permission to photocopy or use material electronically from this work, please access www.copyright. com (http://www.copyright.com/) or contact the Copyright Clearance Center, Inc. (CCC), 222 Rosewood Drive, Danvers, MA 01923, 978-750-8400. CCC is a not-for-profit organization that provides licenses and registration for a variety of users. For organizations that have been granted a photocopy license by the CCC, a separate system of payment has been arranged. Trademark Notice: Product or corporate names may be trademarks or registered trademarks, and are used only for identification and explanation without intent to infringe. Library of Congress Cataloging‑in‑Publication Data Names: Wang, Jiacun, 1963- author. | Tepfenhart, William M., author. Title: Formal methods in computer science / Jiacun Wang and William Tepfenhart. Description: Boca Raton : Taylor & Francis, a CRC title, part of the Taylor & Francis imprint, a member of the Taylor & Francis Group, the academic division of T&F Informa, plc, 2019. Identifiers: LCCN 2019004989 | ISBN 9781498775328 (paperback : acid-free paper) Subjects: LCSH: Formal methods (Computer science) Classification: LCC QA76.9.F67 W36 2019 | DDC 004.01/51--dc23 LC record available at https://lccn.loc.gov/2019004989 Visit the Taylor & Francis Web site at http://www.taylorandfrancis.com and the CRC Press Web site at http://www.crcpress.com Contents CRC Press Taylor & Francis Group Preface ......................................................................................................................xi 6000 Broken Sound Parkway NW, Suite 300 Acknowledgments ................................................................................................xv Boca Raton, FL 33487-2742 Authors ................................................................................................................xvii © 2019 by Taylor & Francis Group, LLC CRC Press is an imprint of Taylor & Francis Group, an Informa business 1. Set Theory and Functions .............................................................................1 No claim to original U.S. Government works 1.1 Basic Set Definitions ...............................................................................1 Printed on acid-free paper 1.2 Set Operations .........................................................................................9 1.2.1 Union ............................................................................................9 International Standard Book Number-13: 978-0-367-22570-4 (Hardback) 978-1-4987-7532-8 (Paperback) 1.2.2 Intersection ................................................................................11 1.2.3 Set Difference .............................................................................13 This book contains information obtained from authentic and highly regarded sources. Reasonable efforts have been made to publish reliable data and information, but the author and publisher cannot assume 1.2.4 Power Set ...................................................................................19 responsibility for the validity of all materials or the consequences of their use. The authors and publishers 1.3 Ordered Pairs ........................................................................................20 have attempted to trace the copyright holders of all material reproduced in this publication and apologize 1.4 Relations .................................................................................................21 to copyright holders if permission to publish in this form has not been obtained. If any copyright material has not been acknowledged please write and let us know so we may rectify in any future reprint. 1.5 Functions ................................................................................................24 1.5.1 Partial Functions .......................................................................26 Except as permitted under U.S. Copyright Law, no part of this book may be reprinted, reproduced, 1.5.2 Into/Onto ...................................................................................27 transmitted, or utilized in any form by any electronic, mechanical, or other means, now known or here- after invented, including photocopying, microfilming, and recording, or in any information storage or 1.5.3 Composition ..............................................................................28 retrieval system, without written permission from the publishers. Exercises ..........................................................................................................30 For permission to photocopy or use material electronically from this work, please access www.copyright. com (http://www.copyright.com/) or contact the Copyright Clearance Center, Inc. (CCC), 222 Rosewood 2. Finite State Machine ....................................................................................33 Drive, Danvers, MA 01923, 978-750-8400. CCC is a not-for-profit organization that provides licenses and 2.1 Key Concepts of Finite State Machines .............................................34 registration for a variety of users. For organizations that have been granted a photocopy license by the 2.2 Accepting States ....................................................................................37 CCC, a separate system of payment has been arranged. 2.3 State Machines with Output ...............................................................44 Trademark Notice: Product or corporate names may be trademarks or registered trademarks, and are 2.3.1 Mealy ..........................................................................................45 used only for identification and explanation without intent to infringe. 2.3.2 Moore ..........................................................................................46 2.3.3 Harel (UML) ..............................................................................46 Library of Congress Cataloging‑in‑Publication Data Exercises ..........................................................................................................51 Names: Wang, Jiacun, 1963- author. | Tepfenhart, William M., author. Title: Formal methods in computer science / Jiacun Wang and William Tepfenhart. 3. Regular Expressions and Languages ........................................................55 Description: Boca Raton : Taylor & Francis, a CRC title, part of the Taylor & 3.1 Strings and Languages .........................................................................55 Francis imprint, a member of the Taylor & Francis Group, the academic 3.2 Regular Expressions .............................................................................58 division of T&F Informa, plc, 2019. Identifiers: LCCN 2019004989 | ISBN 9781498775328 (paperback : acid-free 3.3 Lex ...........................................................................................................63 paper) 3.4 Grammar ................................................................................................65 Subjects: LCSH: Formal methods (Computer science) 3.4.1 Productions ................................................................................66 Classification: LCC QA76.9.F67 W36 2019 | DDC 004.01/51--dc23 LC record available at https://lccn.loc.gov/2019004989 3.4.2 Derivations ................................................................................69 3.4.3 Parse Trees .................................................................................71 3.4.4 Removing Left Recursion ........................................................74 Visit the Taylor & Francis Web site at http://www.taylorandfrancis.com 3.4.5 Left Factoring ............................................................................77 and the CRC Press Web site at http://www.crcpress.com v vi Contents 3.5 Regular Expressions versus Grammars ............................................78 Exercises ..........................................................................................................79 4. Propositional Logic ......................................................................................83 4.1 Propositional Statements .....................................................................83 4.2 Logic Operators and Truth Tables ......................................................84 4.2.1 Well-Formed Formulas ............................................................85 4.2.2 Truth Values ..............................................................................89 4.2.3 Evaluation of Propositional Formulas ...................................90 4.3 Logic Equivalencies ..............................................................................92 4.4 Logic Arguments ..................................................................................95 4.4.1 Validity and Soundness ...........................................................96 4.4.2 Validity Test through Truth Tables ........................................97 4.4.3 Inference Rules ..........................................................................98 4.4.3.1 Or-Introduction (∨i)...................................................98 4.4.3.2 And-Elimination (∧e) ................................................98 4.4.3.3 And-Introduction (∧i) ...............................................98 4.4.3.4 Modus Ponens (MP) ..................................................98 4.4.3.5 Modus Tollens (MT) ..................................................99 4.4.3.6 Implication-Introduction (→i) ................................100 4.4.3.7 Or-Elimination (∨e) ..................................................101 4.4.3.8 Proof by Contradiction (PBC) ................................102 4.4.3.9 Law of the Excluded Middle (LEM) ......................103 4.5 Satisfiability of Formulas ...................................................................104 4.5.1 Conjunctive Normal Forms ...................................................105 4.5.2 Horn Clauses ...........................................................................108 Exercises ........................................................................................................111 5. Predicate Logic ............................................................................................115 5.1 Predicates .............................................................................................116 5.2 Quantifiers ...........................................................................................117 5.2.1 Universal Quantifier...............................................................117 5.2.2 Existential Quantifier .............................................................118 5.2.3 Properties of Quantifiers .......................................................120 5.3 Syntax of Predicate Logic ..................................................................122 5.3.1 Terms ........................................................................................122 5.3.2 Formulas ..................................................................................123 5.3.3 Parse Trees ...............................................................................125 5.3.4 Free and Bound Variables......................................................126 5.3.5 Substitution ..............................................................................128 5.4 Natural Deduction Rules ...................................................................130 5.4.1 Rules for Equality ...................................................................131 5.4.2 Rules for Universal Quantifier ..............................................132 5.4.3 Rules for the Existential Quantifier .....................................134 Contents vii 5.5 Semantics of Predicate Logic ............................................................138 5.5.1 Interpretation and Models ....................................................138 5.5.2 Evaluation of Truth Values ....................................................142 5.5.3 Satisfiability and Validity ......................................................145 Exercises ........................................................................................................145 6. Temporal Logic ............................................................................................151 6.1 Temporal Logic ...................................................................................151 6.1.1 Kripke Structures....................................................................151 6.1.2 Modeling of Time ...................................................................153 6.2 Linear Temporal Logic .......................................................................155 6.2.1 Syntax of LTL...........................................................................155 6.2.2 Parse Trees of LTL Formulas .................................................156 6.2.3 Semantics of LTL .....................................................................157 6.2.4 Equivalencies of LTL Formulas ............................................160 6.2.5 System Property Specification ..............................................161 6.3 Computation Tree Logic ....................................................................163 6.3.1 Syntax of CTL ..........................................................................163 6.3.2 Semantics of CTL ....................................................................165 6.3.3 Equivalencies of CTL Formulas ............................................168 6.3.4 System Property Specification ..............................................169 6.3.5 LTL versus CTL .......................................................................170 6.4 CTL* ......................................................................................................171 Exercises ........................................................................................................173 7. Formal Verification by Model Checking ...............................................177 7.1 Introduction to Model Checking ......................................................177 7.2 CTL Model Checking Algorithm .....................................................178 7.2.1 The Labeling Algorithm ........................................................178 7.2.2 State Explosion Issues in Model Checking .........................181 7.3 The NuSMV Model Checking Tool ..................................................181 7.3.1 Description Language ............................................................182 7.3.1.1 Data Types and Operators ......................................182 7.3.1.2 Single-Module SMV Program ...............................182 7.3.1.3 Multi-Module SMV Program .................................184 7.3.1.4 Asynchronous Systems ..........................................185 7.3.2 Specifications ...........................................................................186 7.3.3 Running NuSMV ....................................................................188 7.4 Example: The Ferryman Puzzle .......................................................191 Exercises ........................................................................................................195 viii Contents 8. Petri Nets ......................................................................................................201 8.1 Petri Nets .............................................................................................201 8.1.1 Multiplicity of Arcs.................................................................204 8.2 Common Petri Net Structures and Substructures .........................206 8.2.1 Sequential Execution ..............................................................207 8.2.2 Concurrent Execution ............................................................207 8.2.3 Synchronization ......................................................................208 8.2.4 Nondeterminism ....................................................................208 8.2.5 Loop ..........................................................................................209 8.2.6 Source .......................................................................................209 8.2.7 Consumer .................................................................................210 8.2.8 Control ......................................................................................210 8.2.9 Accumulator ............................................................................211 8.3 Reduction Rules ..................................................................................212 8.3.1 Fusion of Series Places ...........................................................212 8.3.2 Fusion of Series Transitions ..................................................213 8.3.3 Fusion of Parallel Places ........................................................213 8.3.4 Fusion of Parallel Transitions................................................214 8.3.5 Elimination of Self-Loop Places ............................................214 8.3.6 Elimination of Self-Loop Transitions ...................................214 8.4 Modeling ..............................................................................................216 8.5 Mathematical Description of Petri Nets ..........................................221 8.6 Petri Net Behavior ..............................................................................224 8.6.1 Reachability .............................................................................224 8.6.1.1 The Reachability Tree .............................................224 8.6.1.2 Reachability Graph ..................................................226 8.6.2 Boundedness ...........................................................................229 8.6.3 Liveness ....................................................................................229 8.6.4 Reversibility .............................................................................232 8.6.5 Fairness ....................................................................................232 8.6.6 Incidence Matrix .....................................................................232 8.6.7 T-Invariants ..............................................................................234 8.6.8 S-Invariants..............................................................................236 8.6.9 Siphons and Traps ..................................................................237 Exercises ........................................................................................................238 9. Timed Petri Nets .........................................................................................245 9.1 Introducing Time to Petri Nets .........................................................245 9.2 Deterministic Timed Petri Nets ........................................................247 9.2.1 States in DTPNs ......................................................................248 9.2.2 Transition Firing Rules ..........................................................249 9.2.3 Performance Evaluation Based on DTPNs ..........................252 Contents ix 9.3 Probability and Stochastic Process .................................................254 9.3.1 Probability .............................................................................254 9.3.2 Stochastic Process ................................................................257 9.3.3 Continuous-Time Markov Chains .....................................258 9.4 Stochastic Petri Nets .........................................................................262 9.4.1 Definition ..............................................................................262 9.4.2 Performance Evaluation ......................................................265 Exercises ........................................................................................................268 10. Colored Petri Nets ......................................................................................271 10.1 Introductory Examples .....................................................................271 10.2 Colored Petri Nets .............................................................................279 10.2.1 Multi-Set ................................................................................279 10.2.2 Variable Set of an Expression .............................................280 10.2.3 Evaluation of an Expression ...............................................280 10.3 Analysis of Colored Petri Nets ........................................................285 Exercises ........................................................................................................286 Index .....................................................................................................................291

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.