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

Similar documents
CSL105: Discrete Mathematical Structures. Ragesh Jaiswal, CSE, IIT Delhi

Section 2.4: Arguments with Quantified Statements

CPSC 121: Models of Computation. Module 5: Predicate Logic

CPSC 121 Midterm 2 Friday November 13th, 2015

Section 2.2: Introduction to the Logic of Quantified Statements

CPSC 121: Models of Computation Assignment #4, due Thursday, March 16 th,2017at16:00

Practice Problems: All Computer Science majors are people. Some computer science majors are logical thinkers. Some people are logical thinkers.

THE LOGIC OF QUANTIFIED STATEMENTS

CSI30. Chapter 1. The Foundations: Logic and Proofs Rules of inference with quantifiers Logic and bit operations Specification consistency

Notes. Notes. Introduction. Notes. Propositional Functions. Slides by Christopher M. Bourke Instructor: Berthe Y. Choueiry.

CPSC 121: Models of Computation

CSE 311: Foundations of Computing. Lecture 8: Predicate Logic Proofs

CSE20: Discrete Mathematics

Example: NFA to DFA Conversion

Math 2300, Section #1; 14:00-15:15 MW P-101; Daily Notes Fall, 2015

Homework 1 CS 1050 A Due:

CS 4700: Artificial Intelligence

Automatic Reasoning (Section 8.3)

Lecture Notes 15 Number systems and logic CSS Data Structures and Object-Oriented Programming Professor Clark F. Olson

Lee Pike. June 3, 2005

CSE Discrete Structures

CSE 215: Foundations of Computer Science Recitation Exercises Set #9 Stony Brook University. Name: ID#: Section #: Score: / 4

THE PREDICATE CALCULUS

Resolution (14A) Young W. Lim 6/14/14

Strategies for Proofs

Mathematical Logic Prof. Arindama Singh Department of Mathematics Indian Institute of Technology, Madras. Lecture - 9 Normal Forms

Solutions to Selected Exercises

Automated Reasoning PROLOG and Automated Reasoning 13.4 Further Issues in Automated Reasoning 13.5 Epilogue and References 13.

9/19/12. Why Study Discrete Math? What is discrete? Sets (Rosen, Chapter 2) can be described by discrete math TOPICS

8. Negation 8-1. Deductive Databases and Logic Programming. (Sommer 2017) Chapter 8: Negation

STABILITY AND PARADOX IN ALGORITHMIC LOGIC

6.034 Notes: Section 10.1

For next Tuesday. Read chapter 8 No written homework Initial posts due Thursday 1pm and responses due by class time Tuesday

Introduction to dependent types in Coq

Knowledge & Reasoning

Predicate Logic CHAPTER What This Chapter Is About

CSE 215: Foundations of Computer Science Recitation Exercises Set #4 Stony Brook University. Name: ID#: Section #: Score: / 4

CSC Discrete Math I, Spring Sets

Chapter 3. Set Theory. 3.1 What is a Set?

MATH 139 W12 Review 1 Checklist 1. Exam Checklist. 1. Introduction to Predicates and Quantified Statements (chapters ).

CSE 20 DISCRETE MATH WINTER

To prove something about all Boolean expressions, we will need the following induction principle: Axiom 7.1 (Induction over Boolean expressions):

[Ch 6] Set Theory. 1. Basic Concepts and Definitions. 400 lecture note #4. 1) Basics

An Introduction to Programming and Proving in Agda (incomplete draft)

Answer Key #1 Phil 414 JL Shaheen Fall 2010

Mathematics for Computer Science Exercises from Week 4

Knowledge Representation. CS 486/686: Introduction to Artificial Intelligence

Sets. Mukulika Ghosh. Fall Based on slides by Dr. Hyunyoung Lee

Lecture 2: Analyzing Algorithms: The 2-d Maxima Problem

(d) If the moon shares nothing and the sun does not share our works, then the earth is alive with creeping men.

Summary of Course Coverage

Honors Geometry KEY Review Exercises for the December Exam

