cse 311: foundations of computing Fall 2015 Lecture 6: Predicate Logic, Logical Inference

Similar documents
CSE 311: Foundations of Computing. Lecture 6: More Predicate Logic

Adam Blank Spring 2017 CSE 311. Foundations of Computing I

x P(x) x P(x) CSE 311: Foundations of Computing announcements last time: quantifiers, review: logical Inference Fall 2013 Lecture 7: Proofs

CSE 311: Foundations of Computing. Lecture 7: Logical Inference

3. The Logic of Quantified Statements Summary. Aaron Tan August 2017

Logic and Proofs. (A brief summary)

Today. Proof using contrapositive. Compound Propositions. Manipulating Propositions. Tautology

Conjunction: p q is true if both p, q are true, and false if at least one of p, q is false. The truth table for conjunction is as follows.

Predicate Logic. Andreas Klappenecker

COMP 182 Algorithmic Thinking. Proofs. Luay Nakhleh Computer Science Rice University

Supplementary Logic Notes CSE 321 Winter 2009

Predicate Calculus lecture 1

Discrete Mathematics & Mathematical Reasoning Predicates, Quantifiers and Proof Techniques

Propositional and Predicate Logic

Propositional Logic Logical Implication (4A) Young W. Lim 4/21/17

Predicate Logic. CSE 191, Class Note 02: Predicate Logic Computer Sci & Eng Dept SUNY Buffalo

Propositional and Predicate Logic

Logic, Sets, and Proofs

CSCE 222 Discrete Structures for Computing. Predicate Logic. Dr. Hyunyoung Lee. !!!!! Based on slides by Andreas Klappenecker

Logic and Proofs. (A brief summary)

Logic and Proof. Aiichiro Nakano

Propositional Logic Logical Implication (4A) Young W. Lim 4/11/17

Practice Midterm Exam Solutions

CSE 20: Discrete Mathematics

2/2/2018. CS 103 Discrete Structures. Chapter 1. Propositional Logic. Chapter 1.1. Propositional Logic

CPSC 121: Models of Computation. Module 6: Rewriting predicate logic statements

software design & management Gachon University Chulyun Kim

Tools for reasoning: Logic. Ch. 1: Introduction to Propositional Logic Truth values, truth tables Boolean logic: Implications:

2. The Logic of Compound Statements Summary. Aaron Tan August 2017

Review. Propositions, propositional operators, truth tables. Logical Equivalences. Tautologies & contradictions

Mat 243 Exam 1 Review

About the course. CSE 321 Discrete Structures. Why this material is important. Topic List. Propositional Logic. Administration. From the CSE catalog:

Logical Operators. Conjunction Disjunction Negation Exclusive Or Implication Biconditional

Packet #2: Set Theory & Predicate Calculus. Applied Discrete Mathematics

Logic. Definition [1] A logic is a formal language that comes with rules for deducing the truth of one proposition from the truth of another.

CITS2211 Discrete Structures Proofs

Proof by Contradiction

Review for Midterm 1. Andreas Klappenecker

A. Propositional Logic

Why Learning Logic? Logic. Propositional Logic. Compound Propositions

Lecture 3. Logic Predicates and Quantified Statements Statements with Multiple Quantifiers. Introduction to Proofs. Reading (Epp s textbook)

Logic Overview, I. and T T T T F F F T F F F F

1.1 Language and Logic

Propositional natural deduction

MCS-236: Graph Theory Handout #A4 San Skulrattanakulchai Gustavus Adolphus College Sep 15, Methods of Proof

EECS 1028 M: Discrete Mathematics for Engineers

MAT 243 Test 1 SOLUTIONS, FORM A

CSE 311: Foundations of Computing. Lecture 3: Digital Circuits & Equivalence

Department of Computer Science University at Albany, State University of New York Solutions to Sample Discrete Mathematics Examination II (Fall 2007)

CPSC 121: Models of Computation

Steinhardt School of Culture, Education, and Human Development Department of Teaching and Learning. Mathematical Proof and Proving (MPP)

Chapter 1, Logic and Proofs (3) 1.6. Rules of Inference

Logic. Propositional Logic: Syntax

COMP219: Artificial Intelligence. Lecture 19: Logic for KR

