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

Similar documents
Thinking of Nested Quantification

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

Proposi'onal Logic Not Enough

Chapter 1, Part II: Predicate Logic

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

Propositional Logic Not Enough

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

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

Section Summary. Section 1.5 9/9/2014

Logical Operators. Conjunction Disjunction Negation Exclusive Or Implication Biconditional

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

W3203 Discrete Mathema1cs. Logic and Proofs. Spring 2015 Instructor: Ilia Vovsha. hcp://

ICS141: Discrete Mathematics for Computer Science I

Announcements CompSci 102 Discrete Math for Computer Science

Introduction to Sets and Logic (MATH 1190)

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

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

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

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

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

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

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

1.3 Predicates and Quantifiers

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

Discrete Structures for Computer Science

First order Logic ( Predicate Logic) and Methods of Proof

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

Lecture Predicates and Quantifiers 1.5 Nested Quantifiers

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

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

Predicates and Quantifiers. CS 231 Dianna Xu

Predicate Logic & Quantification

Discrete Mathematics and Its Applications

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

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

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

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

Logic. Propositional Logic: Syntax. Wffs

Discrete Structures Lecture 5

Predicate Calculus lecture 1

Mat 243 Exam 1 Review

Review: Potential stumbling blocks

Math.3336: Discrete Mathematics. Nested Quantifiers

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

Lecture 4. Predicate logic

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

Introduction. Predicates and Quantifiers. Discrete Mathematics Andrei Bulatov

Predicate Calculus - Syntax

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

Announcement. Homework 1

DISCRETE MATHEMATICS BA202

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

Lecture 3 : Predicates and Sets DRAFT

Introduction to first-order logic:

Predicates, Quantifiers and Nested Quantifiers

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

Logic and Modelling. Introduction to Predicate Logic. Jörg Endrullis. VU University Amsterdam

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

Discrete Mathematics & Mathematical Reasoning Predicates, Quantifiers and Proof Techniques

Topic #3 Predicate Logic. Predicate Logic

Why Learning Logic? Logic. Propositional Logic. Compound Propositions

CSCI-2200 FOUNDATIONS OF COMPUTER SCIENCE

2-4: The Use of Quantifiers

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

Section 2.1: Introduction to the Logic of Quantified Statements

Rosen, Discrete Mathematics and Its Applications, 6th edition Extra Examples

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

1 Predicates and Quantifiers

Logic. Propositional Logic: Syntax

Logic and Propositional Calculus

Propositional and First-Order Logic

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

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

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

ICS141: Discrete Mathematics for Computer Science I

Quantifiers. P. Danziger

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

Formal (Natural) Deduction for Predicate Calculus

Test 1 Solutions(COT3100) (1) Prove that the following Absorption Law is correct. I.e, prove this is a tautology:

ECOM Discrete Mathematics

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

Predicate Logic Quantifier Rules

Proving Arguments Valid in Predicate Calculus

LIN1032 Formal Foundations for Linguistics

MAT2345 Discrete Math

Rules Build Arguments Rules Building Arguments

First order logic. Example The deduction of statements: This reasoning is intuitively correct. Every man is mortal. Since Ade is a man, he is mortal.

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

Predicate Logic. Andreas Klappenecker

Propositional Logic: Syntax

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).

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

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

Predicate Logic: Introduction and Translations

Logic and Propositional Calculus

Proof. Theorems. Theorems. Example. Example. Example. Part 4. The Big Bang Theory

Logic and Proof. Aiichiro Nakano

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

WUCT121. Discrete Mathematics. Logic. Tutorial Exercises

Discrete Mathematics and Probability Theory Spring 2014 Anant Sahai Note 1

Transcription:

Sec$on Summary (K. Rosen notes for Ch. 1.4, 1.5 corrected and extended by A.Borgida)! Predicates! Variables! Quantifiers! Universal Quantifier! Existential Quantifier! Negating Quantifiers! De Morgan s Laws for Quantifiers! Translating English to Logic Proposi$onal Logic Not Enough! If we have: All men are mortal. Socrates is a man.! Does it follow that Socrates is mortal?! Can t be represented in propositional logic. Need a language that talks about objects, their properties, and their relations.! Later we ll see how to draw inferences. Introducing Predicate Logic! Predicate logic uses the following new features:! Variables: x, y, z! Constants: 1, 67, Amanda, Paris, cs205, a, b,...! Predicates: P(_), M(_,_), likes(, ), getsgradein(_,_,_)! Quantifiers (to be covered in a few slides):! Atom is a generalization of proposition.! consists of a predicate with arguments that are variables or constants e.g., P(x), likes(anna,aerosmith)! Variables can be replaced by constants in formulas

