Professional Documents
Culture Documents
Overview: Literature:
What is Logic? Handouts: (J. Kelly)
Propositional Logic The Essence of Logic:
Predicate Logic chapter 1 (not 1.6)
chapter 6
What is Logic?
1
Aristotoles (384–322 B.C.)
J Syllogism:
2
Criticism to logic
3
Uses of Logic
J Argumentation
J Inference (systems)
J Cognitive psychology & AI
J descriptive use of logic
J Normative systems
J prescriptive use of logic
J Knowledge representation
Warning!
J Meta-language
J Different levels
J Abstraction
J Difference to everyday use of concepts
J Temporal, causal, … relations
4
Propositional Logic and Predicate Logic
J Propositional Logic
J The study of statements and their connectivity structure.
J Predicate Logic
J The study of individuals and their properties.
5
Propositional Logic
J Truth Tables
J Logical equivalence
J Tautology
J Contradiction
Basic elements
J Logical connectives
J ∧ and
J ∨ or
J ¬ not
J → implication, if … then …
J ↔ bi-implication, iff (if and only if)
6
Truth values
Truth tables
A ¬A
T F
F T
7
Truth table for AND (∧)
A B A∧B
F F F
F T F
T F F
T T T
A B A∨B
F F F
F T T
T F T
T T T
8
Truth table for implication (→)
A B A→B
F F T
F T T
T F F
T T T
A B A↔B
F F T
F T F
T F F
T T T
9
Remarks on implication
J E.g. compare:
J If the moon is made of cheese then it is tasty
J If the moon is made of cheese then 2 x 2 = 5
J Both are true, but the first sounds more ‘logical’!!
J Tautology
J A logical expression that has truth value T is all cases
J Contradiction
J A logical expression that has truth value F is all cases
10
Example: tautology
(A∧B)→ (C∨(¬B→¬C))
A B C A∧B ¬B ¬C ¬B→¬C C∨(¬B→¬C) (A∧B)→ (C∨(¬B→¬C))
F F F F T T T T T
F F T F T F F T T
F T F F F T T T T
F T T F F F T T T
T F F F T T T T T
T F T F T F F T T
T T F T F T T T T
T T T T F F T T T
Example: tautology
(A∧B)→ (C∨(¬B→¬C))
A B C A∧B ¬B ¬C ¬B→¬C C∨(¬B→¬C) (A∧B)→ (C∨(¬B→¬C))
F F F F T T T T T
F F T F T F F T T
F T F F F T T T T
F T T F F F T T T
T F F F T T T T T
T F T F T F F T T
T T F T F T T T T
T T T T F F T T T
11
Example: Contradiction
A ¬A A∧¬A
F T F
T F F
Logical equivalence
J Notation: A ≡ B
J A and B are logically equivalent
12
Example
F F F F F T T T F
F T F F T T F T F
T F F T F F T T F
T T T T T F F F T
Example
F F F F F T T T F
F T F F T T F T F
T F F T F F T T F
T T T T T F F F T
Conclusion:
A ∧ B ≡ ¬(¬A ∨ ¬B)
13
Equivalence laws
J A ∧0 ≡0
J A ∧1 ≡A
J A ∨0 ≡A
J A ∨1 ≡1
J A ∧A ≡A
J A ∨A ≡A
Equivalence laws
J A ∧0 ≡0 J A ∧ B≡B∧ A
J A ∧1 ≡A J A ∨ B≡B∨ A
J A ∨0 ≡A J A ∧ (A ∨ B) ≡ A
J A ∨1 ≡1 J A ∨ (A ∧ B) ≡ A
J A ∧A ≡A J A ∨ (¬A ∧ B) ≡ A ∨ B
J A ∨A ≡A J A ∧ (¬A ∨ B) ≡ A ∧ B
J A ∧ ¬A ≡ 0 J (A ∧ B) ∨ (A ∧ ¬B) ≡ A
J A ∨ ¬A ≡ 1 J A → B ≡ ¬A ∨ B
J ¬¬A ≡ A J A → B ≡ ¬(A ∧ ¬B)
14
Equivalence laws (general)
J Distributivity
J A ∧ (B ∨ C) ≡ (A ∧ B) ∨ (A ∧ C)
J A ∨ (B ∧ C) ≡ (A ∨ B) ∧ (A ∨ C)
J De Morgan Laws
J ¬(A ∧ B) ≡ ¬A ∨ ¬B
J ¬(A ∨ B) ≡ ¬A ∧ ¬B
Inference
J Modus Ponens
A→B
A
∴B
15
Predicate logic
Syllogistic reasoning
J Syllogistic reasoning as
16
Objects, predicates, quantifiers
J Needed:
J Objects, such as Socrates
J Predicates, such as mortal
J Quantifiers, such as all
J Formally: or:
J ∀x : M(x) → S(x) ∀x : man(x) → mortal(x)
J M(s) man(socrates)
∴ S(s) ∴mortal(socrates)
Quantifiers
J Universal quantifier
J Notation: ∀
J “for all”
J Ex. “(∀x)M(x)” or “∀x : M(x)”
J Existential quantifier
J Notation: ∃
J “exists, there is”
J Ex. “(∃x)M(x)” of “∃x : M(x)”
17
Often used formulas
J All A are B:
J For all x: if x is A then x is B
J (∀x)(A(x) → B(x))
J Some A are B:
J There is x: x is A and x is B
J (∃x)(A(x) ∧ B(x))
Warning
J (∃y)(∀x)A(x,y)
• There is a y such that for all x, A(x,y)
• There is a woman y such that for all man x, mother(x,y)
18
Quantifiers in finite domains
J (∃x)A(x) ↔ ¬(∀x)¬A(x)
J (∀x)A(x) ↔ ¬(∃x)¬A(x)
19
Inference
J Modus ponens
Next module:
20
41 20-11-2007 DKS - Module 3
21