Predicate logic. G. Carl Evans. Summer University of Illinois. Propositional Logic Review Predicate logic Predicate Logic Examples

02 Propositional Logic

COMP219: Artificial Intelligence. Lecture 19: Logic for KR

2-4: The Use of Quantifiers

Section Summary. Section 1.5 9/9/2014

ICS141: Discrete Mathematics for Computer Science I

MATH 2001 MIDTERM EXAM 1 SOLUTION

Exercise Set 1 Solutions Math 2020 Due: January 30, Find the truth tables of each of the following compound statements.

CS100: DISCRETE STRUCTURES. Lecture 5: Logic (Ch1)

Chapter 16. Logic Programming. Topics. Logic Programming. Logic Programming Paradigm

COMP 2600: Formal Methods for Software Engineeing

CS1021. Why logic? Logic about inference or argument. Start from assumptions or axioms. Make deductions according to rules of reasoning.

Logic - recap. So far, we have seen that: Logic is a language which can be used to describe:

CSE 311: Foundations of Computing. Lecture 2: More Logic, Equivalence & Digital Circuits

3/29/2017. Logic. Propositions and logical operations. Main concepts: propositions truth values propositional variables logical operations

Discrete Mathematics and Its Applications

2. Use quantifiers to express the associative law for multiplication of real numbers.

Lecture 2. Logic Compound Statements Conditional Statements Valid & Invalid Arguments Digital Logic Circuits. Reading (Epp s textbook)

Discrete Structures for Computer Science

Math.3336: Discrete Mathematics. Nested Quantifiers/Rules of Inference

Part I: Propositional Calculus

1 The Foundation: Logic and Proofs

Argument. whenever all the assumptions are true, then the conclusion is true. If today is Wednesday, then yesterday is Tuesday. Today is Wednesday.

Learning Goals of CS245 Logic and Computation

1.1 Language and Logic

Overview. Knowledge-Based Agents. Introduction. COMP219: Artificial Intelligence. Lecture 19: Logic for KR

n logical not (negation) n logical or (disjunction) n logical and (conjunction) n logical exclusive or n logical implication (conditional)

Discrete Mathematics Recitation Course 張玟翔

Methods of Proof. 1.6 Rules of Inference. Argument and inference 12/8/2015. CSE2023 Discrete Computational Structures

A statement is a sentence that is definitely either true or false but not both.

EECS 1028 M: Discrete Mathematics for Engineers

Logic Programming (PLP 11) Predicate Calculus, Horn Clauses, Clocksin-Mellish Procedure

CSCI.6962/4962 Software Verification Fundamental Proof Methods in Computer Science (Arkoudas and Musser) Chapter p. 1/33

Quantifiers. P. Danziger

Review. Propositional Logic. Propositions atomic and compound. Operators: negation, and, or, xor, implies, biconditional.

Equivalence of Propositions

Predicate Logic & Quantification

Chapter 3. The Logic of Quantified Statements

1 The Foundation: Logic and Proofs

Chapter 2: The Logic of Quantified Statements

Sample Problems for all sections of CMSC250, Midterm 1 Fall 2014

CMPSCI 250: Introduction to Computation. Lecture 11: Proof Techniques David Mix Barrington 5 March 2013

Mathematical Reasoning Rules of Inference & Mathematical Induction. 1. Assign propositional variables to the component propositional argument.

Announcements. Exam 1 Review

The Process of Mathematical Proof

CS589 Principles of DB Systems Fall 2008 Lecture 4e: Logic (Model-theoretic view of a DB) Lois Delcambre

Transcription:

cse 311: foundations of computing Fall 2015 Lecture 6: Predicate Logic, Logical Inference

quantifiers x P(x) P(x) is true for every x in the domain read as for all x, P of x x P x There is an x in the domain for which P(x) is true read as there exists x, P of x

negations of quantifiers not every positive integer is prime some positive integer is not prime prime numbers do not exist every positive integer is not prime

negations of quantifiers x PurpleFruit(x) Domain: Fruit PurpleFruit(x) Which one is equal to x PurpleFruit(x)? x PurpleFruit(x)? x PurpleFruit(x)?

de Morgan s laws for quantifiers x P(x) x P(x) x P(x) x P(x)

