Logic and its Applications

Similar documents
Introductory logic and sets for Computer scientists

LOGIC AND DISCRETE MATHEMATICS

MATHEMATICAL STRUCTURES FOR COMPUTER SCIENCE

Foundations of AI. 9. Predicate Logic. Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution

Boolean Reasoning. The Logic of Boolean Equations. Frank Markham Brown Air Force Institute of Technology

Constraint Solving. Systems and Internet Infrastructure Security

[Ch 6] Set Theory. 1. Basic Concepts and Definitions. 400 lecture note #4. 1) Basics

Propositional Calculus. Math Foundations of Computer Science

COMP4418 Knowledge Representation and Reasoning

Notes for Chapter 12 Logic Programming. The AI War Basic Concepts of Logic Programming Prolog Review questions

Module 6. Knowledge Representation and Logic (First Order Logic) Version 2 CSE IIT, Kharagpur

Logic (or Declarative) Programming Foundations: Prolog. Overview [1]

CSL105: Discrete Mathematical Structures. Ragesh Jaiswal, CSE, IIT Delhi

DISCRETE MATHEMATICS

HANDBOOK OF LOGIC IN ARTIFICIAL INTELLIGENCE AND LOGIC PROGRAMMING

Digital System Design with SystemVerilog

quanüfied Statements; valid well-formed formulas; comparison of propositional and predicate wffs. Exercises

Losp for Predicate Calculus

The Unified Modeling Language User Guide

Knowledge Representation and Reasoning Logics for Artificial Intelligence

Knowledge Representation and Reasoning Logics for Artificial Intelligence

A Survey of Mathematics with Applications 8 th Edition, 2009

Software Engineering Lecture Notes

Summary of Course Coverage

Fundamentals of Discrete Mathematical Structures

Propositional Calculus: Boolean Algebra and Simplification. CS 270: Mathematical Foundations of Computer Science Jeremy Johnson

Propositional Calculus. CS 270: Mathematical Foundations of Computer Science Jeremy Johnson

About the Author. Dependency Chart. Chapter 1: Logic and Sets 1. Chapter 2: Relations and Functions, Boolean Algebra, and Circuit Design

COMPUTATIONAL SEMANTICS WITH FUNCTIONAL PROGRAMMING JAN VAN EIJCK AND CHRISTINA UNGER. lg Cambridge UNIVERSITY PRESS

Formal Predicate Calculus. Michael Meyling

Lecture 5. Logic I. Statement Logic

Logic Programming Languages

Resolution (14A) Young W. Lim 6/14/14

Lecture 1: Conjunctive Queries

Notes. Notes. Introduction. Notes. Propositional Functions. Slides by Christopher M. Bourke Instructor: Berthe Y. Choueiry.

Theorem proving. PVS theorem prover. Hoare style verification PVS. More on embeddings. What if. Abhik Roychoudhury CS 6214

Using MATLAB, SIMULINK and Control System Toolbox

Lecture 17 of 41. Clausal (Conjunctive Normal) Form and Resolution Techniques

Chapter 16. Logic Programming Languages

The Formal Semantics of Programming Languages An Introduction. Glynn Winskel. The MIT Press Cambridge, Massachusetts London, England

EXTENSIONS OF FIRST ORDER LOGIC

Programming Languages Third Edition

AN INTRODUCTION TO FUZZY SETS Analysis and Design. Witold Pedrycz and Fernando Gomide

CSE 20 DISCRETE MATH. Fall

FUZZY SPECIFICATION IN SOFTWARE ENGINEERING

CSE 20 DISCRETE MATH. Winter

Programming in Python 3

MariaDB Crash Course. A Addison-Wesley. Ben Forta. Upper Saddle River, NJ Boston. Indianapolis. Singapore Mexico City. Cape Town Sydney.

Contents. Chapter 1 SPECIFYING SYNTAX 1

SQL Queries. for. Mere Mortals. Third Edition. A Hands-On Guide to Data Manipulation in SQL. John L. Viescas Michael J. Hernandez

Mathematical Logic Prof. Arindama Singh Department of Mathematics Indian Institute of Technology, Madras. Lecture - 37 Resolution Rules

Declarative Programming. 2: theoretical backgrounds

Lecture 4: January 12, 2015

Chapter 3: Propositional Languages

CLASSIC DATA STRUCTURES IN JAVA

Operational Semantics

1.3. Conditional expressions To express case distinctions like

An Evolution of Mathematical Tools

Propositional Calculus. Math Foundations of Computer Science

PYTHON. p ykos vtawynivis. Second eciitiovl. CO Ve, WESLEY J. CHUN

15-819M: Data, Code, Decisions

CSC 501 Semantics of Programming Languages

Com S 541. Programming Languages I

Chapter 16. Logic Programming Languages ISBN

What is the study of logic?

CSE Discrete Structures

Discrete Mathematics Lecture 4. Harper Langston New York University

8. Negation 8-1. Deductive Databases and Logic Programming. (Sommer 2017) Chapter 8: Negation

Section 2.2: Introduction to the Logic of Quantified Statements

