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

Similar documents
Predicate Logic. Andreas Klappenecker

Review for Midterm 1. Andreas Klappenecker

CSCE 222 Discrete Structures for Computing. Review for Exam 1. Dr. Hyunyoung Lee !!!

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

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

Review 1. Andreas Klappenecker

software design & management Gachon University Chulyun Kim

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

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

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

Rules Build Arguments Rules Building Arguments

Outline. Rules of Inferences Discrete Mathematics I MATH/COSC 1056E. Example: Existence of Superman. Outline

Discrete Mathematics Logics and Proofs. Liangfeng Zhang School of Information Science and Technology ShanghaiTech University

2-4: The Use of Quantifiers

ICS141: Discrete Mathematics for Computer Science I

Section Summary. Section 1.5 9/9/2014

CSCE 222 Discrete Structures for Computing. Review for the Final. Hyunyoung Lee

Logic and Proof. Aiichiro Nakano

Rules of Inference. Arguments and Validity

Review: Potential stumbling blocks

Predicate Logic & Quantification

Logical Operators. Conjunction Disjunction Negation Exclusive Or Implication Biconditional

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

Thinking of Nested Quantification

Readings: Conjecture. Theorem. Rosen Section 1.5

Formal Logic: Quantifiers, Predicates, and Validity. CS 130 Discrete Structures

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

Review 3. Andreas Klappenecker

Discrete Structures of Computer Science Propositional Logic III Rules of Inference

Proposi'onal Logic Not Enough

Discrete Structures for Computer Science

1 The Foundation: Logic and Proofs

PREDICATE LOGIC. Schaum's outline chapter 4 Rosen chapter 1. September 11, ioc.pdf

Predicate Logic - Deductive Systems

CS 2336 Discrete Mathematics

Intro to Logic and Proofs

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.

1 The Foundation: Logic and Proofs

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

CPSC 121: Models of Computation

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

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

Logic. Logic is a discipline that studies the principles and methods used in correct reasoning. It includes:

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

CSCI-2200 FOUNDATIONS OF COMPUTER SCIENCE

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

Chapter 2: The Logic of Quantified Statements

MACM 101 Discrete Mathematics I. Exercises on Predicates and Quantifiers. Due: Tuesday, October 13th (at the beginning of the class)

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

Supplementary Logic Notes CSE 321 Winter 2009

DISCRETE MATH: LECTURE Chapter 3.3 Statements with Multiple Quantifiers If you want to establish the truth of a statement of the form

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

! Predicates! Variables! Quantifiers. ! Universal Quantifier! Existential Quantifier. ! Negating Quantifiers. ! De Morgan s Laws for Quantifiers

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

KS MATEMATIKA DISKRIT (DISCRETE MATHEMATICS ) RULES OF INFERENCE. Discrete Math Team

Predicate Logic Thursday, January 17, 2013 Chittu Tripathy Lecture 04

Unit I LOGIC AND PROOFS. B. Thilaka Applied Mathematics

Chapter 3. The Logic of Quantified Statements

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.

ECOM Discrete Mathematics

n Empty Set:, or { }, subset of all sets n Cardinality: V = {a, e, i, o, u}, so V = 5 n Subset: A B, all elements in A are in B

First order Logic ( Predicate Logic) and Methods of Proof

Solutions to Exercises (Sections )

EECS 1028 M: Discrete Mathematics for Engineers

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

Boolean Algebra and Proof. Notes. Proving Propositions. Propositional Equivalences. Notes. Notes. Notes. Notes. March 5, 2012

Predicate Logic. Example. Statements in Predicate Logic. Some statements cannot be expressed in propositional logic, such as: Predicate Logic

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

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

The Process of Mathematical Proof

Discrete Mathematical Structures: Theory and Applications

Chapter 1 Elementary Logic

MAT 243 Test 1 SOLUTIONS, FORM A

Proofs. Example of an axiom in this system: Given two distinct points, there is exactly one line that contains them.