de Morgan s laws for quantifiers x P(x) x P(x) x P(x) x P(x) There is no largest integer. x y ( x y) x y ( x y) x y ( x y) x y (y > x) For every integer there is a larger integer.

scope of quantifiers example: Notlargest(x) y Greater (y, x) z Greater (z, x) truth value: doesn t depend on y or z bound variables does depend on x free variable quantifiers only act on free variables of the formula they quantify x ( y (P(x, y) x Q(y, x)))

scope of quantifiers example: Domain = positive integers IsMultiple x, y = x is a multiple of y x x > 1 (x = y) IsMultiple y, x Prime(y) x y x < y Prime(y) x y x < y x x > 1 x = y IsMultiple y, x

scope of quantifiers example: Domain = positive integers IsMultiple x, y = x is a multiple of y x x > 1 (x = y) IsMultiple y, x Prime(y) x y x < y Prime y Prime y + 2 x y x < y x x > 1 x = y IsMultiple y, x x x > 1 x = y IsMultiple y, x

scope of quantifiers example: Domain = positive integers IsMultiple x, y = x is a multiple of y x x > 1 (x = y) IsMultiple y, x Prime(y) x y x < y Prime y Prime y + 2 x < y 2 x y x < y x x > 1 x = y IsMultiple y, x x x > 1 x = y IsMultiple y, x (x < y 2 )

scope of quantifiers x (P(x) Q(x)) vs. x P(x) x Q(x)

nested quantifiers Bound variable names don t matter x y P(x, y) a b P(a, b) Positions of quantifiers can sometimes change x (Q(x) y P(x, y)) x y (Q(x) P(x, y)) But: order is important...

predicate with two variables y x P(x, y)

quantification with two variables expression when true when false x y P(x, y) x y P(x, y) x y P(x, y) x y P(x, y)

x y P(x, y) y x

x y P(x, y) y x

x y P(x, y) y x

x y P(x, y) y x

quantification with two variables expression when true when false x y P(x, y) x y P(x, y) x y P(x, y) x y P(x, y)

logal inference So far we ve considered: How to understand and express things using propositional and predicate logic How to compute using Boolean (propositional) logic How to show that different ways of expressing or computing them are equivalent to each other Logic also has methods that let us infer implied properties from ones that we know Equivalence is only a small part of this

applications of logical inference Software Engineering Express desired properties of program as set of logical constraints Use inference rules to show that program implies that those constraints are satisfied Artificial Intelligence Automated reasoning Algorithm design and analysis e.g., Correctness, Loop invariants. Logic Programming, e.g. Prolog Express desired outcome as set of constraints foundations of rational thought Automatically apply logic inference to derive solution

proofs Start with hypotheses and facts Use rules of inference to extend set of facts Result is proved when it is included in the set

an inference rule: Modus Ponens If p and p q are both true then q must be true Write this rule as p, p q q Given: If it is Monday then you have a 311 class today. It is Monday. Therefore, by modus ponens: You have a 311 class today.

proofs Show that r follows from p, p q, and q r 1. p given 2. p q given 3. q r given 4. q modus ponens from 1 and 2 5. r modus ponens from 3 and 4

proofs can use equivalences too Show that p follows from p q and q 1. p q given 2. q given 3. q p contrapositive of 1 4. p modus ponens from 2 and 3

Each inference rule is written as:...which means that if both A and B are true then you can infer C and you can infer D. For rule to be correct (A B) C and (A B) D must be a tautologies A, B C,D inference rules Sometimes rules don t need anything to start with. These rules are called axioms: e.g. Excluded Middle Axiom p p

simple propositional inference rules Excluded middle plus two inference rules per binary connective, one to eliminate it and one to introduce it: p q p, q p q, p q p, p q q p, q p q p x p q, q p p q p q Direct Proof Rule Not like other rules

important: applications of inference rules You can use equivalences to make substitutions of any sub-formula. Inference rules only can be applied to whole formulas (not correct otherwise) e.g. 1. p q given 2. (p r) q intro from 1. Does not follow! e.g. p=f, q=f, r=t

direct proof of an implication p q denotes a proof of q given p as an assumption The direct proof rule: If you have such a proof then you can conclude that p q is true Example: proof subroutine 1. p assumption 2. p q intro for from 1 3. p (p q) direct proof rule