1 Predicate Logic Rosen 6 th ed., § 1.3-1.4 2 Predicate Logic Predicate logic is an extension of propositional logic that permits concisely reasoning.

Slides:



Advertisements
Similar presentations
CS 285- Discrete Mathematics
Advertisements

Chapter 1: The Foundations: Logic and Proofs 1.1 Propositional Logic 1.2 Propositional Equivalences 1.3 Predicates and Quantifiers 1.4 Nested Quantifiers.
© by Kenneth H. Rosen, Discrete Mathematics & its Applications, Sixth Edition, Mc Graw-Hill, 2007 Chapter 1: (Part 2): The Foundations: Logic and Proofs.
L41 Lecture 2: Predicates and Quantifiers.. L42 Agenda Predicates and Quantifiers –Existential Quantifier  –Universal Quantifier 
Elementary Number Theory and Methods of Proof
2009/91 Predicates and Quantifiers (§1.3) In the sentence “x is greater than 3”: The phrase “x” denotes the subject - the object or entity that the sentence.
Module #1 - Logic 5/16/2015Michael Frank / Kees van Deemter1 Predicate Logic Rosen 5 th ed., §§ (but much extended) ~135 slides, ~5 lectures.
CSE 311 Foundations of Computing I Lecture 6 Predicate Logic Autumn 2011 CSE 3111.
Predicate Logic and Quantifies
CSE115/ENGR160 Discrete Mathematics 01/20/11 Ming-Hsuan Yang UC Merced 1.
EE1J2 - Slide 1 EE1J2 – Discrete Maths Lecture 11 Introduction to Predicate Logic Limitations of Propositional Logic Predicates, quantifiers and propositions.
Discrete Math 6A Max Welling. Recap 1. Proposition: statement that is true or false. 2. Logical operators: NOT, AND, OR, XOR, ,  3. Compound proposition:
Predicates and Quantifiers
Section 1.3: Predicates and Quantifiers
Predicates & Quantifiers Goal: Introduce predicate logic, including existential & universal quantification Introduce translation between English sentences.
CSE 311 Foundations of Computing I Lecture 6 Predicate Logic, Logical Inference Spring
Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter1 Remember: I. Construct a model where 1 and 4 are true, while 2 and 3 are false Let the u.d.
CSci 2011 Discrete Mathematics Lecture 3 CSci 2011.
The Foundations: Logic and Proofs
Logical Equivalence & Predicate Logic
資訊科學數學 6 : Predicates, Quantifiers & Mathematical Induction 陳光琦助理教授 (Kuang-Chi Chen)
Discussion #141/20 Discussion #14 Predicate Calculus.
1.1 CompSci 102© Michael Frank Today’s topics Propositional equivalencesPropositional equivalences Predicate logicPredicate logic Reading: Sections Reading:
Chapter 1, Part II: Predicate Logic With Question/Answer Animations.
Chapter 1, Part II: Predicate Logic With Question/Answer Animations.
1.1 CompSci 102© Michael Frank Today’s topics Boolean algebra previewBoolean algebra preview Propositional equivalencesPropositional equivalences Predicate.
Math 51/COEN 19 Day 3, 1.4 Quantifiers 1. 3 Predicates A lot like functions that return booleans Let P(x) denote x
CSE 311 Foundations of Computing I Lecture 7 Logical Inference Autumn 2012 CSE
Hazırlayan DISCRETE COMPUTATIONAL STRUCTURES Propositional Logic PROF. DR. YUSUF OYSAL.
1 Sections 1.3 and 1.4 Predicates & Quantifiers. 2 Propositional Functions In a mathematical assertion, such as x < 3, there are two parts: –the subject,
1 Introduction to Abstract Mathematics Predicate Logic Instructor: Hayk Melikya Purpose of Section: To introduce predicate logic (or.
1 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Lecture 02: QUANTIFIERS Sections 1.3 and 1.4 Jarek Rossignac CS1050:
Lecture Predicates and Quantifiers 1.4 Nested Quantifiers.
Lecture 7 – Jan 28, Chapter 2 The Logic of Quantified Statements.
Discrete Mathematics CS 2610 August 22, Agenda Last class Propositional logic Logical equivalences This week Predicate logic & rules of inference.
Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 1 The Foundations: Logic and Proofs Predicates and Quantifiers.
Discrete Structures – CNS 2300
Chapter 2 Symbolic Logic. Section 2-1 Truth, Equivalence and Implication.
CS 285- Discrete Mathematics Lecture 4. Section 1.3 Predicate logic Predicate logic is an extension of propositional logic that permits concisely reasoning.
Predicate Logic One step stronger than propositional logic Copyright © Curt Hill.
Copyright © Peter Cappello 2011 Predicates & Quantifiers.
PREDICATES AND QUANTIFIERS COSC-1321 Discrete Structures 1.
Mathematics for Comter I Lecture 3: Logic (2) Propositional Equivalences Predicates and Quantifiers.
1 Introduction to Abstract Mathematics Chapter 3: The Logic of Quantified Statements. Predicate Calculus Instructor: Hayk Melikya 3.1.
Section 1.4. Propositional Functions Propositional functions become propositions (and have truth values) when their variables are each replaced by a value.
Propositional Logic. Assignment Write any five rules each from two games which you like by using propositional logic notations.
Module #1 - Logic 2016/7/91 Module #1: Logic (Textbook: §1.1~1.4) Dr. Chih-Wei Yi Department of Computer Science National Chiao Tung University.
Logic Hubert Chan [O1 Abstract Concepts] [O2 Proof Techniques]
Discrete Math - Module #1 - Logic
COT 3100, Spring 2001 Applications of Discrete Structures
Chapter 3 The Logic of Quantified Statements
Predicates & Quantifiers
Predicate Calculus Discussion #14 Chapter 2, Section 1 1/20.
Discussion #14 Predicate Calculus
Chapter 1 The Foundations: Logic and Proofs
CS201: Data Structures and Discrete Mathematics I
CS 220: Discrete Structures and their Applications
CSI 2101 / Predicate logic (§ ):
Discrete Math - Module #1 - Logic
Predicate Calculus Discussion #14 Chapter 2, Section 1.
Discrete Mathematics and its Applications
Predicate Logic (§1.3) Predicate logic is an extension of propositional logic that permits concisely reasoning about whole classes of entities. Propositional.
Discrete Mathematics Lecture 4 & 5: Predicate and Quantifier
Negations of quantifiers
Discrete Mathematics Lecture 3: Predicate and Quantifier
Discrete Mathematics Lecture 4 & 5: Predicate and Quantifier
Predicates and Quantifiers
CS201: Data Structures and Discrete Mathematics I
Predicate Calculus. Predicate Calculus Topics Predicates Variables and instantiation Quantifiers Logical expressions Bound and free variables.
Presentation transcript:

1 Predicate Logic Rosen 6 th ed., §

2 Predicate Logic Predicate logic is an extension of propositional logic that permits concisely reasoning about whole classes of entities.Predicate logic is an extension of propositional logic that permits concisely reasoning about whole classes of entities. E.g.,“x>1”, “x+y=10” Such statements are neither true or false when the values of the variables are not specified.Such statements are neither true or false when the values of the variables are not specified.

3 Applications of Predicate Logic It is the formal notation for writing perfectly clear, concise, and unambiguous mathematical definitions, axioms, and theorems for any branch of mathematics.It is the formal notation for writing perfectly clear, concise, and unambiguous mathematical definitions, axioms, and theorems for any branch of mathematics. Supported by some of the more sophisticated database query engines.Supported by some of the more sophisticated database query engines. Basis for automatic theorem provers and many other Artificial Intelligence systems.Basis for automatic theorem provers and many other Artificial Intelligence systems.

4 Subjects and Predicates The propositionThe proposition “The dog is sleeping” “The dog is sleeping” has two parts: has two parts: °“the dog” denotes the subject - the object or entity that the sentence is about. °“is sleeping” denotes the predicate- a property that the subject can have.

5 Propositional Functions A predicate is modeled as a function P(·) from objects to propositions.A predicate is modeled as a function P(·) from objects to propositions. °P(x) = “x is sleeping” (where x is any object). The result of applying a predicate P to an object x=a is the proposition P(a).The result of applying a predicate P to an object x=a is the proposition P(a). °e.g. if P(x) = “x > 1”, then P(3) is the proposition “3 is greater than 1.” Note: The predicate P itself (e.g. P=“is sleeping”) is not a proposition (not a complete sentence).Note: The predicate P itself (e.g. P=“is sleeping”) is not a proposition (not a complete sentence).

6 Propositional Functions Predicate logic includes propositional functions of any number of arguments.Predicate logic includes propositional functions of any number of arguments. e.g. let P(x,y,z) = “x gave y the grade z”, x=“Mike”, y=“Mary”, z=“A”, x=“Mike”, y=“Mary”, z=“A”, P(x,y,z) = “Mike gave Mary the grade A.” P(x,y,z) = “Mike gave Mary the grade A.”

7 Universe of Discourse The collection of values that a variable x can take is called x’s universe of discourse.The collection of values that a variable x can take is called x’s universe of discourse. e.g., let P(x)=“x+1>x”. e.g., let P(x)=“x+1>x”. we could define the course of universe as the set of integers. we could define the course of universe as the set of integers.

8 Quantifier Expressions Quantifiers allow us to quantify (count) how many objects in the universe of discourse satisfy a given predicate:Quantifiers allow us to quantify (count) how many objects in the universe of discourse satisfy a given predicate: - “  ” is the FOR  LL or universal quantifier.  x P(x) means for all x in the u.d., P holds. - “  ” is the FOR  LL or universal quantifier.  x P(x) means for all x in the u.d., P holds. - “  ” is the  XISTS or existential quantifier.  x P(x) means there exists an x in the u.d. (that is, one or more) such that P(x) is true. - “  ” is the  XISTS or existential quantifier.  x P(x) means there exists an x in the u.d. (that is, one or more) such that P(x) is true.

9 Universal Quantifier  : Example Let P(x) be the predicate “x is full.”Let P(x) be the predicate “x is full.” Let the u.d. of x be parking spaces at UNR.Let the u.d. of x be parking spaces at UNR. The universal quantification of P(x),The universal quantification of P(x),  x P(x), is the proposition:  x P(x), is the proposition: °“All parking spaces at UNR are full.” or °“Every parking space at UNR is full.” or °“For each parking space at UNR, that space is full.”

10 The Universal Quantifier  To prove that a statement of the formTo prove that a statement of the form  x P(x) is false, it suffices to find a counterexample (i.e., one value of x in the universe of discourse such that P(x) is false)  x P(x) is false, it suffices to find a counterexample (i.e., one value of x in the universe of discourse such that P(x) is false) °e.g., P(x) is the predicate “x>0”

11 Existential Quantifier  Example Let P(x) be the predicate “x is full.”Let P(x) be the predicate “x is full.” Let the u.d. of x be parking spaces at UNR.Let the u.d. of x be parking spaces at UNR. The universal quantification of P(x),The universal quantification of P(x),  x P(x), is the proposition:  x P(x), is the proposition: °“Some parking space at UNR is full.” or °“There is a parking space at UNR that is full.” or °“At least one parking space at UNR is full.”

12 Quantifier Equivalence Laws Definitions of quantifiers: If u.d.=a,b,c,…  x P(x)  P(a)  P(b)  P(c)  …  x P(x)  P(a)  P(b)  P(c)  …Definitions of quantifiers: If u.d.=a,b,c,…  x P(x)  P(a)  P(b)  P(c)  …  x P(x)  P(a)  P(b)  P(c)  … We can prove the following laws:  x P(x)   x  P(x)  x P(x)   x  P(x)We can prove the following laws:  x P(x)   x  P(x)  x P(x)   x  P(x) Which propositional equivalence laws can be used to prove this?Which propositional equivalence laws can be used to prove this?

13 More Equivalence Laws  x P(x)   x  P(x)  x P(x)   x  P(x)  x P(x)   x  P(x)  x P(x)   x  P(x)  x  y P(x,y)   y  x P(x,y)  x  y P(x,y)   y  x P(x,y)  x  y P(x,y)   y  x P(x,y)  x  y P(x,y)   y  x P(x,y)  x (P(x)  Q(x))  (  x P(x))  (  x Q(x))  x (P(x)  Q(x))  (  x P(x))  (  x Q(x))  x (P(x)  Q(x))  (  x P(x))  (  x Q(x))  x (P(x)  Q(x))  (  x P(x))  (  x Q(x))

14 Scope of Quantifiers The part of a logical expression to which a quantifier is applied is called the scope of this quantifier.The part of a logical expression to which a quantifier is applied is called the scope of this quantifier. e.g., (  x P(x) )  (  y Q(y) ) e.g., (  x P(x) )  (  x Q(x) ) e.g., (  x P(x) )  (  x Q(x) )

15 Free and Bound Variables An expression like P(x) is said to have a free variable x (meaning x is undefined).An expression like P(x) is said to have a free variable x (meaning x is undefined). A quantifier (either  or  ) operates on an expression having one or more free variables, and binds one or more of those variables, to produce an expression having one or more bound variables.A quantifier (either  or  ) operates on an expression having one or more free variables, and binds one or more of those variables, to produce an expression having one or more bound variables.

16 Examples of Binding P(x,y) has 2 free variables, x and y.P(x,y) has 2 free variables, x and y.  x P(x,y) has 1 free variable, and one bound variable. [which is which?]  x P(x,y) has 1 free variable, and one bound variable. [which is which?] “P(x), where x=3” is another way to bind x.“P(x), where x=3” is another way to bind x. An expression with zero free variables is an actual proposition.An expression with zero free variables is an actual proposition. An expression with one or more free variables is still only a predicate:  x P(x,y)An expression with one or more free variables is still only a predicate:  x P(x,y)

17 More to Know About Binding  x  x P(x) - x is not a free variable in  x P(x), therefore the  x binding isn’t used.  x  x P(x) - x is not a free variable in  x P(x), therefore the  x binding isn’t used. (  x P(x) )  Q(x) - The variable x is outside of the scope of the  x quantifier, and is therefore free. Not a proposition.(  x P(x) )  Q(x) - The variable x is outside of the scope of the  x quantifier, and is therefore free. Not a proposition. (  x P(x) )  (  x Q(x) ) - Legal because there are 2 different x’s!(  x P(x) )  (  x Q(x) ) - Legal because there are 2 different x’s! Quantifiers bind as loosely as needed: parenthesize  x P(x)  Q(x)Quantifiers bind as loosely as needed: parenthesize  x P(x)  Q(x) ( )

18 Nested Quantifiers Exist within the scope of other quantifiers Let the u.d. of x & y be people.Let the u.d. of x & y be people. Let P(x,y)=“x likes y” (a predicate with 2 f.v.’s)Let P(x,y)=“x likes y” (a predicate with 2 f.v.’s) Then  y P(x,y) = “There is someone whom x likes.” (a predicate with 1 free variable, x)Then  y P(x,y) = “There is someone whom x likes.” (a predicate with 1 free variable, x) Then  x (  y P(x,y)) = “Everyone has someone whom they like.” (A __________ with ___ free variables.)Then  x (  y P(x,y)) = “Everyone has someone whom they like.” (A __________ with ___ free variables.)

19 Order of Quantifiers Is Important!! If P(x,y)=“x relies upon y,” express the following in unambiguous English:  x(  y P(x,y))=  y(  x P(x,y))=  x(  y P(x,y))=  y(  x P(x,y))=  x(  y P(x,y))= Everyone has someone to rely on. There’s a poor overworked soul whom everyone relies upon (including himself)! There’s some needy person who relies upon everybody (including himself). Everyone has someone who relies upon them. Everyone relies upon everybody, (including themselves)!

20 Natural language is ambiguous! “Everybody likes somebody.”“Everybody likes somebody.” °For everybody, there is somebody they like,  x  y Likes(x,y)  x  y Likes(x,y) °or, there is somebody (a popular person) whom everyone likes?  y  x Likes(x,y)  y  x Likes(x,y) [Probably more likely.]

21 Notational Conventions Consecutive quantifiers of the same type can be combined:  x  y  z P(x,y,z)   x,y,z P(x,y,z) or even  xyz P(x,y,z)Consecutive quantifiers of the same type can be combined:  x  y  z P(x,y,z)   x,y,z P(x,y,z) or even  xyz P(x,y,z) Sometimes the universe of discourse is restricted within the quantification, e.g.,Sometimes the universe of discourse is restricted within the quantification, e.g., °  x>0 P(x) is shorthand for “For all x that are greater than zero, P(x).” °  x>0 P(x) is shorthand for “There is an x greater than zero such that P(x).”

22 Defining New Quantifiers As per their name, quantifiers can be used to express that a predicate is true of any given quantity (number) of objects. Define  !x P(x) to mean “P(x) is true of exactly one x in the universe of discourse.”  !x P(x)   x ( P(x)   y ( P(y)  y  x ) ) “There is an x such that P(x), where there is no y such that P(y) and y is other than x.”

23 Some Number Theory Examples Let u.d. = the natural numbers 0, 1, 2, …Let u.d. = the natural numbers 0, 1, 2, … “A number x is even, E(x), if and only if it is equal to 2 times some other number.”  x (E(x)  (  y x=2y))“A number x is even, E(x), if and only if it is equal to 2 times some other number.”  x (E(x)  (  y x=2y)) “A number is prime, P(x), iff it isn’t the product of two non-unity numbers.”  x ( P(x)  (  y,z x=yz  y  1  z  1 ) )“A number is prime, P(x), iff it isn’t the product of two non-unity numbers.”  x ( P(x)  (  y,z x=yz  y  1  z  1 ) )

24 Calculus Example Precisely defining the concept of a limit using quantifiers:Precisely defining the concept of a limit using quantifiers: