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

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

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

CS100: DISCRETE STRUCTURES. Lecture 5: Logic (Ch1)

CSC Discrete Math I, Spring Propositional Logic

Lecture 2. Logic Compound Statements Conditional Statements Valid & Invalid Arguments Digital Logic Circuits. Reading (Epp s textbook)

Logic and Proof. Aiichiro Nakano

1 The Foundation: Logic and Proofs

Logical Agents. Chapter 7

1 The Foundation: Logic and Proofs

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

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

Discrete Mathematical Structures. Chapter 1 The Foundation: Logic

Introduction to Sets and Logic (MATH 1190)

Why Learning Logic? Logic. Propositional Logic. Compound Propositions

software design & management Gachon University Chulyun Kim

Intro to Logic and Proofs

Logical Operators. Conjunction Disjunction Negation Exclusive Or Implication Biconditional

PROPOSITIONAL CALCULUS

Example. Logic. Logical Statements. Outline of logic topics. Logical Connectives. Logical Connectives

First order Logic ( Predicate Logic) and Methods of Proof

Propositional Logic. Spring Propositional Logic Spring / 32

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

2. The Logic of Compound Statements Summary. Aaron Tan August 2017

THE LOGIC OF COMPOUND STATEMENTS

Compound Propositions

Mat 243 Exam 1 Review

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

Predicate Logic. Andreas Klappenecker

Sample Problems for all sections of CMSC250, Midterm 1 Fall 2014

PHI Propositional Logic Lecture 2. Truth Tables

Chapter 4, Logic using Propositional Calculus Handout

Logic. Definition [1] A logic is a formal language that comes with rules for deducing the truth of one proposition from the truth of another.

Logic and Proofs. (A brief summary)

ECOM Discrete Mathematics

Packet #1: Logic & Proofs. Applied Discrete Mathematics

10/5/2012. Logic? What is logic? Propositional Logic. Propositional Logic (Rosen, Chapter ) Logic is a truth-preserving system of inference

Predicate Logic & Quantification

A. Propositional Logic

DISCRETE MATHEMATICS BA202

Chapter 1, Part I: Propositional Logic. With Question/Answer Animations

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

Solutions to Homework I (1.1)

Discrete Mathematics and Its Applications

Propositional and First-Order Logic

Propositional Logic Not Enough

It rains now. (true) The followings are not propositions.

Discrete Mathematics and Applications COT3100

Definition 2. Conjunction of p and q

Boolean Algebra and Proof. Notes. Proving Propositions. Propositional Equivalences. Notes. Notes. Notes. Notes. March 5, 2012

CHAPTER 1 - LOGIC OF COMPOUND STATEMENTS

Outline. Rules of Inferences Discrete Mathematics I MATH/COSC 1056E. Example: Existence of Superman. Outline

COMP 2600: Formal Methods for Software Engineeing

Logic and Propositional Calculus

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

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

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

HANDOUT AND SET THEORY. Ariyadi Wijaya

Review: Potential stumbling blocks

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.

CS 2336 Discrete Mathematics

Chapter 1 Elementary Logic