Proposi$onal Func$ons! Atoms (called propositional functions in book when all their arguments are variables) become propositions (and have truth values) when their variables are each replaced by a value from the domain (or bound by a quantifier, as we will see later).! The statement P(b) is said to be the value of the propositional function P at b.! For example, let P(x) denote x > 0 and the domain be the integers. Then: P(-3) is false. P(0) is false. P(3) is true.! Often the domain is denoted by U. So in this example U is the integers. Examples! Let x + y = z be denoted by R(x, y, z) and U (for all three variables) be the integers. Find these truth values: R(2,-1,5) Answ: F R(3,4,7) Answ: T R(x, 3, z) Answ: Not a Proposition Compound Expressions! Connectives from propositional logic carry over to predicate logic.! If P(x) denotes x > 0, U= integers, find these truth values: P(3) P(-1) T P(3) P(-1) F Universal Quan$fier! x P(x) is read as For all x, P(x) or For every x, P(x)! If P(x) is x > 0 and U is the integers, then x P(x) is false. /* 0>0 is false */! If P(x) is x > 0 and U is the positive integers, then xp(x) is true.! If P(x) is x is even and U is the integers, then x P(x) is false. /* x=3 is not even */

Existen$al Quan$fier! x P(x) is read as For some x, P(x), or as There is an x such that P(x), or For at least one x, P(x). 1. If P(x) denotes x > 0 and U is the integers, then x P(x) is true. It is also true if U is the positive integers. 2. If P(x) denotes x < 0 and U is the positive integers, then x P(x) is false. 3. If P(x) denotes x is even and U is the integers, then x P(x) is true. Thinking about Quan$fiers! When U is finite, think of quantification as looping through the elements of U:! To evaluate x P(x) loop through all x in the domain.! If at every step P(x) is true, then x P(x) is true.! If at a step P(x) is false, then x P(x) is false and the loop terminates.! To evaluate x P(x) loop through all x in the domain.! If at some step, P(x) is true, then x P(x) is true and the loop terminates.! If the loop ends without finding an x for which P(x) is true, then x P(x) is false. Precedence of Quan$fiers! The quantifiers and have higher precedence than all the logical operators.! For example, x P(x) Q(x) means ( x P(x)) Q(x)! x (P(x) Q(x)) means something different! Beware: often people write x P(x) Q(x) when they mean x (P(x) Q(x)). Transla$ng English to Logic Example 1: Translate the following sentence into predicate logic: Every student in 205 has taken a course in Java. First decide on the domain U. Solution 1: If U is all students in 205, define a propositional function J(x) denoting x has taken a course in Java and translate as x J(x). Solution 2: But if U is all people, also define a propositional function S(x) denoting x is a student in 205 and translate as x (S(x) J(x)). In general a solution like 2 is preferred, because it is independent of the assumption of domain x (S(x) J(x)) is not correct. (What does it mean? Consider the case when there are people who are not students in 205)

Transla$ng English to Logic Example 2: Translate the following sentence into predicate logic: Some student in 205 has taken a course in Java. First decide on the domain U. Solution 1: If U is all students in 205, translate it as x J(x) Solution 2: But if U is all people, then, as before, let propositional function S(x) denote x is a student in 205 and translate as x (S(x) J(x)) x (S(x) J(x)) is not correct. (What does it mean? Consider the case when S is false for every x.) Transla$ng English to Logic (more examples) 1. Some student in this class has visited Mexico. Let M(x) denote x has visited Mexico and S(x) denote x is a student in this class, and U be all people. x (S(x) M(x)) 2. Every student in this class has visited Canada or Mexico. Add C(x) denoting x has visited Canada. x (S(x) (M(x) C(x))) Lewis Carroll Example! The first two are called premises and the third is called the conclusion. 1. All lions are fierce. 2. Some lions do not drink coffee. 3. Some fierce creatures do not drink coffee. Here is one way to translate these statements to predicate logic. Let L(x), F(x), and C(x) be the propositional functions x is a lion, x is fierce, and x drinks coffee, respectively. Lewis Carroll Example! The first two are called premises and the third is called the conclusion. 1. All lions are fierce. 2. Some lions do not drink coffee. 3. Some fierce creatures do not drink coffee.! Here is one way to translate these statements to predicate logic. Let L(x), F(x), and C(x) be the propositional functions x is a lion, x is fierce, and x drinks coffee, respectively. 1. x (L(x) F(x)) 2. x (L(x) C(x)) 3. x (F(x) C(x))! Later we will see how to prove that the conclusion follows from the premises.