To prove something about all Boolean expressions, we will need the following induction principle: Axiom 7.1 (Induction over Boolean expressions):

CS221 / Autumn 2017 / Liang & Ermon. Lecture 17: Logic II

CSE 20 DISCRETE MATH. Winter

(More) Propositional Logic and an Intro to Predicate Logic. CSCI 3202, Fall 2010

LECTURE 2 An Introduction to Boolean Algebra

CIS 194: Homework 8. Due Wednesday, 8 April. Propositional Logic. Implication

Chapter 1.3 Quantifiers, Predicates, and Validity. Reading: 1.3 Next Class: 1.4. Motivation

Algebra of Sets (Mathematics & Logic A)

COMP combinational logic 1 Jan. 18, 2016

Honors Geometry KEY Review Exercises for the January Exam

CPSC 121: Models of Computation. Module 3: Representing Values in a Computer

Lecture 4: January 12, 2015

Lecture 7: January 15, 2014

Range Restriction for General Formulas

CMPSCI 250: Introduction to Computation. Lecture #7: Quantifiers and Languages 6 February 2012

DISCRETE MATHEMATICS

(Refer Slide Time 3:31)

Proofwriting Checklist

Formal Predicate Calculus. Michael Meyling

Solutions to In-Class Problems Week 1, Fri

What is the study of logic?

Predicate Logic and Quan0fies

Spring 2018 CSE191 Midterm Exam I

SYSC 2006 C Winter 2012

Artificial Intelligence. Chapters Reviews. Readings: Chapters 3-8 of Russell & Norvig.

AXIOMS FOR THE INTEGERS

Assignment # 4 Selected Solutions

The set consisting of all natural numbers that are in A and are in B is the set f1; 3; 5g;

University of Illinois at Chicago Department of Computer Science. Final Examination. CS 151 Mathematical Foundations of Computer Science Fall 2012

Lecture 17 of 41. Clausal (Conjunctive Normal) Form and Resolution Techniques

CSE 20 DISCRETE MATH. Fall

(a) (4 pts) Prove that if a and b are rational, then ab is rational. Since a and b are rational they can be written as the ratio of integers a 1

Back to the knights and knaves island

ELEMENTARY NUMBER THEORY AND METHODS OF PROOF

Basic Foundations of Isabelle/HOL

The current topic: Prolog. Announcements. Meaning of a Prolog rule. Prolog syntax. Reminder: The deadline for Lab 2 re-mark requests is Friday.

ELEMENTARY NUMBER THEORY AND METHODS OF PROOF

CS173 Longest Increasing Substrings. Tandy Warnow

Foundations of Computation

Today s Lecture 4/13/ WFFs/ Free and Bound Variables 9.3 Proofs for Pred. Logic (4 new implicational rules)!

Notes on Predicate Calculus

The three faces of homotopy type theory. Type theory and category theory. Minicourse plan. Typing judgments. Michael Shulman.

Mathematical Logic Part Two

ELEMENTARY NUMBER THEORY AND METHODS OF PROOF

CS 416, Artificial Intelligence Midterm Examination Fall 2004

Propositional logic (Ch. 7)

Mathematical Logic Part Two

Note: For #10 I have written out the solutions in more detail than you would be required to give.

Transcription:

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

Module 6: Rewriting predicate logic statements Pre-class quiz #7 is due March 1st at 19:00. Assigned reading for the quiz: Epp, 4th edition: 4.1, 4.6, Theorem 4.4.1 Epp, 3rd edition: 3.1, 3.6, Theorem 3.4.1. Rosen, 6th edition: 1.6, 1.7. 3.4 (theorem 2 only). Rosen 7th edition: 1.7, 1.8, 4.1 (theorem 2 only). Assignment #3 is now due Tuesday March 6th at 16:00. 2

Module 6: Rewriting predicate logic statements Pre-class quiz #8 is tentatively due Thursday March 15th at 19:00 Epp, 4th edition: 12.2, pages 791 to 795. Epp, 3rd edition: 12.2, pages 745 to 747, 752 to 754 Rosen, 6th edition: 12.2 pages 796 to 798, 12.3 Rosen, 7th edition: 13.2 pages 858 to 861, 13.3 3