An Introduction to Programming and Proving in Agda (incomplete draft)

Computation Club: Gödel s theorem

DATABASE THEORY. Lecture 11: Introduction to Datalog. TU Dresden, 12th June Markus Krötzsch Knowledge-Based Systems

Knowledge Representation

Warm-Up Problem. Let L be the language consisting of as constant symbols, as a function symbol and as a predicate symbol. Give an interpretation where

logic with quantifiers (informally)

Introduction to Logic Programming, April 3, 2017

Harvard School of Engineering and Applied Sciences CS 152: Programming Languages

Database Concepts. David M. Kroenke UNIVERSITATSBIBLIOTHEK HANNOVER

Introduction to Logic Programming

Overview. CS389L: Automated Logical Reasoning. Lecture 6: First Order Logic Syntax and Semantics. Constants in First-Order Logic.

Proving the Correctness of Distributed Algorithms using TLA

To prove something about all Boolean expressions, we will need the following induction principle: Axiom 7.1 (Induction over Boolean expressions):

Towards a Logical Reconstruction of Relational Database Theory

HOL DEFINING HIGHER ORDER LOGIC LAST TIME ON HOL CONTENT. Slide 3. Slide 1. Slide 4. Slide 2 WHAT IS HIGHER ORDER LOGIC? 2 LAST TIME ON HOL 1

T h e incomplete database

An Annotated Language

Higher-Order Logic. Specification and Verification with Higher-Order Logic


C for Electronic Engineering

CS221 / Autumn 2017 / Liang & Ermon. Lecture 17: Logic II

Fuzzy logic. 1. Introduction. 2. Fuzzy sets. Radosªaw Warzocha. Wrocªaw, February 4, Denition Set operations

Logic Programming and Resolution Lecture notes for INF3170/4171

ELEMENTARY NUMBER THEORY AND METHODS OF PROOF

Logic Languages. Hwansoo Han

Information Modeling and Relational Databases

Chapter 2 & 3: Representations & Reasoning Systems (2.2)

Propositional Logic. Part I

Introduction to Axiomatic Semantics

Propositional Theories are Strongly Equivalent to Logic Programs

LATEX. Leslie Lamport. Digital Equipment Corporation. Illustrations by Duane Bibby. v ADDISON-WESLEY

Transcription:

Logic and its Applications Edmund Burke and Eric Foxley PRENTICE HALL London New York Toronto Sydney Tokyo Singapore Madrid Mexico City Munich

Contents Preface xiii Propositional logic 1 1.1 Informal introduction 1 1.2 Logical connectives 2 1.2.1 Negation (not) 2 1.2.2 Conjunction (and) 2 1.2.3 Disjunction (or) 4 1.2.4 Implication 5 1.2.5 Equivalence 1 1.2.6 Sum and product notations 1 1.2.7 Priorities of Operators 8 1.3 Truth-tables of formulae 9 1.3.1 How to construct the truth-table of a formula 9 1.3.2 Identical truth-tables 11 1.3.3 Interpretations and modeis 12 1.3.4 Tautologies, absurdities and mixed formulae 12 1.4 Other logical connectives 14 1.4.1 Truth functions 14 1.4.2 Monodie Operators 15 1.4.3 Dyadic Operators 15 1.4.4 Triadic Operators 17 1.4.5 Representing truth functions in terms ofdyadic and monadic Operators 19 1.5 Manipulating propositional formulae 20 1.5.1 Standard identities 20 1.5.2 Complete sets of connectives 21 1.5.3 Other complete sets of connectives 22 1.5.4 Sheffer functions 23 V

Contents 1.5.5 Normalforms 1.6 The negation of propositional formulae 1.6.1 Definition 1.6.2 Generalized De Morgan's law 1.6.3 Extended disjunction and cönjunction 1.6.4 Duality 1.7 Arguments and argument forms 1.7.1 Some definitions associated with formulae 1.7.2 Some rules for propositional formulae 1.7.3 The validity of an argument 1.7.4 Mathematical if-and-only-if proofs 1.7.5 A theorem 1.7.6 Another theorem 1.8 Summary 1.9 Worked examples 1.10 Exercises Formal approach to propositional logic 2.1 Introduction 2.1.1 Formal Systems of propositional logic 2.1.2 Proofs and deductions 2.1.3 Constructing formal Systems 2.1.4 77ie relationship between formal Systems and interpretations 2.2 The formal propositional logic system L 2.2.1 The construction of system L 2.2.2 Proofs in system L 2.2.3 Deductions in system L 2.2.4 Derived rules of inference in system L 2.2.5 Examples 2.2.6 Notation for rules 2.3 The soundness and completeness theorems for system 2.3.1 Introduction 2.3.2 The soundness theorem for system L 2.3.3 The completeness theorem for system L 2.4 Independence of axioms and rules 2.5 Lemmon's system of propositional logic 2.5.1 An introduction to the system 2.5.2 Proofs and deductions in Lemmon's system 2.5.3 Examples of deductions in Lemmon's system 2.6 Summary 2.7 Worked examples 2.8 Exercises

