Introduction to Logic
Propositional Analysis
Michael Genesereth
Computer Science Department
Stanford University
Syntax and Semantics
Syntax of Propositional Logic
¬p
(p ∧ q)
(p ∨ q)
(p ⇒ q)
(p ⇔ q)
Semantics of Propositional Logic
φ ¬φ φ ψ φ ∧ψ φ ψ φ ∨ψ φ ψ φ ⇒ψ φ ψ φ ⇔ψ
T F T T T T T T T T T T T T
F T T F F T F T T F F T F F
F T F F T T F T T F T F
F F F F F F F F T F F T
Evaluation versus Satisfaction
Evaluation:
pi = T ( p ∨ q)i = T
qi = F (¬q)i = T
Satisfaction:
( p ∨ q)i = T pi = T
(¬q)i = T qi = F
Programme for Today
Properties of Sentences
Validity, Contingency, Unsatisfiability
Satisfiability and Falsifiability
Relationships between Sentences
Equivalence, Entailment, Consistency
Useful "Metatheorems"
Equivalence, Unsatisfiability, Deduction, Consistency
Substitution, Monotonicity, Ramification
Properties of Sentences
Truth Tables
A truth table is a table of all possible interpretations
for the propositional constants in a language.
p q r
T T T
T T F One column per constant.
T F T
T F F One row per interpretation.
F T T
F T F For a language with n constants,
there are 2n interpretations.
F F T
F F F
Example
Oddities
Properties of Sentences
A sentence is valid if and only if
Valid
every interpretation satisfies it.
A sentence is contingent if and only if
Contingent some interpretation satisfies it and
some interpretation falsifies it.
A sentence is unsatisfiable if and
Unsatisfiable
only if no interpretation satisfies it.
Properties of Sentences
Valid
A sentences is satisfiable if and only
} if it is either valid or contingent.
Contingent
A sentences is falsifiable if and only
} if it is contingent or unsatisfiable.
Unsatisfiable
Possible Worlds
Possible Worlds
Possible Worlds
Possible Worlds
Possible Worlds
Possible Worlds
Valid Equivalences
Double Negation:
p ⇔ ¬¬p
deMorgan's Laws:
¬(p ∧ q) ⇔ (¬p ∨ ¬q)
¬(p ∨ q) ⇔ (¬p ∧ ¬q)
Implications:
(p ⇒ q) ⇔ (¬p ∨ q)
Biconditionals:
(p ⇔ q) ⇔ ((p ⇒ q) ∧ (q ⇒ p))
Valid Implications
Implication Introduction:
p ⇒ (q ⇒ p)
Implication Distribution
(p ⇒ (q ⇒ r)) ⇒ ((p ⇒ q) ⇒ (p ⇒ r))
Implication Reversal
(¬q ⇒ ¬p) ⇒ (p ⇒ q)
Relationships Between Sentences
Comparison of Sentences
Logical Equivalence
A sentence φ is logically equivalent to a sentence ψ if
and only they have the same value for every
propositional interpretation.
(p ⇒ q) is logically equivalent to (¬p ∨ q)
p is logically equivalent to ¬¬p
(p ∧ q) is not logically equivalent to (p ∨ q)
Another Comparison of Sentences
Logical Entailment
A premise ϕ logically entails a conclusion ψ (written as
ϕ ⊨ ψ) if and only if every interpretation that satisfies ϕ
also satisfies ψ.
(p ∧ q) ⊨ (p ∨ q)
p ⊨ (p ∨ q)
(p ∧ q) ⊨ p
p ⊭ (p ∧ q)
Logical Entailment ≠ Logical Equivalence
p ⊨ (p ∨ q)
(p ∨ q) ⊭ p
Analogy in arithmetic: inequalities rather than equations
Sets of Premises
A set of premises Δ logically entails a conclusion ϕ
(written as Δ ⊨ ϕ) if and only if every interpretation that
satisfies all of the premises also satisfies the conclusion.
{p, q} ⊨ (p ∧ q)
Sets of Conclusions
A premise ϕ logically entails a set of conclusions if and
only if every interpretation that satisfies the premise
satisfies all of the conclusions.
(p ∧ q) ⊨ {p, q}
Validities
If {} ⊨ ϕ , then ϕ is valid.
Examples:
{} ⊨ p ∨ ¬p
{} ⊭ p
{} ⊭ p ∧ ¬p
The empty set of premises is satisfied by every
interpretation. Consequently, if it entails a sentence, that
sentence must be true in every interpretation, i.e. it is valid.
Vacuity
If Δ is unsatisfiable, then Δ ⊨ ϕ for all ϕ.
Examples:
{p, ¬p} ⊨ p
{p, ¬p} ⊨ ¬p
{p, ¬p} ⊨ q
By definition, an unsatisfiable set of sentences is not
satisfied by any interpretation. Consequently, it is trivially
true that every interpretation that satisfies that set satisfies
every sentence.
Unsatisfiable assumptions entail everything!!!
Monotonicity
If Γ ⊨ ϕ and Γ ⊆ Δ, then Δ ⊨ ϕ.
Example: {p, q} ⊨ p ∧ q
Therefore {p, q, r} ⊨ p ∧ q
The more you know, the more is entailed.
Ramification
If Ω ⊨ Δ and Γ ⊆ Δ, then Ω ⊨ Γ.
Example: {p ∧ q} ⊨ {p, q}.
Therefore {p ∧ q} ⊨ {p}.
If you can conclude more, you can conclude less.
Third Comparison of Sentences
Logical Consistency
A sentence φ is consistent with a sentence ψ if and only
if there is a truth assignment that satisfies both φ and ψ.
p is logically consistent with q
(p ∨ q) is logically consistent with (¬p ∨ ¬q)
(p ⇒ q) is logically consistent with (¬p ∨ q)
p is not consistent with ¬p
Is (p ∧ ¬p) logically consistent with (q ∧ ¬q)?
Is (p ∧ ¬p) logically consistent with (p ∧ ¬p)?
Connections
Propositional Metatheorems
A metatheorem is a theorem about logic.
Monotonicity Theorem
Ramification Theorem
Equivalence Theorem
Substitution Theorem
Deduction Theorem
Unsatisfiability Theorem
Consistency Theorem
Monotonicity Theorem
If Γ ⊨ ϕ and Γ ⊆ Δ, then Δ ⊨ ϕ.
Example: {p, q} ⊨ p ∧ q
Therefore {p, q, r} ⊨ p ∧ q
The more you know, the more is entailed.
Ramification Theorem
If Ω ⊨ Δ and Γ ⊆ Δ, then Ω ⊨ Γ.
Example: {p ∧ q} ⊨ {p, q}
Therefore {p ∧ q} ⊨ {p}
If you can conclude more, you can conclude less.
Equivalence Theorem
Theorem: A sentence φ and a sentence ψ are logically
equivalent if and only if the sentence (φ ⇔ ψ) is valid.
¬(p ∧ q) is logically equivalent to (¬p ∨ ¬q)
if and only if
(¬(p ∧ q) ⇔ (¬p ∨ ¬q)) is valid
Upshot: We can determine equivalence of sentences by
checking validity of a single sentence.
Upshot: We can demonstrate validity of a biconditional by
checking equivalence of the constituents.
Equivalence Theorem
Substitution Theorem
Let χϕ←ψ stand for a copy of χ where zero or more
occurrences of ϕ have been replaced by ψ.
Example: Let χ = (¬¬p ∨ q), then χ¬¬p←p = (p ∨ q).
Substitution Theorem: If(ϕ ⇔ ψ) is valid, then the
sentence χϕ←ψ is logically equivalent to χ.
Example: Since (p ⇔ ¬¬p) is valid, we know that the
sentence (¬¬p ∨ q) is logically equivalent to (p ∨ q).
Substitution Example
Deduction Theorem
Theorem: A sentence φ logically entails a sentence ψ if
and only if (φ ⇒ ψ) is valid.
More generally, a finite set of sentences {φ1, ... , φ}
logically entails φ if and only if the compound sentence
(φ1 ∧ ... ∧ φn ⇒ φ) is valid.
Is ((p⇒q) ∧ (m ⇒ p∨q) ⇒ (m⇒q)) valid?
{(p⇒q), (m ⇒ p∨q)} ⊨ (m⇒q)?
Upshot: We can determine logical entailment between
sentences by checking validity of a single sentence. And
vice versa.
Deduction Theorem
{(m ⇒ p∨q), (p⇒q)} ⊨ (m⇒q)?
Is ((m ⇒ p∨q) ∧ (p⇒q) ⇒ (m⇒q)) valid?
Unsatisfiability Theorem
Theorem: Δ ⊨ ϕ if and only if Δ ∪ {¬ϕ} is unsatisfiable.
Proof: Suppose that Δ ⊨ ϕ. If an interpretation satisfies Δ, then it
must also satisfy ϕ. But then it cannot satisfy ¬ϕ. Therefore, Δ ∪
{¬ϕ} is unsatisfiable.
Suppose that Δ ∪ {¬ϕ} is unsatisfiable. Then every interpretation
that satisfies Δ must fail to satisfy ¬ϕ, i.e. it must satisfy ϕ.
Therefore, Δ ⊨ ϕ.
Upshot: We can determine logical entailment between
sentences by checking unsatisfiability of a set of sentences.
Translation: Assume false and show contradiction.
Consistency Theorem
Theorem: A sentence φ is logically consistent with a
sentence ψ if and only if the sentence (φ ∧ ψ) is
satisfiable. More generally, a sentence φ is logically
consistent with a finite set of sentences {φ1, ... , φn} if and
only if the compound sentence (φ1 ∧ ... ∧ φn ∧ φ) is
satisfiable.
Is (p ∨ q) consistent with (¬p ∨ ¬q)?
Is ((p ∨ q) ∧ (¬p ∨ ¬q)) satisfiable?
Upshot: We can determine consistency of sentences by
checking satisfiability of a single sentence.
Metareasoning
CS 157 Quiz Question #1
Is the sentence (p ⇒ q) ⇔ (p ⇒ (q ⇒ p)) valid, contingent,
or unsatisfiable?
CS 157 Quiz Question #1
Is the sentence (p ⇒ q) ⇔ (p ⇒ (q ⇒ p)) valid, contingent,
or unsatisfiable?
p q (p ⇒ q) ⇔ (p ⇒ (q ⇒ p))
1 1 1
1 0 0
0 1 1
0 0 1
CS 157 Quiz Question #1
Is the sentence (p ⇒ q) ⇔ (p ⇒ (q ⇒ p)) valid, contingent,
or unsatisfiable?
(p ⇒ q) is sometimes true and sometimes false.
(p ⇒ (q ⇒ p)) is always true, i.e. it is a valid sentence.
(p ⇒ q)i = (p ⇒ (q ⇒ p))i for some i.
(p ⇒ q)i ≠ (p ⇒ (q ⇒ p))i for some i.
(p ⇒ q) ⇔ (p ⇒ (q ⇒ p)) is contingent.
CS 157 Quiz Question #2
Is the sentence ((p ⇔ ¬q) ⇒ (¬p | ¬q)) valid, contingent,
or unsatisfiable?
CS 157 Quiz Question #2
Is the sentence ((p ⇔ ¬q) ⇒ (¬p | ¬q)) valid, contingent,
or unsatisfiable?
p q ((p ⇔ ¬q) ⇒ (¬p | ¬q))
1 1 1
1 0 1
0 1 1
0 0 1
CS 157 Quiz Question #2
Is the sentence ((p ⇔ ¬q) ⇒ (¬p | ¬q)) valid, contingent,
or unsatisfiable?
((p ⇔ ¬q) ⇒ (¬p | ¬q))
CS 157 Quiz Question #2
Is the sentence ((p ⇔ ¬q) ⇒ (¬p | ¬q)) valid, contingent,
or unsatisfiable?
(p ⇔ ¬q) ⇒ (¬p | ¬q)
(p ⇔ ¬q) ⇒ (p ⇒ ¬q)
Substitution Theorem
and
(p ⇒ ¬q) ⇔ (¬p | ¬q)
CS 157 Quiz Question #2
Is the sentence ((p ⇔ ¬q) ⇒ (¬p | ¬q)) valid, contingent,
or unsatisfiable?
((p ⇔ ¬q) ⇒ (¬p | ¬q))
(p ⇔ ¬q) ⇒ (p ⇒ ¬q)
(p ⇒ ¬q) ∧ (¬q ⇒ p) ⇒ (p ⇒ ¬q)
Substitution Theorem
and
(p ⇔ ¬q) ⇔ (p ⇒ ¬q) ∧ (¬q ⇒ p)
CS 157 Quiz Question #2
Is the sentence ((p ⇔ ¬q) ⇒ (¬p | ¬q)) valid, contingent,
or unsatisfiable?
((p ⇔ ¬q) ⇒ (¬p | ¬q))
(p ⇔ ¬q) ⇒ (p ⇒ ¬q)
(p ⇒ ¬q) ∧ (¬q ⇒ p) ⇒ (p ⇒ ¬q)
(p ⇒ ¬q) ∧ (¬q ⇒ p) ⊨ (p ⇒ ¬q)
Deduction Theorem
CS 157 Quiz Question #2
Is the sentence ((p ⇔ ¬q) ⇒ (¬p | ¬q)) valid, contingent,
or unsatisfiable?
((p ⇔ ¬q) ⇒ (¬p | ¬q))
(p ⇔ ¬q) ⇒ (p ⇒ ¬q)
(p ⇒ ¬q) ∧ (¬q ⇒ p) ⇒ (p ⇒ ¬q)
(p ⇒ ¬q) ∧ (¬q ⇒ p) ⊨ (p ⇒ ¬q)
{(p ⇒ ¬q), (¬q ⇒ p)} ⊨ (p ⇒ ¬q)
Definition of Entailment
Definition of Conjunction
CS 157 Quiz Question #2
Is the sentence ((p ⇔ ¬q) ⇒ (¬p | ¬q)) valid, contingent,
or unsatisfiable?
((p ⇔ ¬q) ⇒ (¬p | ¬q))
(p ⇔ ¬q) ⇒ (p ⇒ ¬q)
(p ⇒ ¬q) ∧ (¬q ⇒ p) ⇒ (p ⇒ ¬q)
(p ⇒ ¬q) ∧ (¬q ⇒ p) ⊨ (p ⇒ ¬q)
{(p ⇒ ¬q), (¬q ⇒ p)} ⊨ (p ⇒ ¬q)
{(p ⇒ ¬q)} ⊨ (p ⇒ ¬q)
Monotonicity Theorem
CS 157 Quiz Question #3a
Let Γ and Δ be arbitrary sets of sentences.
Let ϕ be an arbitrary sentence.
If Γ ⊨ ϕ and Δ ⊨ ϕ, does Γ ∪ Δ ⊨ ϕ?
CS 157 Quiz Question #3a
Let Γ and Δ be arbitrary sets of sentences.
Let ϕ be an arbitrary sentence.
Is Γ ⊨ ϕ and Δ ⊨ ϕ, does Γ ∪ Δ ⊨ ϕ?
Let Γ be {p} and Δ be {q} and ϕ be (p ∨ q).
Obviously {p} ⊨ p ∨ q
Obviously {q} ⊨ p ∨ q
But {p} ∪ {q} = {p, q} and {p, q} ⊨ p ∨ q
Does this work for all Γ and Δ and ϕ?
Yes, by Monotonicity Theorem.
CS 157 Quiz Question #3b
Let Γ and Δ be arbitrary sets of sentences.
Let ϕ be an arbitrary sentence.
Is Γ ⊨ ϕ and Δ ⊨ ϕ, does Γ ∩ Δ ⊨ ϕ?
CS 157 Quiz Question #3b
Let Γ and Δ be arbitrary sets of sentences.
Let ϕ be an arbitrary sentence.
Is Γ ⊨ ϕ and Δ ⊨ ϕ, does Γ ∩ Δ ⊨ ϕ?
Let Γ be {p} and Δ be {q} and ϕ be (p ∨ q).
Obviously {p} ⊨ p ∨ q
Obviously {q} ⊨ p ∨ q
But {p} ∩ {q} = {} and {} ⊭ p ∨ q.
Answer to our question: No.
Tools
Course Website
http://logica.stanford.edu