CSE 311 Foundations of Computing I Lecture 7 Logical Inference Autumn 2012 CSE 311 1.

Slides:



Advertisements
Similar presentations
Artificial Intelligence
Advertisements

CSE 311: Foundations of Computing Fall 2013 Lecture 3: Logic and Boolean algebra.
CPSC 121: Models of Computation Unit 6 Rewriting Predicate Logic Statements Based on slides by Patrice Belleville and Steve Wolfman.
Chapter 1: The Foundations: Logic and Proofs 1.1 Propositional Logic 1.2 Propositional Equivalences 1.3 Predicates and Quantifiers 1.4 Nested Quantifiers.
Chapter 1: The Foundations: Logic and Proofs 1.1 Propositional Logic 1.2 Propositional Equivalences 1.3 Predicates and Quantifiers 1.4 Nested Quantifiers.
Snick  snack CPSC 121: Models of Computation 2008/9 Winter Term 2 Rewriting Predicate Logic Statements Steve Wolfman, based on notes by Patrice Belleville.
CSE 311 Foundations of Computing I Lecture 6 Predicate Logic Autumn 2011 CSE 3111.
Discrete Mathematics Math 6A Instructor: M. Welling.
First Order Logic (chapter 2 of the book) Lecture 3: Sep 14.
CSE115/ENGR160 Discrete Mathematics 01/20/11 Ming-Hsuan Yang UC Merced 1.
First Order Logic. This Lecture Last time we talked about propositional logic, a logic on simple statements. This time we will talk about first order.
Predicates and Quantifiers
CSE 311 Foundations of Computing I Lecture 6 Predicate Logic, Logical Inference Spring
Methods of Proof & Proof Strategies
CSci 2011 Discrete Mathematics Lecture 3 CSci 2011.
A Brief Summary for Exam 1 Subject Topics Propositional Logic (sections 1.1, 1.2) –Propositions Statement, Truth value, Proposition, Propositional symbol,
Theoretical basis of GUHA Definition 1. A (simplified) observational predicate language L n consists of (i) (unary) predicates P 1,…,P n, and an infinite.
MATH 224 – Discrete Mathematics
CSE 311: Foundations of Computing Fall 2013 Lecture 8: More Proofs.
CSE 311 Foundations of Computing I Lecture 8 Proofs and Set Theory Spring
Section 1.5. Section Summary Nested Quantifiers Order of Quantifiers Translating from Nested Quantifiers into English Translating Mathematical Statements.
1 Sections 1.5 & 3.1 Methods of Proof / Proof Strategy.
1 Math/CSE 1019C: Discrete Mathematics for Computer Science Fall 2011 Suprakash Datta Office: CSEB 3043 Phone: ext
Foundations of Computing I CSE 311 Fall bit Binary Adder Inputs: A, B, Carry-in Outputs: Sum, Carry-out A B Cin Cout S
Chapter 1, Part II: Predicate Logic With Question/Answer Animations.
First Order Logic Lecture 2: Sep 9. This Lecture Last time we talked about propositional logic, a logic on simple statements. This time we will talk about.
CSE 311 Foundations of Computing I Lecture 5 Predicate Logic Spring
Chapter 1, Part II: Predicate Logic With Question/Answer Animations.
1 Predicate (Relational) Logic 1. Introduction The propositional logic is not powerful enough to express certain types of relationship between propositions.
Propositional Calculus – Methods of Proof Predicate Calculus Math Foundations of Computer Science.
Hazırlayan DISCRETE COMPUTATIONAL STRUCTURES Propositional Logic PROF. DR. YUSUF OYSAL.
CompSci 102 Discrete Math for Computer Science January 24, 2012 Prof. Rodger Slides modified from Rosen.
CSE 311 Foundations of Computing I Lecture 9 Proofs and Set Theory Autumn 2012 CSE
Chapter 1: The Foundations: Logic and Proofs
1 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Lecture 02: QUANTIFIERS Sections 1.3 and 1.4 Jarek Rossignac CS1050:
Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 1 The Foundations: Logic and Proofs Predicates and Quantifiers.
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.
First Order Logic Lecture 3: Sep 13 (chapter 2 of the book)
1 Propositional Logic: Fundamental Elements for Computer Scientists 0. Motivation for Computer Scientists 1. Propositions and Propositional Variables 2.
CSE 311: Foundations of Computing Fall 2013 Lecture 8: Proofs and Set theory.
Week 4 - Friday.  What did we talk about last time?  Floor and ceiling  Proof by contradiction.
1 Chapter 2.1 Chapter 2.2 Chapter 2.3 Chapter 2.4 All images are copyrighted to their respective copyright holders and reproduced here for academic purposes.
CSE 311 Foundations of Computing I Lecture 8 Proofs Autumn 2011 CSE 3111.
CSE 311 Foundations of Computing I Lecture 8 Proofs Autumn 2012 CSE
Lecture 1.3: Predicate Logic, and Rules of Inference* CS 250, Discrete Structures, Fall 2011 Nitesh Saxena *Adopted from previous lectures by Cinda Heeren.
Section 1.4. Propositional Functions Propositional functions become propositions (and have truth values) when their variables are each replaced by a value.
Foundations of Discrete Mathematics Chapter 1 By Dr. Dalia M. Gil, Ph.D.
Discrete Mathematical Structures: Theory and Applications 1 Logic: Learning Objectives  Learn about statements (propositions)  Learn how to use logical.
Propositional Logic. Assignment Write any five rules each from two games which you like by using propositional logic notations.
Foundations of Computing I CSE 311 Fall Announcements Homework #2 due today – Solutions available (paper format) in front – HW #3 will be posted.
CSE 311 Foundations of Computing I
Advanced Algorithms Analysis and Design
Methods of proof Section 1.6 & 1.7 Wednesday, June 20, 2018
CSE 311 Foundations of Computing I
CSE 311 Foundations of Computing I
Chapter 1 The Foundations: Logic and Proofs
CS201: Data Structures and Discrete Mathematics I
CSE 311 Foundations of Computing I
CSE 311: Foundations of Computing
CSE 311 Foundations of Computing I
First Order Logic Rosen Lecture 3: Sept 11, 12.
Negations of quantifiers
CSE 321 Discrete Structures
Discrete Mathematics CMP-200 Propositional Equivalences, Predicates & Quantifiers, Negating Quantified Statements Abdul Hameed
CSE 321 Discrete Structures
Predicates and Quantifiers
CPSC 121: Models of Computation
CS201: Data Structures and Discrete Mathematics I
CSE 311: Foundations of Computing
Presentation transcript:

CSE 311 Foundations of Computing I Lecture 7 Logical Inference Autumn 2012 CSE 311 1

Announcements Reading assignments – Logical Inference 1.6, th Edition 1.5, 1.6, th Edition 1.5, th Edition Autumn 2012CSE 311 2

Highlights from last lecture Predicates – Cat(x), Prime(x), HasTaken(s,c) Quantifiers –  x (Even(x)  Odd(x)),  x (Cat(x)  LikesTofu(x)) Order of quantifiers –  x  y Greater (y, x),  y  x Greater (y, x) Correspondence between world and logic – “Red cats like tofu” –  x ((Cat(x)  Red(x)) → LikesTofu(x)) Autumn 2012CSE 311 3

Scope of Quantifiers Notlargest(x)   y Greater (y, x)   z Greater (z, x) – Value doesn’t depend on y or z “bound variables” – Value does depend on x “free variable” Quantifiers only act on free variables of the formula they quantify –  x (  y (P(x,y)   x Q(y, x))) Autumn 2012CSE 3114

Scope of Quantifiers  x (P(x)  Q(x)) vs  x P(x)   x Q(x) Autumn 2012CSE 3115

Nested Quantifiers Bound variable name doesn’t matter –  x  y P(x, y)   a  b P(a, b) Positions of quantifiers can change –  x (Q(x)   y P(x, y))   x  y (Q(x)  P(x, y)) BUT: Order is important... Autumn 2012CSE 3116