Why Learning Logic? Logic. Propositional Logic. Compound Propositions

Mat 243 Exam 1 Review

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

Handout #7 Predicate Logic Trees

Discrete Mathematics Recitation Course 張玟翔

Denote John by j and Smith by s, is a bachelor by predicate letter B. The statements (1) and (2) may be written as B(j) and B(s).

LECTURE NOTES DISCRETE MATHEMATICS. Eusebius Doedel

Sec$on Summary. Valid Arguments Inference Rules for Propositional Logic. Inference Rules for Quantified Statements. Building Arguments

University of Ottawa CSI 2101 Midterm Test Instructor: Lucia Moura. March 1, :00 pm Duration: 1:15 hs

Logic and Propositional Calculus

Discrete Mathematics

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

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

Section 1.1 Propositions

Full file at Chapter 1

CSE 20 DISCRETE MATH. Winter

Predicates, Quantifiers and Nested Quantifiers

At least one of us is a knave. What are A and B?

Inference and Proofs (1.6 & 1.7)

Sec$on Summary. Valid Arguments Inference Rules for Propositional Logic. Inference Rules for Quantified Statements. Building Arguments

Predicate Calculus - Syntax

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

Math 3336: Discrete Mathematics Practice Problems for Exam I

CS0441 Discrete Structures Recitation 3. Xiang Xiao

Discrete Structures CRN Test 3 Version 1 CMSC 2123 Autumn 2013

Propositional Functions. Quantifiers. Assignment of values. Existential Quantification of P(x) Universal Quantification of P(x)

Transcription:

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

Predicates A function P from a set D to the set Prop of propositions is called a predicate. The set D is called the domain of P. 2

Example Let D=Z be the set of integers. Let a predicate P: Z -> Prop be given by P(x) = x>3. The predicate itself is neither true or false. However, for any given integer the predicate evaluates to a truth value. For example, P(4) is true and P(2) is false 3

Universal Quantifier (1) Let P be a predicate with domain D. The statement P(x) holds for all x in D can be written shortly as xp(x). 4

Universal Quantifier (2) Suppose that P(x) is a predicate over a finite domain, say D={1,2,3}. Then xp(x) is equivalent to P(1) P(2) P(3). 5

Universal Quantifier (3) Let P be a predicate with domain D. xp(x) is true if and only if P(x) is true for all x in D. Put differently, xp(x) is false if and only if P(x) is false for some x in D. 6

Existential Quantifier The statement P(x) holds for some x in the domain D can be written as x P(x) Example: x (x>0 x 2 = 2) is true if the domain is the real numbers but false if the domain is the rational numbers. 7

Logical Equivalence (1) Two statements involving quantifiers and predicates are logically equivalent if and only if they have the same truth values no matter which predicates are substituted into these statements and which domain is used. We write A B for logically equivalent A and B. 8

Logical Equivalence (2) x(p(x) Q(x)) xp(x) xq(x) Proof: Suppose x(p(x) Q(x)) is true. Then for all a in the domain P(a) Q(a) is true. Hence, both P(a) is true and Q(a) is true. Since P(a) is true for all a in the domain, xp(x) is true. Since Q(a) is true for all a in the domain, xq(x) is true. Hence xp(x) xq(x) is true. [What else do we need to show?] 9

Logical Equivalence (3) Suppose that xp(x) xq(x) is true. It follows that xp(x) is true, and that xq(x) is true. Hence, for each element a in the domain P(a) is true, and Q(a) is true. Hence P(a) Q(a) is true for each element a in the domain. Therefore, by definition, x(p(x) Q(x)) is true. 10

De Morgan s Laws The two versions of the de Morgan s laws for universal and existential quantifiers are given by 8xP (x) 9x P (x) 9xP (x) 8x P (x) 11

Example 8x(P (x) Q(x)) 9x(P (x) ^ Q(x)) Proof: 8x(P (x) Q(x)) 9x (P (x) Q(x)) 9x ( P (x) _ Q(x)) 9x( P (x) ^ Q(x)) 9x(P (x) ^ Q(x)) 12