Nested Quan$fiers! Nested quantifiers are often necessary to express the meaning of sentences in English as well as important concepts in computer science and mathematics. Example: Every real number has an additive inverse is x y(x + y = 0) where the universe of x and y are the real numbers.! [We can also think of nested propositional functions: x y(x + y = 0) can be viewed as x Q(x) where Q(x) is y P(x, y) where P(x, y) is (x + y = 0) but in my opinion this just confuses things. ] Order of Quan$fiers 1. Let P(x,y) be the statement x + y = y + x. Assume that U is the real numbers. Then x yp(x,y) and y xp(x,y) have the same truth value. 2. Let Q(x,y) be the statement x + y = 0. Assume that U is the real numbers. Then x yp(x,y) is true, but y xp(x,y) is false. 3. Note that just because variables have different names it does not mean they have different values e.g. over the domain of positive integers x. y. (x+y=2) is True, (when x=y=1) Ques$ons on Order of Quan$fiers Example: Let U be the real numbers, Define P(x,y) : x / y = 1 What is the truth value of the following: 1. x yp(x,y) 2. x yp(x,y) 3. x y P(x,y) 4. x y P(x,y) exercise: repeat the above with P(x,y): x * y= 0 Beware of universe issues Every student takes some course! If predicate takes(x,y) uses universe students for x but courses for y, then the real universe for the statement x y takes(x,y) is the union of students and courses! (And this statement is likely to be false according to the intuitive meaning of takes since courses do not take students or courses.)! So if you wanted to state that every student takes some course you would need to qualify the variables: x.( student(x) -> y (course(y) /\ takes(x,y) ) )! In general, Forall is used as an implication with a domain guard. Exists is used as a conjunction with a domain guard

Quan$fica$ons of Two Variables Statement When True? When False P(x,y) is true for every pair x,y. For every x there is a y for which P(x,y) is true. There is an x for which P(x,y) is true for every y. There is a pair x, y for which P(x,y) is true. There is a pair x, y for which P(x,y) is false. There is an x such that P(x,y) is false for every y. For every x there is a y for which P(x,y) is false. P(x,y) is false for every pair x,y Transla$ng Nested Quan$fiers into English Given C(x) is x has a computer, and F(x,y) is x and y are friends, and the domain for both x and y consists of all students in your school Example 1: Translate the statement x (C(x ) y (F(x, y) C(y) )). Example 2: Translate the statement x y z ((F(x, y) F(x,z) (y z)) F(y,z)) Transla$ng Nested Quan$fiers into English Given C(x) is x has a computer, and F(x,y) is x and y are friends, and the domain for both x and y consists of all students in your school Example 1: Translate the statement x (C(x ) y (F(x, y) C(y) )). Every student in your school has a computer or has a friend who has a computer. Example 2: Translate the statement x y z ((F(x, y) F(x,z) (y z)) F(y,z)) Some student none of whose friends are also friends with each other. Transla$ng Mathema$cal Statements into Predicate Logic Example : Translate The sum of two positive integers is always positive into a logical expression.

Transla$ng Mathema$cal Statements into Predicate Logic Example : Translate The sum of two positive integers is always positive into a logical expression. 1. Rewrite the statement to make the implied quantifiers and domains explicit: For every two integers, if these integers are both positive, then the sum of these integers is positive. 2. Introduce the variables x and y, and specify the domain (integers), to obtain: For all positive integers x and y, x + y is positive. 3. The result is: x y ((x > 0) (y > 0) (x + y > 0)) where the domain consists of all integers Transla$ng English into FOL Example: Use quantifiers to express the statement There is a woman who has taken a flight on every airline in the world. 1. Let P(w,f) be w has taken f and Q(f,a) be f is a flight on a. Transla$ng English into FOL Example: Use quantifiers to express the statement There is a woman who has taken a flight on every airline in the world. 1. Let P(w,f) be w has taken f and Q(f,a) be f is a flight on a. 2. The domain of w is all women, the domain of f is all flights, and the domain of a is all airlines. (This means that the total domain is the union of these!) 3. Then the statement can be expressed as: w.{woman(w) a.[airline(a) -> f.(ulight(f) P(w,f) Q(f,a))]} Note that the formula w. a. f.(p(w,f) Q(f,a)) reads there is a w such that for all a (including women, flights, airlines) there is f such that... f is a flight on a. Since a can be other things than airlines in the quantification, yet Q(_,a) is only true of airline a, Q(,a) will be false when a is a woman!!! Transla$on from English Choose the obvious predicates and express in predicate logic. (Universe is people) Example 1: Brothers are siblings. x y (B(x,y) S(x,y)) Example 2: Siblinghood is symmetric. x y (S(x,y) S(y,x)) Example 3: Everybody loves somebody. x y L(x,y) Example 4: There is someone who is loved by everyone. y x L(x,y) Example 5: There is someone who loves someone. x y L(x,y) Example 6: Everyone loves himself x L(x,x) Note that not all sentences one expresses are always true (theorems/tautologies), or even contingent.