Module 6: Rewriting predicate logic statements By the start of class, you should be able to: Determine the negation of any quantified statement. Given a quantified statement and an equivalence rule, apply the rule to create an equivalent statement (particularly the De Morgan s and contrapositive rules). Prove and disprove quantified statements using the challenge method (Epp, 4th edition, page 119). Apply universal instantiation, universal modus ponens, and universal modus tollens to predicate logic statements that correspond to the rules premises to infer statements implied by the premises. 4

Module 6: Rewriting predicate logic statements Quiz 6 feedback: Once again well done overall. Two questions seemed more difficult (next slides). Not much to say about the open-ended question: most people gave correct strategies. Great! 5

Module 6: Rewriting predicate logic statements How many of the following statements are log. equivalent to x B y C, P(x) Q(y)? x B y C, ~Q(y) ~P(x) ~ ( x B y C, P(x) ^ ~Q(y)) ~ ( x B y C, ~P(x) v Q(y)) y B x C, P(y) Q(x) a) None of them b) One of them c) Two of them d) Three of them e) All four of them 6

Module 6: Rewriting predicate logic statements Which of the following could be the result of applying one of the negation equivalence laws to the statement: x D, Q(x) [( y D, P(x, y)) ~( y D, P(x, y))] a) x D, Q(x) F b) F c) None: we can not apply the law to just the right side of the statement. d) None: the law doesn't match the right side of the statement. 8

Module 6: Rewriting predicate logic statements?? How can we? convince ourselves that an algorithm? does what it's supposed to do????????????? CPSC 121: the BIG questions: We continue discussing how to prove various types of predicate logic statements that arise when we discuss algorithm correctness. 10

Module 6: Rewriting predicate logic statements By the end of this module, you should be able to: Explore alternate forms of predicate logic statements using the logical equivalences you have already learned plus negation of quantifiers (a generalized form of the De Morgan s Law). 11

Module 6: Rewriting predicate logic statements Summary Thinking of quantifiers differently. Transformations: allowed or forbidden? The challenge method. 12

Module 6.1: Thinking of quantifiers differently Suppose D contains values x1, x2,..., xn What does x D, P(x) really mean? It's the same as P(x1) ^ P(x2) ^... ^ P(xn). Similarly, x D, P(x) P(x1) v P(x2) v... v P(xn) Thinking of quantifiers this way explains Negation Universal instantiation Universal Modus Ponens, Tollens 13

Module 6.1: Thinking of quantifiers differently Negation: ~ x D, P(x) ~(P(x1) ^ P(x2) ^... ^ P(xn)) ~P(x1) v ~P(x2) v... v ~P(xn) x D, ~P(x) ~ x D, P(x) ~(P(x1) v P(x2) v... v P(xn)) ~P(x1) ^ ~P(x2) ^... ^ ~P(xn) x D, ~P(x) 14

Module 6.1: Thinking of quantifiers differently What can we do with the negation in: ~ c R+ n0 N n N, n n0 f(n) cg(n)? a) It cannot be moved inward. b) It can only move across one quantifier because the generalized De Morgan s law can only handle one quantifier. c) It can only be moved across all three quantifiers because a negation can't appear between quantifiers. d) It could be moved across one, two or all three quantifiers. e) None of the above. 15

Module 6.1: Thinking of quantifiers differently Exercise: Let A be the set of amoebae, and Parent(x,y) be true if amoeba x is amoeba y's parent. Use logical equivalences to show that these two translations of an amoeba has only one parent are logically equivalent: (1) x A, y A, Parent(y, x) ( z A, Parent(z, x) y = z). (2) x A, y A, Parent(y, x) (~ z A, Parent(z, x) y z). 17

Module 6: Rewriting predicate logic statements Summary Thinking of quantifiers differently. Transformations: allowed or forbidden? The challenge method. 18

