Lecture 4. Predicate logic

Similar documents
CS 1571 Introduction to AI Lecture 14. First-order logic. CS 1571 Intro to AI. Midterm

Logical Operators. Conjunction Disjunction Negation Exclusive Or Implication Biconditional

Section Summary. Section 1.5 9/9/2014

Review: Potential stumbling blocks

Predicates and Quantifiers. Nested Quantifiers Discrete Mathematic. Chapter 1: Logic and Proof

Thinking of Nested Quantification

Math.3336: Discrete Mathematics. Nested Quantifiers

Today s Lecture. ICS 6B Boolean Algebra & Logic. Predicates. Chapter 1: Section 1.3. Propositions. For Example. Socrates is Mortal

Mat 243 Exam 1 Review

Discrete Structures for Computer Science

Predicate Logic & Quantification

Section Summary. Predicate logic Quantifiers. Negating Quantifiers. Translating English to Logic. Universal Quantifier Existential Quantifier

ITS336 Lecture 6 First-Order Logic

CSI30. Chapter 1. The Foundations: Logic and Proofs Nested Quantifiers

Predicate Calculus lecture 1

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

Introduction to Sets and Logic (MATH 1190)

ICS141: Discrete Mathematics for Computer Science I

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

Propositional Logic Not Enough

Introduction Propositional Logic

Section Summary. Predicates Variables Quantifiers. Negating Quantifiers. Translating English to Logic Logic Programming (optional)

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

Nested Quantifiers. Predicates and. Quantifiers. Agenda. Limitation of Propositional Logic. Try to represent them using propositional.

Discrete Mathematics and Its Applications

Inference in first-order logic

Discrete Structures Lecture 5

1.3 Predicates and Quantifiers

ICS141: Discrete Mathematics for Computer Science I

Topic #3 Predicate Logic. Predicate Logic

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

Recall that the expression x > 3 is not a proposition. Why?