Contents vii 3 Applications to logic design 3.1 3.2 3.3 3.4 3.5 3.6 3.7 Introduction Simplification techniques 3.2.1 A simple example 3.2.2 Karnaugh maps 3.2.3 Quine-McClusky minimization Universal decision elements (UDEs) 3.3.1 Definition 3.3.2 A few four-variable universal decision elements Logic design 3.4.1 Binary arithmetic adders 3.4.2 Sequential logic Summary Worked examples Exercises 4 Predicate logic 4.1 Informal introduction 4.1.1 Background 4.1.2 Universal and existential quantifiers 4.1.3 Translating between first-order languages and the English language 4.1.4 Hints for translating from English to logic 4.1.5 Examples 4.1.6 Summary 4.1.7 Exercises 4.2 The semantics of predicate logic 4.2.1 First-order languages 4.2.2 Interpretations 4.2.3 Satisfaction 4.2.4 Truth-tables of interpretations 4.2.5 Herbrand interpretations 4.2.6 Summary 4.2.7 Worked examples 4.2.8 Exercises 4.3 Syntactical Systems of predicate logic 4.3.1 The system K of predicate logic 4.3.2 Discussion of the system K 4.3.3 First-order theories 4.3.4 Summary 4.3.5 Worked example 4.3.6 Exercises 4.4 Soundness and completeness 95 95 98 98 101 105 110 111 111 113 113 115 122 122 128 131 131 131 133 136 139 140 141 142 143 143 148 151 153 155 157 157 159 161 162 163 171 173 173 174 175

viii Contents 4.4.1 Introduction 175 4.4.2 The soundness of System K 176 4.4.3 Consistency 180 4.4.4 The completeness of System K 180 4.4.5 Summary 185 4.4.6 Worked examples 185 4.4.7 Exercises 188 5 Logic programming 190 5.1 Introduction 190 5.2 Programming with propositional logic 190 5.2.1 Definitions for propositional logic 190 5.2.2 Propositional resolution 191 5.2.3 Refutation and deductions 193 5.2.4 Negation in logic programming 198 5.2.5 SLD-resolution 199 5.3 Clausal form for predicate logic 202 5.3.1 Prenexform 202 5.3.2 Clausal form 204 5.3.3 Hörn clauses 206 5.4 The semantics of logic programming 207 5.4.1 Hörn clauses and their Herbrand modeis 209 5.4.2 Logic programs and their Herbrand modeis 210 5.4.3 Least Herbrand modeis 210 5.4.4 Construction of least Herbrand modeis 211 5.5 Unification and answer substitutions 214 5.5.1 Substitutions 214 5.5.2 Unification 216 5.5.3 Practicalities 218 5.6 Programming with predicate logic 219 5.6.1 The resolution rule 219 5.6.2 The proof strategy of Prolog: SLD-resolution 219 5.6.3 Negation in logic programming: the closed-world assumption 222 5.7 Concluding remarks 223 5.8 Worked examples 224 5.9 Exercises 228 6 Formal System specification 232 6.1 Introduction 232 6.1.1 A simple example 233 6.1.2 A State Schema 233 6.1.3 Operations or events and their Schema 235

Contents ix 6.1.4 Pre-and post-conditions 241 6.2 Notational differences 241 6.3 The Z specification language 243 6.3.1 Basic type definitions 244 6.3.2 Free type definitions 244 6.3.3 Schema inclusion 245 6.3.4 Schema types 245 6.3.5 Example: a Computer file system 249 6.3.6 Axiom schema 255 6.4 Schema algebra 256 6.4.1 Linearnotation 256 6.4.2 Schema extension 256 6.4.3 Some other types of definition 256 6.4.4 Schema inclusion 257 6.4.5 The tuple and pred Operators 257 6.4.6 Ornamentation of schema names 257 6.4.7 Logical Operations on schema 257 6.4.8 Schema quantification 258 6.4.9 Identifier renaming 259 6.4.10 Identifier hiding 259 6.4.11 Schema pre-condition 260 6.4.12 Schema composition 260 6.4.13 Schema piping 262 6.4.14 Axiomatic descriptions 263 6.5 Summary 263 6.6 Worked examples 264 6.6.1 Some simple examples 264 6.6.2 Case study: a video-rental shop 271 6.6.3 Case study: a car-ferry terminal 214 6.7 Exercises 282 Appendix A: Mathematical background 284 AI Induction proofs 284 A2 Set theory 286 A2.1 Comprehensive specification of a set 286 A2.2 Operations involving sets 287 A3 Bags 288 A4 Relations 289 A4.1 Domain and ränge 289 A4.2 Composition 290 A4.3 Domain and ränge Operations 290 A4.4 Override Operation 292 A4.5 Set Image 292

x Contents A5 A6 A4.6 Equivalence relations Functions Sequences Appendix B: Other notations Bl Alternative notations B2 Polish notation B3 Worked examples B4 Exercises 293 294 295 297 297 297 300 300 Appendix C: Symbols used in the book 302 Index 305