
LOGIC IN COMPUTER SCIENCE by Benji MO Some people are always critical of vague statements. I tend rather to be critical precise statements. They are the only ones which can correctly be labeled wrong. { Raymond Smullyan August 2020 Supervisor: Professor Hantao Zhang TABLE OF CONTENTS Page LIST OF FIGURES . viii CHAPTER 1 Introduction to Logic . 1 1.1 Logic is Everywhere . 2 1.1.1 Statement or Proposition . 3 1.1.2 A Brief History of Logic . 4 1.2 Logical Fallacies in Arguments . 5 1.2.1 Formal Fallacies . 6 1.2.2 Informal Fallacies . 7 1.3 A Brief Review of Mathematical Logic . 14 1.3.1 Set Theory . 14 1.3.2 Model Theory . 23 1.3.3 Proof Theory . 25 1.3.4 Computability Theory . 28 1.4 Exercise Problems . 32 2 Propositional Logic . 36 2.1 Syntax . 36 2.1.1 Logical Operators . 36 2.1.2 Formulas . 38 2.2 Semantics . 40 2.2.1 Interpretations . 40 2.2.2 Models, Satisfiability, and Validity . 43 2.2.3 Equivalence . 45 2.2.4 Entailment . 48 2.2.5 Theorem Proving and the SAT Problem . 51 2.3 Normal Forms . 52 2.3.1 Negation Normal Form (NNF) . 54 2.3.2 Conjunctive Normal Form (CNF) . 55 2.3.3 Disjunctive Normal Form (DNF) . 57 2.3.4 Full DNF and Full CNF from Truth Table . 59 2.3.5 Binary Decision Diagram (BDD) . 60 2.4 Optimization Problems . 65 2.4.1 Minimum Set of Operators . 65 iii 2.4.2 Logic Minimization . 68 2.4.3 Maximum Satisfiability . 76 2.5 Using Propositional Logic . 77 2.5.1 Bitwise Operators . 77 2.5.2 Specify Problems in Propositional Logic . 80 2.6 Exercises . 83 3 Proof Procedures for Propositional Logic . 91 3.1 Semantic Tableau . 94 3.1.1 Tableau: A Tree Structure for DNF . 94 3.1.2 α-Rules and β-Rules . 96 3.2 Deductive Systems . 99 3.2.1 Inference Rules and Proofs . 99 3.2.2 Hilbert Systems . 101 3.2.3 Natural Deduction . 103 3.2.4 Inference Graphs . 107 3.3 Resolution . 108 3.3.1 Resolution Rule . 109 3.3.2 Resolution Strategies . 111 3.3.3 Preserving Satisfiability . 114 3.3.4 Completeness of Resolution . 117 3.3.5 A Resolution-based Decision Procedure . 120 3.3.6 Clause Deletion Strategies . 121 3.4 Boolean Constraint Propagation (BCP) . 125 3.4.1 BCP: a Simplification Procedure . 125 3.4.2 BCP: a Decision Procedure for Horn Clauses . 127 3.4.3 Unit Resolution versus Input Resolution . 127 3.4.4 Head-Tail Literals for BCP . 130 3.5 Exercises . 134 4 Propositional Satisfiability . 138 4.1 The Davis-Putnam-Logemann-Loveland Procedure . 139 4.1.1 Recursive Version of DPLL . 139 4.1.2 All-SAT and Incremental SAT Solvers . 142 4.1.3 BCPw: Implementation of Watch Literals . 143 4.1.4 Iterative Implementation of DPLL . 146 4.1.5 Decisions and Decision Heuristics . 148 4.2 Conflict-Driven Clause Learning (CDCL) . 148 4.2.1 Generate Clause from Conflict . 149 4.2.2 DPLL with CDCL . 151 4.2.3 Unsatisfiable Cores . 153 4.2.4 Random Restart . 155 4.3 Use of SAT Solvers . 156 iv 4.3.1 Specify SAT Instances in DIMACS Format . 157 4.3.2 Sudoku Puzzle . 158 4.3.3 Latin Square Problems . 160 4.3.4 Graph Problems . 161 4.4 Local Search Methods . 163 4.4.1 Local Search Methods for SAT . 164 4.4.2 2SAT vesus Max-2SAT . 166 4.5 Maximum Satisfiability . 168 4.5.1 Weight Max-SAT and Hybrid Max-SAT . 168 4.5.2 The Branch-and-Bound Algorithm . 170 4.5.3 Simplification Rules and Lower Bound . 172 4.5.4 Use of Hybrid Max-SAT Solvers . 175 4.6 Exercise Problems . 179 5 First Order Logic . 181 5.1 Syntax of First Order Languages . 181 5.1.1 Terms and Formulas . 182 5.1.2 The Quantifiers . 186 5.1.3 Unsorted and Many-Sorted Logics . 188 5.2 Semantics . 190 5.2.1 Interpretation . 190 5.2.2 Models, Satisfiability, and Validity . 194 5.2.3 Entailment and Equivalence . 195 5.3 Proof Methods . 199 5.3.1 Semantic Tableau . 199 5.3.2 Natural Deduction . 202 5.4 Conjunctive Normal Form . 203 5.4.1 Prenex Normal Form and Negation Normal Form . 203 5.4.2 Skolemization . 205 5.4.3 Skolemizing Non-Prenex Formulas . 208 5.4.4 Clausal Form . 209 5.4.5 Herbrand Models for CNF . 211 5.5 Exercise Problems . 213 6 Unification and Resolution . 215 6.1 Unification . 215 6.1.1 Substitutions and Unifiers . 215 6.1.2 Combining Substitutions . 217 6.1.3 Rule-Based Unification . 217 6.1.4 Almost Linear Time Unification . 221 6.2 Resolution . 225 6.2.1 The Resolution and Factoring Rules . 225 6.2.2 A Refutationbal Proof Procedure . 228 v 6.3 Ordered Resolution . 230 6.3.1 Simplfication Orderings . 230 6.3.2 The Ordered Resolution Rule . 234 6.3.3 Completeness of Ordered Resolution . 234 6.4 Prover9 and Mace4 . 237 6.4.1 Input Formulas to Prover9 . 237 6.4.2 Inference Rules and Options . 243 6.4.3 Search Heuristics and Limits . 246 6.4.4 Term Ordering in Prover9 . 249 6.4.5 Mace4 . 250 6.4.6 Finite Model Finding by SAT Solvers . 253 6.5 Exercise Problems . 255 7 Equational Logic . 257 7.1 Equality of Terms . 257 7.1.1 Axioms of Equality . 258 7.1.2 Semantics of \=" . 259 7.1.3 Theory of Equations . 261 7.2 Rewrite Systems . 263 7.2.1 Rewrite Rules . 264 7.2.2 Termination of Rewrite Systems . 266 7.2.3 Confluence of Rewriting . 267 7.2.4 The Knuth-Bendix Completion Procedure . 268 7.3 Inductive Theorem Proving . 275 7.3.1 Inductive Theorems . 275 7.3.2 Structural Induction . 276 7.3.3 Induction on Two Variables . 278 7.3.4 Multi-Sort Algebraic Specifications . 280 7.4 Resolution with Equality . 282 7.4.1 Paramodulation . 282 7.4.2 Simplification Rules . 283 7.4.3 Prover9 . 286 7.5 Exercise Problems . 287 8 Prolog: Programming in Logic . 290 8.1 Prolog's Working Principle . 290 8.1.1 Horn Clauses in Prolog ..
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages144 Page
-
File Size-