* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download Introduction to Logic What is Logic? Simple Statements Which one is
Survey
Document related concepts
Meaning (philosophy of language) wikipedia , lookup
Intuitionistic logic wikipedia , lookup
Propositional calculus wikipedia , lookup
Analytic–synthetic distinction wikipedia , lookup
Laws of Form wikipedia , lookup
Propositional formula wikipedia , lookup
Natural deduction wikipedia , lookup
Accessibility relation wikipedia , lookup
Law of thought wikipedia , lookup
Transcript
What is Logic? n n Introduction to Logic n Logic is the study of reasoning It is specifically concerned with whether reasoning is correct Logic is also known as Propositional Calculus Peter Lo CS218 © Peter Lo 2004 1 CS218 © Peter Lo 2004 Simple Statements Which one is statement? n n n n Simple Statement is the basic building block of Logic. Simple Statement is referred as a proposition. A statement is a declarative sentence that either True or False. n n n CS218 © Peter Lo 2004 3 2 Today is Friday. u This is a Statement How to celebrate the Mid-Autumn? u This is not a Statement Let’s go for dinner together after lesson. u This is not a Statement 1+1=3 u This is a Statement CS218 © Peter Lo 2004 4 1 Compound Statement True Table n n n Compound Statement is the combination of two or more Simple Statement. Example: u “Today is Friday” and “Tomorrow is holiday” CS218 © Peter Lo 2004 n n 5 The value of a statement can be represented by a Truth Table. Only True and False is appear in a Truth Table Example: CS218 © Peter Lo 2004 Basic Logic Connectives Conjunction n n Compound statements are connected using mainly five basic connectives: u Conjunction u Disjunction u Negation u Conditional u Biconditional CS218 © Peter Lo 2004 7 n n 6 Conjunction is the combination of statements using AND. The conjunction of two statement is True only if each component is True. Represented as p ^ q. CS218 © Peter Lo 2004 8 2 Disjunction (Inclusive OR) Negation n n n n Disjunction is the combination of statements using OR. The conjunction of two statement is True if either one component is True. Represented as p ∨ q. CS218 © Peter Lo 2004 9 n n Negation is the NOT of a simple statement. The Truth value of the statement negation of a statement is the opposite of the truth value of the original statement. Represented as ~p. CS218 © Peter Lo 2004 Conditional Biconditional n n n n n Conditional Statement is the statement in the form “If p, then q” or “p implies q”. The conditional p à q is True unless p is True and q is False. Represented as p à q (Do the Ex. 1 & 2) CS218 © Peter Lo 2004 11 n n 10 Biconditional Statement is the statement in the form “p if and only if q” or “p iff q”. If p and q have the same value, p ↔ q is True, otherwise will be False. Represented as p ↔ q CS218 © Peter Lo 2004 12 3 Propositions Truth Table n n When the sub-statement of a compound statement are variables and represented in logical connectives, the compound statement is called Proposition. n n CS218 © Peter Lo 2004 13 The truth value of a proposition depends exclusively upon the truth values of its variables. The truth value of a proposition is known once the truth values of its variables are known. (See E.g. 30 - 32) CS218 © Peter Lo 2004 Exclusive Disjunction (Exclusive OR) Tautologies and Contradictions n n n n n Exclusive Disjunction means “either one or the other, but not both”. The conditional of a exclusive disjunction is True when p and q are not the same. Exclusive Disjunction can be expressed using basic connectives ~ (p ↔ q) (Do the Ex. 3) CS218 © Peter Lo 2004 15 n 14 Tautologies u A Compound statement that is always True is called Tautologies u (See E.g. 33) Contradictions u A Compound statement that is always False is called Contradictions u (See E.g. 34) CS218 © Peter Lo 2004 16 4 Principle of Substitution Law of Syllogism n n n If P(p, q, … ) is a Tautology, then P(P1 , P2 , … ) is also a Tautology. (See E.g. 35) n n CS218 © Peter Lo 2004 17 A fundamental principle of logical reasoning, called the Law of Syllogism, states “If p implies q and q implies r, then p implies r” [(p → q) ∧ (q → r)] → (p → r) is a Tautology (See E.g. 36) CS218 © Peter Lo 2004 Logical Equivalence DeMorgan’s Laws n n n n Two propositions P and Q are said to be logically equivalent if the final columns in their truth table are the same. Represented as ≡ (Do the Ex. 4 & 5) CS218 © Peter Lo 2004 19 18 DeMorgan’s Laws show that: u ~ (p ∨ q) ≡ ~p ∧ ~q u ~ (p ∧ q) ≡ ~p ∨ ~q CS218 © Peter Lo 2004 20 5 Logically True & Logically Equivalent Argument n n n Logically True Statement u A statement is said to be Logically True if it is derivable from a Tautology. Logically Equivalent Statement u Statement of the form P(p 0 , q 0 , ..) and Q (p 0 , q 0 , ..) are said to be Logically Equivalent if the propositions P(p, q, … ) and Q(p, q, ..) are logical equivalent. CS218 © Peter Lo 2004 21 n n n n An argument is a relationship between a set of proposition, P1 , P2 , … Pn , called Premises and other proposition Q, called the Conclusion. An argument is denoted by P1 , P2 , … Pn | Q An argument is said to be Validif the premises yield the conclusion. An argument is said to be Fallacy if that is not valid. (See E.g. 39 & 40) CS218 © Peter Lo 2004 Logical Implication Example n n n A proposition P(p, q, … ) is said to Logical Imply a proposition Q(p, q, … ), written P(p, q, … ) => Q(p, q, … ) if Q(p, q, … ) is true whenever P(p, q, ) is True. (See E.g. 44) 22 Consider the following argument: if I am not in Malaysia, then I am not happy; if I am happy, then I am singing; I am not singing; therefore I am not in Malaysia. Using the translation show that this argument is valid, or explain why it is not. CS218 © Peter Lo 2004 23 CS218 © Peter Lo 2004 24 6 Answer Laws of Algebra of Propositions n n n CS218 © Peter Lo 2004 25 Laws of Algebra of Propositions n Distributive Laws n p ∨ (q ∧ r) ≡ (p ∨ q) ∧ (p ∨ r) u p ∧ (q ∨ r) ≡ (p ∧ q) ∨ (p ∧ r) Identity Laws CS218 © Peter Lo 2004 u u n p ∨F≡p p ∧T ≡p p ∨T ≡T u p ∧F ≡ F (T = True, F = False) CS218 © Peter Lo 2004 26 Laws of Algebra of Propositions u u Idempotent Laws u p ∨p ≡ p u p ∧p ≡ p Associative Laws u (p ∨ q) ∨ r ≡ p ∨ (q ∨ r) u (p ∧ q) ∧ r ≡ p ∧ (q ∧ r) Communicative Laws u p ∨q≡ q ∨p u p ∧q≡ q ∧p u (p ↔ q) ≡ (q ↔ p) n 27 Complement Laws u p ∨ ~p ≡ T u p ∧ ~p ≡ F u ~T ≡ F u ~F ≡ T (T = True, F = False) Involution Law u ~ ~p ≡ p CS218 © Peter Lo 2004 28 7 Laws of Algebra of Propositions Laws of Algebra of Propositions n n n DeMorgan’s Laws u ~ (p ∨ q) ≡ ~p ∧ ~q u ~ (p ∧ q) ≡ ~p ∨ ~q u (p ∨ q) ≡ ~ (~p ∧ ~q) u (p ∧ q) ≡ ~ (~p ∨ ~q) Contrapositive u (p → q) ≡ (~q → ~p) Implication u u u (p ∧ q) ≡ ~(p → ~q) (p → r) ∧ (q → r) ≡ (p ∨ q) → r u (p → q) ∧ (p → r) ≡ p → (q ∧ r) Equivalence u u n u CS218 © Peter Lo 2004 (p → q) ≡ (~q ∨ p) (p → q) ≡ ~(p ∧ ~q) (p ∨ q) ≡ (~p → q) 29 (p ↔ q) = (p → q) ∧ (q → p) CS218 © Peter Lo 2004 30 Laws of Algebra of Propositions n n n Exportation Law u (p ∧ q) → r ≡ p → (q → r) Absorbtion Law u (p ∨ q) ∧ (p ∧ q) ≡ p ∨ q u (p ∧ q) ∧ (p ∨ q) ≡ p ∨ q Reductio ad adsurdum u (p → q) ≡ (p ∧ ~q) → F (T = True, F = False) CS218 © Peter Lo 2004 31 8