2/18/14. What is logic? Proposi0onal Logic. Logic? Propositional Logic, Truth Tables, and Predicate Logic (Rosen, Sections 1.1, 1.2, 1.

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

Variable Names. Some Ques(ons about Quan(fiers (but answers are not proven just stated here!) x ( z Q(z) y P(x,y) )

Predicate in English. Predicates and Quantifiers. Predicate in Logic. Propositional Functions: Prelude. Propositional Function

Section Summary. Predicate logic Quantifiers. Negating Quantifiers. Translating English to Logic. Universal Quantifier Existential Quantifier

First order Logic ( Predicate Logic) and Methods of Proof

Propositional and First-Order Logic

CS 220: Discrete Structures and their Applications. Predicate Logic Section in zybooks

Transparencies to accompany Rosen, Discrete Mathematics and Its Applications Section 1.3. Section 1.3 Predicates and Quantifiers

Announcements. CS311H: Discrete Mathematics. Introduction to First-Order Logic. A Motivating Example. Why First-Order Logic?

Introduction to first-order logic:

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

Chapter 2: The Logic of Quantified Statements. January 22, 2010

Chapter 1, Part II: Predicate Logic

Lecture 3 : Predicates and Sets DRAFT

Predicates, Quantifiers and Nested Quantifiers

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

LIN1032 Formal Foundations for Linguistics

Logic and Proof. Aiichiro Nakano

Quantifiers Here is a (true) statement about real numbers: Every real number is either rational or irrational.

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

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

Logical equivalences 12/8/2015. S T: Two statements S and T involving predicates and quantifiers are logically equivalent

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

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

For all For every For each For any There exists at least one There exists There is Some

Predicate Calculus. Lila Kari. University of Waterloo. Predicate Calculus CS245, Logic and Computation 1 / 59

Logic III. Introduction to Artificial Intelligence CSE 150

Lecture Predicates and Quantifiers 1.5 Nested Quantifiers

Negations of Quantifiers

WUCT121. Discrete Mathematics. Logic. Tutorial Exercises

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

Introduction to Decision Sciences Lecture 2

Predicates and Quantifiers. CS 231 Dianna Xu

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

MATH 22 INFERENCE & QUANTIFICATION. Lecture F: 9/18/2003

Discrete Structures Lecture Predicates and Quantifiers

1 Predicates and Quantifiers

Introduction. Predicates and Quantifiers. Discrete Mathematics Andrei Bulatov

Announcements CompSci 102 Discrete Math for Computer Science

Inference in first-order logic

CSE 20 Discrete Math. Algebraic Rules for Propositional Formulas. Summer, July 11 (Day 2) Number Systems/Computer Arithmetic Predicate Logic

A. Propositional Logic

Predicate Calculus - Semantics 1/4

Section 2.1: Introduction to the Logic of Quantified Statements

Predicate Logic: Introduction and Translations

III. Elementary Logic

Logic. Propositional Logic: Syntax. Wffs

Math Fundamentals of Higher Math

Announcement. Homework 1

15414/614 Optional Lecture 3: Predicate Logic

Proposi'onal Logic Not Enough

A Little Deductive Logic

Knowledge Representation. Propositional logic

Predicate Calculus - Syntax

Computer Science 280 Spring 2002 Homework 2 Solutions by Omar Nayeem

A Little Deductive Logic

Reasoning. Inference. Knowledge Representation 4/6/2018. User

Before you get started, make sure you ve read Chapter 1, which sets the tone for the work we will begin doing here.

Mathematical Logic Part Three

CS0441 Discrete Structures Recitation 3. Xiang Xiao

CSC 125 :: Final Exam December 14, 2011

Proving logical equivalencies (1.3)

Predicate Logic: Sematics Part 1

Discrete Mathematics and Probability Theory Spring 2014 Anant Sahai Note 1

MAT2345 Discrete Math

THE LOGIC OF QUANTIFIED STATEMENTS. Statements with Multiple Quantifiers. Statements with Multiple Quantifiers CHAPTER 3 SECTION 3.

Knowledge Representation. Propositional logic.

Transcription:

Lecture 4 Predicate logic Instructor: Kangil Kim (CSE) E-mail: kikim01@konkuk.ac.kr Tel. : 02-450-3493 Room : New Milenium Bldg. 1103 Lab : New Engineering Bldg. 1202 All slides are based on CS441 Discrete Mathematics for Computer Science course of the University of Pittsburgh given and opened by Milos Hauskrecht. We are learning.. Logic - Propositional Logic - Defintion - Operator - Inference - Translation - Predicate Logic - Defintion - Predicate - Quantifier - Translation - Operator - Negation - Inference 1

Propositional logic: limitations Propositional logic: the world is described in terms of elementary propositions and their logical combinations Elementary statements/propositions: Typically refer to objects, their properties and relations. But these are not explicitly represented in the propositional logic Example: John is a UPitt student. John object a Upitt student a property Objects and properties are hidden in the statement, it is not possible to reason about them Propositional logic: limitations (1) Statements that hold for many objects must be enumerated Example: John is a CS UPitt graduate John has passed cs441 Ann is a CS Upitt graduate Ann has passed cs441 Ken is a CS Upitt graduate Ken has passed cs441 Solution: make statements with variables x is a CS UPitt graduate x has passed cs441 2

Propositional logic: limitations (2) Statements that define the property of the group of objects Example: All new cars must be registered. Some of the CS graduates graduate with honor. Solution: make statements with quantifiers Universal quantifier the property is satisfied by all members of the group Existential quantifier at least one member of the group satisfy the property Predicate logic Remedies the limitations of the propositional logic Explicitly models objects and their properties Allows to make statements with variables and quantify them Predicate logic: Constant models a specific object Examples: John, France, 7 Variable represents object of specific type (defined by the universe of discourse) Examples: x, y (universe of discourse can be people, students, numbers) Predicate - over one, two or many variables or constants. Represents properties or relations among objects Examples: Red(car23), student(x), married(john,ann) 3

Predicates Predicates represent properties or relations among objects A predicate P(x) assigns a value true or false to each x depending on whether the property holds or not for x. The assignment is best viewed as a big table with the variable x substituted for objects from the universe of discourse Example: Assume Student(x) where the universe of discourse are people Student(John). T (if John is a student) Student(Ann). T (if Ann is a student) Student(Jane).. F (if Jane is not a student) Predicates Assume a predicate P(x) that represents the statement: x is a prime number Truth values for different x: P(2) T P(3) T P(4) F P(5) T P(6) F All statements P(2), P(3), P(4), P(5), P(6) are propositions But P(x) with variable x is not a proposition 4

Quantified statements Predicate logic lets us to make statements about groups of objects To do this we use special quantified expressions Two types of quantified statements: universal Example: all CS Upitt graduates have to pass cs441 the statement is true for all graduates existential Example: Some CS Upitt students graduate with honor. the statement is true for some people Universal quantifier Quantification converts a propositional function into a proposition by binding a variable to a set of values from the universe of discourse. Example: Let P(x) denote x > x - 1. Assume x are real numbers. Is P(x) a proposition? No. Many possible substitutions. Is x P(x) a proposition? Yes. What is the truth value for x P(x)? True, since P(x) holds for all x. 5

Existential quantifier Quantification converts a propositional function into a proposition by binding a variable to a set of values from the universe of discourse. Example: Let T(x) denote x > 5 and x is from Real numbers. Is T(x) a proposition? No. Is x T(x) a proposition? Yes. What is the truth value for x T(x)? Since 10 > 5 is true. Therefore, x T(x) is true. Summary of quantified statements When x P(x) and x P(x) are true and false? Statement When true? When false? x P(x) P(x) true for all x There is an x where P(x) is false. x P(x) There is some x for which P(x) is true. P(x) is false for all x. Suppose the elements in the universe of discourse can be enumerated as x1, x2,..., xn then: x P(x) is true whenever P(x1) P(x2)... P(xN) is true x P(x) is true whenever P(x1) P(x2)... P(xN) is true. 6

Translation with quantifiers Sentence: All Upitt students are smart. Assume: the domain of discourse of x are Upitt students Translation: x Smart(x) Assume: the universe of discourse are students (all students): x at(x,upitt) Smart(x) Assume: the universe of discourse are people: x student(x) at(x,upitt) Smart(x) Translation with quantifiers Sentence: Someone at CMU is smart. Assume: the domain of discourse are all CMU affiliates Translation: x Smart(x) Assume: the universe of discourse are people: x at(x,cmu) Smart(x) 7

Translation with quantifiers Assume two predicates S(x) and P(x) Universal statements typically tie with implications All S(x) is P(x) x ( S(x) P(x) ) No S(x) is P(x) = All S(x) is not P(x) x( S(x) P(x) ) Existential statements typically tie with conjunctions Some S(x) is P(x)?Why not using implication here? x (S(x) P(x) ) - The predicate logic should maintain Some S(x) is not P(x) the same truth values for each case x (S(x) P(x) ) - Implication can not maintain False case Nested quantifiers More than one quantifier may be necessary to capture the meaning of a statement in the predicate logic. Example: Every real number has its corresponding negative. Translation: Assume: a real number is denoted as x and its negative as y A predicate P(x,y) denotes: x + y =0 Then we can write: x y P(x,y) 8

Nested quantifiers More than one quantifier may be necessary to capture the meaning of a statement in the predicate logic. Example: There is a person who loves everybody. Translation: Assume: Variables x and y denote people A predicate L(x,y) denotes: x loves y Then we can write in the predicate logic: x y L(x,y) Order of quantifiers The order of nested quantifiers matters if quantifiers are of different type x y L(x,y) is not the same as y x L(x,y) Example: Assume L(x,y) denotes x loves y Then: x y L(x,y) Translates to: Everybody loves somebody. And: y x L(x,y) Translates to: There is someone who is loved by everyone. The meaning of the two is different. 9

Order of quantifiers The order of nested quantifiers does not matter if quantifiers are of the same type Example: For all x and y, if x is a parent of y then y is a child of x Assume: Parent(x,y) denotes x is a parent of y Child(x,y) denotes x is a child of y Two equivalent ways to represent the statement: x y Parent(x,y) Child(y,x) y x Parent(x,y) Child(y,x) Translation exercise Suppose: Variables x,y denote people L(x,y) denotes x loves y. Translate: Everybody loves Raymond. Everybody loves somebody. There is somebody whom everybody loves. There is somebody who Raymond doesn't love. There is somebody whom no one loves. 10

Translation exercise Suppose: Variables x,y denote people L(x,y) denotes x loves y. Translate: Everybody loves Raymond. Everybody loves somebody. x L(x,Raymond) x y L(x,y) There is somebody whom everybody loves. y x L(x,y) There is somebody who Raymond doesn't love. y L(Raymond,y) There is somebody whom no one loves. y x L(x,y) Negation of quantifiers English statement: Nothing is perfect. Translation: x Perfect(x) Another way to express the same meaning: Everything... 11

Negation of quantifiers English statement: Nothing is perfect. Translation: x Perfect(x) Another way to express the same meaning: Everything is imperfect. Translation: x Perfect(x) Conclusion: x P (x) is equivalent to x P(x) Negation of quantifiers English statement: It is not the case that all dogs are fleabags. Translation: x Dog(x) Fleabag(x) Another way to express the same meaning: There is a dog that 12

Negation of Quantifiers English statement: It is not the case that all dogs are fleabags. Translation: x Dog(x) Fleabag(x) Another way to express the same meaning: There is a dog that is not a fleabag. Translation: x Dog(x) Fleabag(x) Logically equivalent to: x ( Dog(x) Fleabag(x) ) How to derive it? Conclusion: x P (x) is equivalent to x P(x) Negation of quantified statements (aka DeMorgan Laws for quantifiers) Negation x P(x) x P(x) Equivalent x P(x) x P(x) 13

Negation of quantifiers Example What are the negations of the statements x(x2 > x) and x(x2 = 2)? Example Negation of quantifiers What are the negations of the statements x(x^2 > x) and x(x^2 = 2)? ( x(x^2 > x) x(x^2 = 2)) x(x^2 > x) x(x^2 = 2) by De Morgan's Law x (x^2 > x) x (x^2 = 2) by Negating Quantifier x(x^2 x) x(x^2!= 2) by negating the mathematical relations 14

English statement: Negation of Nested Quantifiers the negation of the statement x y(xy = 1)? Translation: It is not the case that all x satisfies xy =1 for at least one y. Negated 1: At least one x disatisfies xy =1 for at least one y English statement: Negation of Nested Quantifiers the negation of the statement x y(xy = 1)? Translation: It is not the case that all x satisfies xy =1 for at least one y. Negated 1: At least one x disatisfies xy =1 for at least one y Negated 2: All x disatisfies xy =1 for all y 15

16 English statement: Negation of Nested Quantifiers the negation of the statement x y(xy = 1)? Translation: It is not the case that all x satisfies xy =1 for at least one y. Negated 1: At least one x disatisfies xy =1 for at least one y Negated 2: All x disatisfies xy =1 for all y Negated 3: At least one x disatisfies xy =1 for all y Negation of Nested Quantifiers

Negation of Nested Quantifiers the negation of the statement x y(xy = 1)? Translation: It is not the case that all x satisfies xy =1 for at least one y. Negated 1: At least one x disatisfies xy =1 for at least one y Negated 2: All x disatisfies xy =1 for all y Negated 3: At least one x disatisfies xy =1 for all y Negation of Nested Quantifiers General Rule of Negating Predicate Logic Apply negation from the starting quantifier to the predicate sequentially. ( x y(xy = 1)) x y(xy = 1) x y(xy = 1) x y (xy = 1) x y xy!= 1 17