Nested Quantifiers Suppose that P(x,y) is a predicate over a finite domain, say Dx={1,2} and Dy={3,4}. Then x yp(x,y) [P(1,3) P(1,4)] [P(2,3) P(2,4)], and x yp(x,y) [P(1,3) P(1,4)] [P(2,3) P(2,4)]. 13

Nested Quantifiers Example (1) Each person s program is unique. Domain is set of persons. P(x,y): The program of person x is the same as that of person y. x y((x y) P(x,y)) There is an input that causes every person s program to crash or loop forever. C(x,y): the program of person x crashes on input y L(x,y): the program of person x loops forever on input y 14

Nested Quantifiers Example (2) C(x,y): the program of person x crashes on input y L(x,y): the program of person x loops forever on input y Domain for y is set of all inputs. (1) y x (C(x,y) L(x,y)) x y (C(x,y) L(x,y)) (2) (1) There is an input that causes every person s program to crash or loop forever. (2) Every person s program has some input on which it either crashes or loops forever. 15

Quantified Predicate Example The quantifiers can make definitions more memorable. Recall that the limit lim xa f(x) =L is defined as: For every real number ε>0 there exists a δ>0 such that f(x)-l <ε whenever 0 < x-a < δ. 16

Quantified Predicate Example (2) lim xa f(x) =L For every real number ε>0 there exists a δ>0 such that f(x)-l <ε whenever 0 < x-a < δ. x(0 < x a < f(x) L < ) 17

Quantified Predicate Example (3) lim xa f(x) =L What does it mean that the limit does not exist? x(0 < x a < f(x) L < ) x (0 < x a < f(x) L < ) x ( (0 < x a < ) f(x) L < ) x(0 < x a < f(x) L ) 18

Rules of Inference 19

Valid Arguments An argument in propositional logic is a sequence of propositions that end with a proposition called conclusion. The argument is called valid if the conclusion follows from the preceding statements (called premises). In other words, in a valid argument it is impossible that all premises are true but the conclusion is false. 20

Example If you have a current password, then you can log on to the network. (p->q) You have a current password (p) Therefore, You can log on to the network (q) 21

Modus Ponens The tautology (p (p->q)) -> q is the basis for the rule of inference called modus ponens. p p -> q ------- q 22

Modus Tollens q p -> q ------ p The University will not close on Thursday. If it snows on Thursday, then the University will close. Therefore, It will not snow on Thursday 23

Simplification p q ------ p See Table 1 Rules of Inference on page 72 for more rules. 24

Example Formal Argument Argument p q r p r s s t ) t 1) p q 2) p 3) r p 4) r 5) r s 6) s 7) s t 8) t Hypothesis Simplification of 1) Hypothesis Modus tollens using 2) and 3) Hypothesis Modus ponens using 4) and 5) Hypothesis Modus ponens using 6) and 7) 25

Formal Argument in Action p: It will rain on Sunday p q r p r s s t ) t q: It will be warm on Sunday r: It will be cloudy on Sunday s: It will be sunny on Sunday t: We will do picnic on Sunday p q It will not rain and it will be warm. r p If it is cloudy then it will rain. r s If it is not cloudy then it will be sunny. s t If it is sunny, then we will do picnic. 26

Quantified Statements 8xP (x) ) P (a) P (a) for an arbitrary a ) 8xP (x) 9xP (x) ) P (a) for some a P (a) for some a ) 9xP (x) Universal instantiation Universal generalization Existential instantiation Existential generalization 27

Universal Modus Ponens Let us combine universal instantiation and modus ponens to get the universal modus ponens rule of inference. 8x(P (x) Q(x)) P (a) wherea is in the domain ) Q(a) For example, assume that For all positive integers n, if n>4, then n 2 <2 n is true. Then the universal modus ponens implies that 100 2 <2 100. 28