Module 6.2: Transformations (allowed or forbidden?) Universal instantiation: ( x D, P(x)) ^ (a D) P(a) Proving it is a valid inference: Suppose x D, P(x) is true. Hence P(x1) ^ P(x2) ^... ^ P(xn) holds. If a = xi is an element of D, then by specialization we have P(xi). 19

Module 6.2: Transformations (allowed or forbidden?) Universal modus ponens: Suppose x D, P(x) Q(x) is true. P(xi) holds where xi is an element of D. Hence (P(x1) Q(x1)) ^... ^ (P(xn) Q(xn)). By specialization P(xi) Q(xi) holds. By modus ponens, we deduce Q(xi). The same reasoning explains why universal modus tollens is valid. 20

Module 6.2: Transformations (allowed or forbidden?) Consider existential instantiation: x D, P(x) a D \P(a) a) This argument is valid: P(a) is true. b) This argument is invalid: P(a) is false. c) This argument is invalid: P(a) might be false. d) This argument is invalid for another reason. 21

Module 6.2: Transformations (allowed or forbidden?) What about existential modus ponens? x D, P(x) Q(x) P(a) \Q(a) a) This argument is valid, and Q(a) is true. b) The argument is valid, but the 1st premise can not be true; so Q(a) might be false. c) This argument is invalid because Q(a) is false. d) The argument is invalid for another reason. 23

Module 6.2: Transformations (allowed or forbidden?) Applying logical equivalences to predicate logic: Suppose we have x D, P(x) Q(x) We know that P(x) Q(x) ~P(x) v Q(x) We might want to write x D, ~P(x) v Q(x) Is this valid? 25

Module 6.2: Transformations (allowed or forbidden?) Which propositional logic equivalences apply to predicate logic? a) Double negative, Identity, and De Morgan's (not all equivalences!) b) ~(P(x) Q(x)) P(x) ~Q(x) c) Commutative, Associative, and the definition of conditional d) All propositional logic equivalences apply to predicate logic. e) None of the above. 26

Module 6.2: Transformations (allowed or forbidden?) Applying rules of inference to predicate logic: Suppose we have x D, P(x) Q(x) We know that x D, P(x) We might want to write x D, Q(x) Is this valid? 28

Module 6.2: Transformations (allowed or forbidden?) Which rules of inference apply to predicate logic? a) Modus ponens, modus tollens and elimination only. b) All rules apply, but only if they follow universal quantifiers, not existential quantifiers. c) All rules apply, but only if they follow existential quantifiers, not universal quantifiers. d) All rules apply, no matter what quantifiers are used. e) None of the above. 29

Module 6.2: Transformations (allowed or forbidden?) The only rules we really need: Universal Instantiation: for any a in D x D, P(x) P(a) Universal Generalization: P(x) for an arbitrary element x of D x D, P(x) 31

Module 6.2: Transformations (allowed or forbidden?) The only rules we really need (continued) Existential Instantiation: x D, P(x) P(w) for an unspecified (new) witness w in D Existential Generalization: P(a) for a given element a of D x D, P(x) 32

Module 6: Rewriting predicate logic statements Summary Thinking of quantifiers differently. Transformations: allowed or forbidden? The challenge method. 33

Module 6.3: The challenge method The Challenge method: A predicate logic statement is like a game with two players. you (trying to prove the statement true) your adversary (trying to prove it false). The two of you pick values for the quantified variables working from the left to right (i.e. inwards). You pick the values of existentially quantified variables. Your adversary picks the values of universally quantified variables 34

Module 6.3: The challenge method The Challenge method (continued): If there is a strategy that allows you to always win, then the statement is true. If there is a strategy for your adversary that allows him/her to always win, then the statement is false. What does it mean to have a winning strategy at Nim? 35

Module 6.3: The challenge method Example 1: x Z, n Z+, 2x < n How would we say this in English? How would we prove this theorem? Example 2: n N, x N, n < 2x How would we say this in English? How would we prove this theorem? 36

Module 6.3: The challenge method Example 3: x N, n N, n < 2x How would we say this in English? How would we prove this theorem? How do we prove a statement is false? 37