Quantification with two variables ExpressionWhen trueWhen false  x  y P(x, y)  x  y P(x, y)  x  y P(x, y)  y  x P(x, y) Autumn 2012CSE 3117

Negations of Quantifiers Not every positive integer is prime Some positive integer is not prime Prime numbers do not exist Every positive integer is not prime Autumn 2012CSE 311 8

De Morgan’s Laws for Quantifiers Autumn 2012CSE  x P(x)   x  P(x)   x P(x)   x  P(x)

De Morgan’s Laws for Quantifiers Autumn 2012CSE    x  y ( x ≥ y)  x  y ( x ≥ y)  x  y  x ≥ y)  x  y (y > x) “There is no largest integer” “For every integer there is a larger integer”  x P(x)   x  P(x)   x P(x)   x  P(x)

Logical Inference So far we’ve considered – How to understand and express things using propositional and predicate logic – How to compute using Boolean (propositional) logic – How to show that different ways of expressing or computing them are equivalent to each other Logic also has methods that let us infer implied properties from ones that we know – Equivalence is a small part of this Autumn 2012CSE

Applications of Logical Inference Software Engineering – Express desired properties of program as set of logical constraints – Use inference rules to show that program implies that those constraints are satisfied AI – Automated reasoning Algorithm design and analysis – e.g., Correctness, Loop invariants. Logic Programming, e.g. Prolog – Express desired outcome as set of constraints – Automatically apply logic inference to derive solution Autumn 2012CSE

Proofs Start with hypotheses and facts Use rules of inference to extend set of facts Result is proved when it is included in the set Autumn 2012CSE 31113

An inference rule: Modus Ponens If p and p  q are both true then q must be true Write this rule as Given: – If it is Monday then you have a 311 class today. – It is Monday. Therefore, by Modus Ponens: – You have a 311 class today Autumn 2012CSE p, p  q ∴ q

Proofs Show that r follows from p, p  q, and q  r 1. p Given 2.p  q Given 3.q  r Given 4.q Modus Ponens from 1 and 2 5.r Modus Ponens from 3 and 4 Autumn 2012CSE

Inference Rules Each inference rule is written as which means that if both A and B are true then you can infer C and you can infer D. – For rule to be correct (A  B)  C and (A  B)  D must be a tautologies Sometimes rules don’t need anything to start with. These rules are called axioms: – e.g. Excluded Middle Axiom Autumn 2012CSE A, B ∴ C,D ∴ p  p

Simple Propositional Inference Rules Excluded middle plus two inference rules per binary connective, one to eliminate it and one to introduce it Autumn 2012CSE p  q ∴ p, q p, q ∴ p  q p ∴ p  q, q  p p  q,  p ∴ q p, p  q ∴ q p  q ∴ p  q Direct Proof Rule Not like other rules! See next slide…

Direct Proof of an Implication p  q denotes a proof of q given p as an assumption. Don’t confuse with p  q. The direct proof rule – if you have such a proof then you can conclude that p  q is true E.g. 1. p Assumption 2. p  q Intro for  from 1 3. p  (p  q) Direct proof rule Autumn 2012CSE Proof subroutine for p  (p  q)

Proofs can use Equivalences too Show that  p follows from p  q and  q 1. p  q Given 2.  q Given 3.  q   p Contrapositive of 1 4.  p Modus Ponens from 2 and 3 Autumn 2012CSE

Inference Rules for Quantifiers Autumn 2012CSE P(c) for some c ∴  x P(x)  x P(x) ∴ P(a) for any a “Let a be anything”...P(a) ∴  x P(x)  x P(x) ∴ P(c) for some special c

Proofs using Quantifiers Show that “Simba is a cat” follows from “All lions are cats” and “Simba is a lion” (using the domain of all animals) Autumn 2012CSE

Proofs using Quantifiers “There exists an even prime number” Autumn 2012CSE

General Proof Strategy A.Look at the rules for introducing connectives to see how you would build up the formula you want to prove from pieces of what is given B.Use the rules for eliminating connectives to break down the given formulas so that you get the pieces you need to do A. C.Write the proof beginning with B followed by A. Autumn 2012CSE