ebook img

Logics for Computer Science, 2nd Edition PDF

431 Pages·2018·2.449 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 Logics for Computer Science, 2nd Edition

Logics for Computer Science Second Edition Arindama Singh Department of Mathematics Indian Institute of Technology Madras Delhi-110092 2018 Contents Preface ...............................................................................................................vii Preface to the First Edition .................................................................................ix 1. Propositional Logic ....................................................................................1 1.1 Introduction .......................................................................................1 1.2 Syntax of PL ..................................................................................... 3 1.3 Is It a Proposition? ............................................................................ 6 1.4 Interpretations ..................................................................................11 1.5 Models ............................................................................................ 17 1.6 Equivalences and Consequences .................................................... 20 1.7 More About Consequence .............................................................. 25 1.8 Summary and Problems ................................................................. 27 2. A Propositional Calculus .........................................................................35 2.1 Axiomatic System PC .....................................................................35 2.2 Five Theorems about PC ................................................................ 41 2.3 Using the Metatheorems ................................................................. 45 2.4 Adequacy of PC to PL .....................................................................50 2.5 Compactness of PL ......................................................................... 55 2.6 Replacement Laws ......................................................................... 60 2.7 Quasi-proofs In PL ......................................................................... 64 2.8 Summary and Problems ................................................................. 66 3. Normal Forms and Resolution ................................................................70 3.1 Truth Functions ...............................................................................70 3.2 CNF and DNF .................................................................................72 3.3 Logic Gates .................................................................................... 77 3.4 Satisfiability Problem ......................................................................81 3.5 2SAT and Horn-SAT ..................................................................... 83 3.6 Resolution in PL ............................................................................. 86 3.7 Adequacy of resolution in PL ......................................................... 91 3.8 Resolution Strategies .......................................................................94 3.9 Summary and Problems ................................................................. 97 4. Other Proof Systems for PL ..................................................................103 4.1 Calculation ................................................................................... 103 4.2 Natural Deduction ........................................................................ 106 iii iv CONTENTS 4.3 Gentzen Sequent Calculus ............................................................ 110 4.4 Analytic Tableaux ........................................................................ 116 4.5 Adequacy of PT to PL ...................................................................122 4.6 Summary and Problems ............................................................... 127 5. First Order Logic ...................................................................................131 5.1 Syntax of FL ................................................................................. 131 5.2 Scope and Binding ....................................................................... 135 5.3 Substitutions ................................................................................. 139 5.4 Semantics of FL ............................................................................141 5.5 Translating into FL ........................................................................146 5.6 Satisfiability and Validity ............................................................. 149 5.7 Some Metatheorems ..................................................................... 152 5.8 Equality Sentences ....................................................................... 157 5.9 Summary and Problems ............................................................... 163 6. A First Order Calculus ..........................................................................168 6.1 Axiomatic System FC ...................................................................168 6.2 Six Theorems about FC ................................................................ 171 6.3 Adequacy of FC to FL ...................................................................177 6.4 Compactness of FL ....................................................................... 184 6.5 Laws in FL ................................................................................... 190 6.6 Quasi-proofs in FL ....................................................................... 195 6.7 Summary and Problems ............................................................... 198 7. Clausal Forms and Resolution ..............................................................201 7.1 Prenex Form ................................................................................. 201 7.2 Quantifier-free forms .....................................................................204 7.3 Clauses ......................................................................................... 211 7.4 Unification of Clauses ...................................................................213 7.5 Extending Resolution ....................................................................220 7.6 Factors and Pramodulants ............................................................ 223 7.7 Resolution for FL ......................................................................... 226 7.8 Horn Clauses in FL ...................................................................... 229 7.9 Summary and Problems ............................................................... 232 8. Other Proof Systems for FL ..................................................................236 8.1 Calculation ................................................................................... 236 8.2 Natural Deduction ........................................................................ 240 8.3 Gentzen Sequent Calculus ............................................................ 245 8.4 Analytic Tableaux ........................................................................ 250 8.5 Adequacy of FT to FL ...................................................................255 8.6 Summary and Problems ............................................................... 260 CONTENTS v 9. Program Verification .............................................................................263 9.1 Debugging a Program ....................................................................263 9.2 Issue of Correctness ..................................................................... 265 9.3 The Core Language CL ................................................................ 268 9.4 Partial Correctness ........................................................................ 272 9.5 Axioms And Rules ....................................................................... 275 9.6 Hoare Proof .................................................................................. 279 9.7 Proof Summary .............................................................................282 9.8 Total Correctness .......................................................................... 288 9.9 A Predicate Transformer .............................................................. 292 9.10 Summary and Problems ............................................................... 300 10. First Order Theories ..............................................................................305 10.1 Structures and Axioms ................................................................. 305 10.2 Set Theory .................................................................................... 310 10.3 Arithmetic ..................................................................................... 313 10.4 Herbrand Interpretation ................................................................ 316 10.5 Herbrand Expansion ..................................................................... 318 10.6 Skolem-Löwenheim Theorems .................................................... 322 10.7 Decidability .................................................................................. 324 10.8 Expressibility ................................................................................ 328 10.9 Provability Predicate .....................................................................332 10.10 Summary and Problems ............................................................... 336 11. Modal Logic K ........................................................................................341 11.1 Introduction .................................................................................. 341 11.2 Syntax and Semantics of K ...........................................................343 11.3 Validity and Consequence in K .................................................... 350 11.4 Axiomatic System KC ...................................................................354 11.5 Adequacy of KC to K ....................................................................357 11.6 Natural Deduction in K ................................................................ 359 11.7 Analytic Tableau for K................................................................. 362 11.8 Other Modal Logics ..................................................................... 368 11.9 Various Modalities ....................................................................... 375 11.10 Computation Tree Logic .............................................................. 379 11.11 Summary and Problems ............................................................... 384 12. Some Other Logics .................................................................................387 12.1 Introduction .................................................................................. 387 12.2 Intuitionistic Logic ....................................................................... 388 12.3 Łukasiewicz Logics ...................................................................... 391 12.4 Probabilistic Logics ...................................................................... 395 12.5 Possibilistic and Fuzzy Logic ....................................................... 396 12.5.1 Crisp sentences and precise information .......................... 397 vi CONTENTS 12.5.2 Crisp sentences and imprecise information ..................... 397 12.5.3 Crisp sentences and fuzzy information .............................398 12.5.4 Vague sentences and fuzzy information .......................... 398 12.6 Default Logic ................................................................................ 398 12.7 Autoepistemic Logics ....................................................................402 12.8 Summary .......................................................................................404 References ......................................................................................................405 Index ................................................................................................................411 Preface The first edition of this book was used by many academicians; and their comments and suggestions had to be implemented sooner or later. For instance, Prof. Norman Foo of University of New South Wales (UNSW) said: “This is the best book available in the market that suits my course on logic for CS masters students.” However, one of his colleagues reported that he had to refer to other books for applications of compactness. Now, it becomes somewhat obligatory on my part to discuss applications of compactness in this edition. In this revised version, the circularity in presenting logic via formal semantics is brought to the fore in a very elementary manner. Instead of developing everything from semantics, we now use an axiomatic system to model reasoning. Other proof methods are introduced and worked out later as alternative models. Elimination of the equality predicate via equality sentences is dealt with semantically even before the axiomatic system for first order logic is presented. The replacement laws and the quantifier laws are now explicitly discussed along with the necessary motivation of using them in constructing proofs in mathematics. Adequacy of the axiomatic system is now proved in detail. An elementary proof of adequacy of Analytic Tableaux is now included. Special attention is paid to the foundational questions such as decidability, expressibility, and incompleteness. These important and difficult topics are dealt with briefly and in an elementary manner. The material on Program Verification, Modal Logics, and Other Logics in Chapters 9, 11 and 12 have undergone minimal change. Attempt has been made to correct all typographical errors pointed out by the readers. However, rearrangement of the old material and the additional topics might have brought in new errors. Numerous relevant results, examples, exercises and problems have been added. The correspondence of topics to chapters and sections have changed considerably, compared to the first edition. A glance through the table of contents will give you a comprehensive idea. The book now contains enough material to keep students busy for two semesters. However, by carefully choosing the topics, the essential portion of the book can be covered in a single semester. The core topics are discussed in Chapters 1, 2, 5, 6, 10, and Sections 3.1–3.5 and 7.1–7.2. As an alternative to the axiomatic system, one may replace Chapters 2 and 6 with Sections 4.4–4.5, 8.4–8.5, 2.5 and 6.4. Topics from other chapters may be discussed depending on the requirement of the students. I cheerfully thank all those whose suggestions were the driving force in bringing out this edition. I thank all those students who wanted me to relate to them the rigorous foundation of mathematics. I acknowledge the trouble taken by vii viii PREFACE Norman Foo of UNSW, S. H. Kulkarni, Sounaka Mishra, Kalpana Mahalingam of IIT Madras, Balasubramaniam Jayaram of IIT Hyderabad, and my long-time friend Biswa R. Patnaik of Toronto, in carefully reading the earlier drafts, finding mistakes, and suggesting improvements. Most part of this edition was drafted during my three months stay at Fayetteville, Arkansas with my family. The pleasure of working on the book was doubled due to frequent get together arranged by Brajendra Panda of University of Arkansas, and his wife Rashmi; I thank them profusely. I thank the administrators of IIT Madras for granting me sabbatical so that I could devote full time on the book. I also thank the publisher, PHI Learning, Delhi and their production team for timely help in typesetting. Arindama Singh Preface to the First Edition Each chapter in this book has an introduction, the first section. But there is no introduction to the book itself. So, let me use the mask of the Preface for this purpose. Of course, a plain introduction to the book is just to place the book in your hand; but while you are reading it, you yourself have already done that. Well done! This is the way I will be talking to you throughout. I will ask you to do exercises on the spot, often waiting for you up to some point, and then give you a hint to proceed. It is something like the following commercial for the book: I would like to ask you three questions, would you answer them with a plain ‘Yes’ or ‘No’? Good, you have answered ‘Yes’, whatever be the reason. But see, that was my first question. Would you answer the same to the second as to the third? Very good, you have answered ‘Yes’ again; of course, it does not matter. If you have not bought a copy of this book, are you going to buy it soon? Look, if you have answered ‘Yes’ to the second question, you are also answering ‘Yes’ to the third, and if you have answered ‘No’ to the second, you are not answering ‘No’ to the third, i.e., your answer to the third is undoubtedly, ‘Yes’. Excellent. That is the end of the commercial. You have participated well in the commercial; I hope you will be with me throughout. It is easy to learn logic and easier to teach it; that is the spirit of this book. I would not reveal what is logic; you will discover it eventually. My aim is to equip you with the logical methods so that when you take up computer science as your profession, you will feel like a fish in water. A warning: though the book is ideal for self-learning, it would not replace a teacher. At least on one count: you can ask a question to your teacher and, hopefully, he1 will give you an answer, or you will be inspired by him for finding your own answer; the book cannot do that always. If you are a teacher, you may not need to learn all the topics, for you had probably learnt them. But you can really teach logic better by helping your students in the exercises. You can supplement the book with more computer science applications 1The masculine gender is used throughout the book not because of some chauvinistic reasons, as it is easy to do that. It is easy to write ‘he’ rather than ‘she’ or ‘one’ or ‘a person’ or ‘a human being’ etc. You need not be offended by it. ix

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.