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

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

Thinking of Nested Quantification

Proposi'onal Logic Not Enough

Section Summary. Section 1.5 9/9/2014

Chapter 1, Part II: Predicate Logic

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

Propositional Logic Not Enough

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

Discrete Structures Lecture 5

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

Logical Operators. Conjunction Disjunction Negation Exclusive Or Implication Biconditional

Predicate Calculus lecture 1

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

ICS141: Discrete Mathematics for Computer Science I

Discrete Mathematics and Its Applications

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

Introduction to Sets and Logic (MATH 1190)

Lecture 4. Predicate logic

First order Logic ( Predicate Logic) and Methods of Proof

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

Logic, Sets, and Proofs

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

Predicate Calculus - Syntax

Discrete Structures for Computer Science

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

Tutorial on Axiomatic Set Theory. Javier R. Movellan

Announcements CompSci 102 Discrete Math for Computer Science

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

Predicates, Quantifiers and Nested Quantifiers

Math.3336: Discrete Mathematics. Nested Quantifiers

Section 1.1 Propositions

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

Predicate Logic & Quantification

Solutions to Sample Problems for Midterm

Discrete Structures Lecture Predicates and Quantifiers

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

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

LING 501, Fall 2004: Quantification

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

Introduction to Decision Sciences Lecture 2

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

Supplementary exercises in propositional logic

CPSC 121: Models of Computation

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

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

Introduction to first-order logic:

Mat 243 Exam 1 Review

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

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

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

1.1 Language and Logic

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.

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

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

CS Module 1. Ben Harsha Apr 12, 2017

Predicates and Quantifiers. CS 231 Dianna Xu

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

LECTURE NOTES DISCRETE MATHEMATICS. Eusebius Doedel

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

Lecture Predicates and Quantifiers 1.5 Nested Quantifiers

Automated Reasoning Lecture 5: First-Order Logic

Logic and Proof. Aiichiro Nakano

3. Only sequences that were formed by using finitely many applications of rules 1 and 2, are propositional formulas.

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

CS156: The Calculus of Computation Zohar Manna Winter 2010

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

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

Mathematical Preliminaries. Sipser pages 1-28

EECS 1028 M: Discrete Mathematics for Engineers

Why Learning Logic? Logic. Propositional Logic. Compound Propositions

1.1 Language and Logic

3 The Semantics of the Propositional Calculus

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

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

Predicate Logic. Andreas Klappenecker

Lecture 3 : Predicates and Sets DRAFT

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

Supplementary Logic Notes CSE 321 Winter 2009

Logical Structures in Natural Language: First order Logic (FoL)

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

With Question/Answer Animations. Chapter 2

Propositional and First-Order Logic

1.3 Predicates and Quantifiers

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

HOW TO CREATE A PROOF. Writing proofs is typically not a straightforward, algorithmic process such as calculating

First Order Logic (FOL) 1 znj/dm2017

MAT 243 Test 1 SOLUTIONS, FORM A

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

Discrete Mathematical Structures. Chapter 1 The Foundation: Logic

CA320 - Computability & Complexity

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

Introduction to Predicate Logic Part 1. Professor Anita Wasilewska Lecture Notes (1)

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

First-Order Logic (FOL)

Chapter 1 Elementary Logic

Predicate Logic. Predicates. Math 173 February 9, 2010

THE LOGIC OF QUANTIFIED STATEMENTS. Predicates and Quantified Statements I. Predicates and Quantified Statements I CHAPTER 3 SECTION 3.

Part I: Propositional Calculus

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

Comp487/587 - Boolean Formulas

Transcription:

FOL Con(nued Review Variable Names 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, (exctly when x=y=1) But multiple occurrences of the same variable governed by one quantifier must be the same e.g. over the domain of integers x. (x+x=3) is False The rules of nesting multiple quantifiers with the same name are tricky. Avoid this x ( x Q(x) y P(x,y) ) Write instead the following, where variable x is renamed x ( z Q(z) y P(x,y) ) Some Ques(ons about Quan(fiers (but answers are not proven just stated here!)! Can you switch the order of quantifiers??! yes! The left and the right side will always have the same truth value. The order in which x and y are picked does not matter.?! No! The left and the right side may have different truth values for some propositional functions for P. Try U={a,b}, with P=likes, and facts {likes(a,b), likes(b,a)}. Then LHS is true, RHS is false NOTE: when something is not true, find smallest universe in which it is false, and fewest facts which provide a counter-example.

Some Ques(ons about Quan(fiers (but answers are not proven just stated!)! Can you distribute quantifiers over logical connectives?! Is this a valid equivalence? Yes! The left and the right side will always have the same truth value no matter what propositional functions are denoted by P(x) and Q(x).! Is this a valid equivalence? No! The left and the right side may have different truth values. Pick x = 1 for P(x) and x = 5 for Q(x) with U={1,5}. Then the left side is false, (when x is 5), but the rhs is always true bec. x(x=1) is False This is why we need rules of inference/equivalence dealing with quantifiers! 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 Transla(ng Mathema(cal Statements 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 (Aside: why having small domains is not good) Example : Different translation of The sum of two positive integers is always positive 1. Rewrite the statement to make the implied quantifiers and domains explicit: For every two positive integers, if they are both positive, then the sum of these integers is positive. 2. Introduce the variables x and y, and specify the domain (positive integers), to obtain: For all positive integers x and y, x + y is positive. 3. The result is: x y (x + y > 0) where the domain consists of all positive integers But now note that the constant 0 appearing in the formula does not belong to the domain! (This is illegal in standard logic, where all constants must belong to U)

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 Took(w,f) be w has taken f and FlightOf(f,a) be f is a flight of 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: Equivalences in Predicate Logic w.{ woman(w) a. [airline(a) f.(?light(f) Took (w,f) FlightOf (f,a))]} Note that the formula w. a. f.(took(w,f) FlightOf(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 FlightOf(_,a) might only be true of airline a, FLightOf(,a) will be false when a is a woman!!! Equivalences in Predicate Logic! Statements involving predicates and quantifiers are logically equivalent if and only if they have the same truth value! for every predicate substituted into these statements and! for every universe! Example: x S(x) x S(x)! The proof rules of equivalence require entire subformulas to be substituted with equivalent ones. So even if x S(x) y S(y) you cannot take just x S(x) from x ( S(x) Q(x) ) and replace it by the equivalent y S(y). The resulting formula y ( S(y) \/ Q(x) ) would NOT be equivalent!!! Quan(fiers as Conjunc(ons and Disjunc(ons! If the domain is finite, a universally quantified proposition is equivalent to a conjunction of propositions without quantifiers and an existentially quantified proposition is equivalent to a disjunction of propositions without quantifiers.! If U = {1,2,3}! Even if the domains are infinite, you can still think of the quantifiers in this fashion, but the equivalent expressions without quantifiers will be infinitely long.! What if the domain is empty? NOT ALLOWED!! But the following is legal: suppose predicate F(x) is always false: x. F(x) P(x) x. False P(x) True x. F(x) P(x) x. False P(x) False

Nega(ng Quan(fied Expressions 1. Consider x Smart(x) Every student is smart. Here Smart(x) is x smart and the domain is students 2. Negating the original statement gives It is not the case that every student is smart. This implies that There is a student in your class who is not smart.! And conversely: from 2. one gets 1. x Smart(x) and x Smart(x) are equivalent Nega(ng Quan(fied Expressions (2) 1. Consider x Smart(x) Some student is smart. Here Smart(x) is x smart and the domain is students 2. Negating the original statement gives It is not the case that some student is smart. This implies that Every student is not smart.! And conversely: from 2. one gets 1. x Smart(x) and x Smart(x) are equivalent De Morgan s Laws for Quan(fiers! The rules for negating quantifiers, according to Rosen are:! These are important. You will use these.! (One of the rules is redundant!!) Nega(ng Nested Quan(fiers Example 1: Consider the logical expression w a f (P(w,f ) Q(f,a)) Use De Morgan s Laws to move the negation as far inwards as possible. (on board) 1. w a f (P(w,f ) Q(f,a)) 2. w a f (P(w,f ) Q(f,a)) by De Morgan s for 3. w a f (P(w,f ) Q(f,a)) by De Morgan s for 4. w a f (P(w,f ) Q(f,a)) by De Morgan s for 5. w a f ( P(w,f ) Q(f,a)) by De Morgan s for.

Equivalences in First Order Logic The rules of equivalence for FOL consist of the rules of equivalence for propositional formulas + the 2 de Morgan rules for quantifiers Which rule you can apply to a (sub) formula depends on which connective is the upper-most connective:! in f (P(f ) Q(3)), the upper-most connective is! in f P(f ) Q(3), the upper-most connective is (remember that quantiziers have highest precedence so this formula was really ( f.p(f )) Q(3). When in doubt ask or parenthesize to disambiguate.)! in f.(p(f ) Q(3)) the upper-most-connective is Note that in all of these, you could have applied the equivalence Q(3) Q(3) inside the formulas, if you wanted, because equivalences can be applied to subformulas. [Remember that rules of inference, later, must match patterns against entire lines of a proof.] (Excercise for you: nega(ng English Part 1: Use quantifiers to express the statement that There does not exist a woman who has taken a flight on every airline in the world. w.{woman(w) a.[airline(a) [formula above ] f.(?light(f) P(w,f) Q(f,a))]} Part 2: Now use De Morgan s Laws to move the negation as far inwards as possible. [do this yourself, changing A B to A B ] Part 3: Translate the result back into English? For every woman there is an airline such that for all flights, this woman has not taken that flight or that flight is not on this airline