Chapter Summary. Propositional Logic. Predicate Logic. Proofs. The Language of Propositions (1.1) Applications (1.2) Logical Equivalences (1.

ICS141: Discrete Mathematics for Computer Science I

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

EECS 1028 M: Discrete Mathematics for Engineers

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

Proofs. Example of an axiom in this system: Given two distinct points, there is exactly one line that contains them.

A Little Deductive Logic

1.1 Language and Logic

Discrete Structures & Algorithms. Propositional Logic EECE 320 // UBC

Mathacle. PSet ---- Algebra, Logic. Level Number Name: Date: I. BASICS OF PROPOSITIONAL LOGIC

Readings: Conjecture. Theorem. Rosen Section 1.5

Chapter 2: The Logic of Compound Statements

MAT2345 Discrete Math

Unit I LOGIC AND PROOFS. B. Thilaka Applied Mathematics

5. Use a truth table to determine whether the two statements are equivalent. Let t be a tautology and c be a contradiction.

The Logic of Compound Statements cont.

Logic and Proofs. (A brief summary)

Chapter 1, Section 1.1 Propositional Logic

A Little Deductive Logic

Rules Build Arguments Rules Building Arguments

Logic and Propositional Calculus

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

What is Logic? Introduction to Logic. Simple Statements. Which one is statement?

2/13/2012. Logic: Truth Tables. CS160 Rosen Chapter 1. Logic?

Propositional Logic Basics Propositional Equivalences Normal forms Boolean functions and digital circuits. Propositional Logic.

Steinhardt School of Culture, Education, and Human Development Department of Teaching and Learning. Mathematical Proof and Proving (MPP)

Formal Logic. Critical Thinking

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

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

Proposition/Statement. Boolean Logic. Boolean variables. Logical operators: And. Logical operators: Not 9/3/13. Introduction to Logical Operators

Chapter 1, Logic and Proofs (3) 1.6. Rules of Inference

Propositional Logic. Argument Forms. Ioan Despi. University of New England. July 19, 2013

2.2: Logical Equivalence: The Laws of Logic

Section 1.1 Propositions

MAT 243 Test 1 SOLUTIONS, FORM A

Manual of Logical Style

CHAPTER 1. MATHEMATICAL LOGIC 1.1 Fundamentals of Mathematical Logic

1.1 Statements and Compound Statements

Chapter 1: The Logic of Compound Statements. January 7, 2008

Transcription:

Logic Logic is a discipline that studies the principles and methods used in correct reasoning It includes: A formal language for expressing statements. An inference mechanism (a collection of rules) to reason about valid arguments. 1

Logic Logic is a discipline that studies the principles and methods used to construct valid arguments. An argument is a related sequence of statements to demonstrate the truth of an assertion premises are assumed to be true conclusion, the last statement of the sequence, is taken to be true based on the truth of the other statements. An argument is valid if the conclusion follows logically from the truth of the premises. Logic is the foundation for expressing formal proofs. 2

Propositional Logic Propositional Logic is the logic of compound statements built from simpler statements using Logical Boolean connectives. Some applications Design of digital electronic circuits. Expressing conditions in programs. Queries to databases & search engines. 3

Propositional Logic A proposition is a declarative sentence that is either RUE or ALSE (not both). Examples: he Earth is flat 3 + 2 = 5 I am older than my mother allahassee is the capital of lorida 5 + 3 = 9 Athens is the capital of Georgia 4

Propositional Logic Letters are used to denote propositions. he most frequently used letters are p, q, r, s and t. Example: p: Grass is green. he truth value of a proposition is true, denoted by, if it is true, and false, denoted by it is false 5

Propositional Logic Compound propositions : built up from simpler propositions using logical operators requently corresponds with compound English sentences. Example: Given p: Jack is older than Jill q: Jill is female We can build up r: Jack is older than Jill and Jill is female (p q) s: Jack is older than Jill or Jill is female (p q) t: Jack is older than Jill and it is not the case that Jill is female (p q) 6

Propositional Logic - negation Let p be a proposition. he negation of p is written p and has meaning: It is not the case that p. ruth table for negation: p p 7

Propositional Logic - conjunction Conjunction operator (AND): corresponds to English and. is a binary operator in that it operates on two propositions when creating a compound proposition Def. Let p and q be two arbitrary propositions, the conjunction of p and q, denoted p q, is true if both p and q are true and false otherwise. 8

Propositional Logic - conjunction Conjunction operator p q is true when p and q are both true. ruth table for conjunction: p q p q 9

Propositional Logic - disjunction Disjunction operator (or): loosely corresponds to English or. binary operator Def.: Let p and q be two arbitrary propositions, the disjunction of p and q, denoted p q is false when both p and q are false and true otherwise. is also called inclusive or Observe that p q is true when p is true, or q is true, or both p and q are true. 10

Propositional Logic - disjunction Disjunction operator p q is true when p or q (or both) is true. ruth table for conjunction: p q p q 11

Propositional Logic - XOR Exclusive Or operator ( ): corresponds to English either or (exclusive form of or) binary operator Def.: Let p and q be two arbitrary propositions, the exclusive or of p and q, denoted p q is true when either p or q (but not both) is true. 12

Propositional Logic - XOR Exclusive Or: p q is true when p or q (not both) is true. ruth table for exclusive or: p q p q 13

Propositional Logic- Implication Implication operator ( ): binary operator similar to the English usage of if then, implies, and many other English phrases Def.: Let p and q be two arbitrary propositions, the implication p q is false when p is false and q is true, and true otherwise. p q is true when p is true and q is true, q is true, or p is false. p q is false when p is true and q is false. Example: r : he dog is barking. s : he dog is awake. r s : If the dog is barking then the dog is awake. 14

Propositional Logic- Implication ruth table for implication: p q p q If the temperature is below 10, then water freezes. 15

Propositional Logic- Biconditional Biconditional operator ( ): Binary operator Partly similar to the English usage of If and only if Def.: Let p and q be two arbitrary propositions. he biconditional p q is true when q and p have the same truth values and false otherwise. Example: p : he dog plays fetch. q : he dog is outside. p q: he plays fetch if and only if it is outside. 16

Propositional Logic- Biconditional ruth table for biconditional: p q p q 17

Propositional Equivalences A tautology is a proposition that is always true. Ex.: p p A contradiction is a proposition that is always false. Ex.: p p A contingency is a proposition that is neither a tautology nor a contradiction. Ex.: p p p p p p p p p p p p p p 18

Propositional Logic: Logical Equivalence If p and q are propositions, then p is logically equivalent to q if their truth tables are the same. p is equivalent to q. is denoted by p q p, q are logically equivalent if their biconditional p q is a tautology. 19

Propositional Logic: Logical Equivalence p p P p p he equivalence holds since these two columns are the same. 20

Propositional Logic: Logical Equivalence p q p q? Does (p q) ( p q)? Does (p q) ( p q) and ( p q) (p q)? 21

Propositional Logic: Logical Equivalences Identity Domination Idempotent p p p p p p p p p p p p Double negation ( p) p 22

Propositional Logic: Logical Equivalences Commutative: p q q p p q q p Associative: (p q ) r p ( q r ) (p q ) r p ( q r ) 23

Propositional Logic: Logical Equivalences Distributive: p (q r ) (p q ) (p r ) p (q r ) (p q ) (p r ) De Morgan s: (p q ) p q (De Morgan s I) (p q ) p q (De Morgan s II) 24

Propositional Logic: Logical Equivalences Absorption: p (p q ) p p (p q ) p Negation: p p p p A useful LE involving : p q p q 25

Predicate Logic Define: UGA(x) = x is a UGA student. Universe of Discourse all people x is a variable that represents an arbitrary individual in the Universe of Discourse A predicate P, or propositional function, is a function that maps objects in the universe of discourse to propositions UGA(Paris Hilton) is a proposition. UGA(x) is not a proposition. UGA(x) is like an English predicate template is a UGA student 26

Predicate Logic Pos(x): x > 0 Universe of Discourse (UoD): Integers Pos(1): 1>0 = Pos(50): 50>0 = Pos(-10): -10>0 = emale(x): x is female UoD: all people emale(maria) = emale(edward) = 27

Predicate Logic A predicate that states a property about one object is called a monadic predicate. UGA-Student(x) Parent(x) emale(x) 28

Predicate Logic A predicate of the form P(x 1,,x n ), n>1 that states the relationships among the objects x 1,,x n is called polyadic. Also, an n-place predicate or n-ary predicate (a predicate with arity n). It takes n>1 arguments UoD(x 1,,x n ) = UoD(x 1 ) X UoD(x 2 ) X UoD(x n ) L(x,y): x loves y UoD(x) = UoD(y) = all people L(Adam,Mary) = L(Mike,Jill) = Q(x,y,z): x+y = z UoD(x) = UoD(y) = UoD(z): positive integers Q(1,1,2) = Q(1,2,5) = 29

Predicate Logic: Universal Quantifier Suppose that P(x) is a predicate on some universe of discourse. he universal quantification of P(x) ( x P(x) ) is the proposition: P(x) is true for all x in the universe of discourse. x P(x) reads for all x, P(x) is rue x P(x) is RUE means P(x) is true for all x in UoD(x). x P(x) is ALSE means there is an x in UoD(x) for which P(x) is false. 30

Predicate Logic: Universal Quantifier ID(x) means x has a student ID. UoD(x): UGA students x ID(x) means every UGA student has a student ID Isemale(x) means x is a emale UoD(x): UGA students x Isemale(x) means Every UGA student is a female! Jim is a UGA student who is a male Jim is called a counterexample for x Isemale(x) 31

Predicate Logic: Universal Quantifier In the special case that the universe of discourse U, is finite, (U = {a 1, a 2, a 3,, a n }) x P(x) corresponds to the proposition: P(a 1 ) P(a 2 ) P(a n ) We can write a program to loop through the elements in the universe and check each for truthfulness. If all are true, then the proposition is true. Otherwise it is false! 32

Predicate Logic: Existential Quantifier Suppose P(x) is a predicate on some universe of discourse. he existential quantification of P(x) is the proposition: here exists at least one x in the universe of discourse such that P(x) is true. x P(x) reads for some x, P(x) or here exists x, P(x) is rue x P(x) is RUE means there is an x in UoD(x) for which P(x) is true. x P(x) is ALSE means : for all x in UoD(x), P(x) is false 33

Predicate Logic: Existential Quantifier Examples: (x) means x is female. UoD(x): UGA students x (x) means or some UGA student x, x is a female. here exists a UGA student x who is a female. Y(x) means x is less than 13 years old UoD(x): UGA students x Y(x) means for some UGA student x, x is less than 13 years old there exists a UGA student x such that x is less than 13 years old What will be the truth-value of x Y(x) if the UoD is all people? 34

Predicate Logic: Existential Quantifier In the special case that the universe of discourse, U, is finite, (U = {x 1, x 2, x 3,, x n }) x P(x) corresponds to the proposition: P(x 1 ) P(x 2 ) P(x n ) We can write a program to loop through the elements in the universe and check each for truthfulness. If all are false, then the proposition is false. Otherwise, it is true! 35

Predicates - Quantifier negation x P(x) means P(x) is true for some x. What about x P(x)? It is not the case that [ P(x) is true for some x. ] P(x) is not true for all x. x P(x) Existential negation: x P(x) x P(x). 36

Predicates - Quantifier negation x P(x) means P(x) is true for every x. What about x P(x)? It is not the case that [ P(x) is true for every x. ] here exists an x for which P(x) is not true. x P(x) Universal negation: x P(x) x P(x). 37

Re-Cap A predicate P, or propositional function, is a function that maps objects in the universe of discourse to propositions Predicates can be quantified using the universal quantifier ( for all ) or the existential quantifier ( there exists ) Quantified predicates can be negated as follows x P(x) x P(x) x P(x) x P(x) Quantified variables are called bound Variables that are not quantified are called free 38

Proofs A theorem is a statement that can be proved to be true. A proof is a sequence of statements that form an argument. 39

Proofs: Inference Rules An Inference Rule: premise 1 premise 2 conclusion means therefore 40

Proofs: Modus Ponens I have a total score over 96. If I have a total score over 96, then I get an A for the class. I get an A for this class p q p q autology: (p (p q)) q 41

Proofs: Modus ollens If the power supply fails then the lights go out. he lights are on. he power supply has not failed. q p p q autology: ( q (p q)) p 42

Proofs: Addition I am a student. I am a student or I am a visitor. p p q autology: p (p q) 43

Proofs: Simplification I am a student and I am a soccer player. I am a student. p p q autology: (p q) p 44

Proofs: Conjunction I am a student. I am a soccer player. I am a student and I am a soccer player. p q p q autology: ((p) (q)) p q 45

Proofs: Disjunctive Syllogism I am a student or I am a soccer player. I am a not soccer player. I am a student. p p q q autology: ((p q) q) p 46

Proofs: Hypothetical Syllogism If I get a total score over 96, I will get an A in the course. If I get an A in the course, I will have a 4.0 average. If I get a total score over 96 then I will have a 4.0 average. p q q r p r autology: ((p q) (q r)) (p r) 47

Proofs: Resolution I am taking CS4540 or I am taking CS4560. I am not taking CS4540 or I am taking CS7300. I am taking CS4560 or I am taking CS7300. p q p r q r autology: ((p q ) ( p r)) (q r) 48

allacy of Affirming the Conclusion If you have the flu then you ll have a sore throat. You have a sore throat. You must have the flu. q p p q allacy: (q (p q)) p Abductive reasoning (Useful in real life but not in formal predicate logic) 49

allacy of Denying the Hypothesis If you have the flu then you ll have a sore throat. You do not have the flu. You do not have a sore throat. p q p q allacy: ( p (p q)) q 50

Inference Rules for Quantified Statements x P(x) P(c) P(c) xp(x) Universal Instantiation (for an arbitrary object c from UoD) Universal Generalization (for any arbitrary element c from UoD) x P(x) P(c) P(c) xp(x) Existential Instantiation (for some specific object c from UoD) Existential Generalization (for some object c from UoD) 51