Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
A PPLICATIONS
1 – I NTRODUCTION TO P ROPOSITIONAL L OGIC
odinaldo.rodrigues@kcl.ac.uk
Room BH(N)7.08, +44 (0)20 7848 2087
Department of Informatics
King’s College London
Outline
1. Building blocks
2. Formal Language
3. Translating
4. Syntactical Tree
5. Semantics
6. Truth-tables
7. Logic puzzles
9. Equivalences
Building blocks
Examples
Connectives:
not (unary) if . . . , then . . . (binary)
and (binary) if and only if . . . (binary)
or (binary)
c Dr. Odinaldo Rodrigues
Elementary Logic with Applications: 1 – Introduction to Propositional Logic (1) 5 / 41
Building blocks
Examples
In English, we use the connective not after the verb, so the above is
actually uttered as:
Formal Language
Propositional language
P, Q, R, . . . , P1 , Q1 , . . .
T RANSLATING
Translating
Let the symbol P represent the proposition “Bob likes Mary”, and Q
represent the proposition “Bob likes Sue”.
Then:
Translation one: B → (S ∧ J)
Translation two: (B → S) ∧ J
S YNTACTICAL T REE
Syntactical Tree
¬P ∧ (Q ∨ R) ¬¬(Q ↔ ¬R) ∧ ¬
P Q R Q ↔ ¬R) P Q R ↔
Q ¬R Q ¬
R R
Each node of the tree on the left is a subformulae of the formula at its
root. These subformulae correspond to subtrees of the tree on the
right.
c Dr. Odinaldo Rodrigues
Elementary Logic with Applications: 1 – Introduction to Propositional Logic (1) 18 / 41
S EMANTICS
Semantics
Semantics
The syntax of the language determine how statements are formed and
evaluated, but it gives them no truth-values.
T RUTH - TABLES
Truth-tables
A ¬A
0 1
1 0
Think of the symbol “A” here as a placeholder for any given formula,
and not necessarily as the propositional symbol “A”.
c Dr. Odinaldo Rodrigues
Elementary Logic with Applications: 1 – Introduction to Propositional Logic (1) 22 / 41
Truth-tables
Corresponding truth-table:
A B A∧B
0 0 0
0 1 0
1 0 0
1 1 1
Corresponding truth-table:
A B A∨B
0 0 0
0 1 1
1 0 1
1 1 1
Corresponding truth-table:
A B A→B
0 0 1
0 1 1
1 0 0
1 1 1
Corresponding truth-table:
A B A↔B
0 0 1
0 1 0
1 0 0
1 1 1
Class exercise
Logic puzzles
The island of TuFa has two tribes, the Tu’s who always tell the truth,
and the Fa’s who always lie.
Let P be the statement “P is telling the truth” (and thus P is a Tu), etc.
P says: (Q ∧ R) ↔ R
Q says: (P ∧ R) → ¬ ((Q ∧ R) → P)
R says: ¬ Q ↔ (P ∨ Q).
A: P ↔ ((Q ∧ R) ↔ R),
C: R ↔ (¬ Q ↔ (P ∨ Q)).
c Dr. Odinaldo Rodrigues
Elementary Logic with Applications: 1 – Introduction to Propositional Logic (1) 32 / 41
Logic puzzles
v P Q R A = P ↔ ((Q ∧ R) ↔ R) B C A∧B∧C
v0 0 0 0 0 0 1 0
v1 0 0 1 1 0 0 0
v2 0 1 0 0 1 1 0
v3 0 1 1 0 1 0 0
v4 1 0 0 1 0 0 0
v5 1 0 1 0 1 1 0
v6 1 1 0 1 1 1 1
v7 1 1 1 1 0 0 0
Tautologies
Some formulae are special.
A ¬A A ∨ ¬A
0 1 1
1 0 1
Contradictions
A ¬A A ∧ ¬A
0 1 0
1 0 0
E QUIVALENCES
Equivalences
Logical Equivalences
Two formulae A and B are said to be equivalent if they have the same
truth-value under every possible interpretation.
# A ≡ B;
# A ↔ B is a tautology.
A B A→B ¬A ¬A ∨ B
0 0 1 1 1
0 1 1 1 1
1 0 0 0 0
1 1 1 0 1
(A → B) ≡ (¬A ∨ B).
Rephrasing Equivalence
(A ↔ B) ≡ (A → B) ∧ (B → A)
To know more. . .