Professional Documents
Culture Documents
Propositional Logic
Propositional Logic
Propositional Logic
Lecture 4
Propositional Logic
3-11-2022
Outline
Revision of propositional logic, models, entailment,
validity, and satisfiability.
Inference rules and theorem proving
Resolution inference rule
Conjunctive Normal Form
Resolution Algorithm
Propositional logic
Propositional logic deals with individual propositions,
which are viewed as atoms which cannot be further
broken down into smaller constituents.
Propositional symbols: P, Q, R, …
Each of these symbols represents some fact or
symbols about the world.
Connectors can be used to connect these symbols.
Syntax of propositional logic
BNF grammar of sentences in propositional logic:
Sentence → AtomicSentence | ComplexSentence
AtomicSentence → True | False | P | Q | R | …
ComplexSentence → (Sentence) | [Sentence]
What is the | Sentence
terminals and | Sentence Sentence
non-terminals of
this grammar? | Sentence Sentence
| Sentence Sentence
| Sentence Sentence
Operator Precedence : , , , ,
Syntactic derivation
To prove that a given sentence is syntactically correct, either a parse
tree or syntactic derivation (derivation) can be constructed.
Example: a derivation of P ∧ Q ⇒ R
E.g. P Q R
False True False
With these symbols, 8 possible models, can be enumerated automatically.
Knowledge base KB entails sentence α if and only if α is true in all worlds where KB is
true
Examples:
the KB containing “All men are mortal” and “Socrates is a man” entails “Socrates is
mortal”
x + y = 4 entails 4 = x + y
α = Adam won
E.g., x = 0 entails xy = 0
Model checking proof method
Enumeration of models (models are assignments of true
or false to every possible symbol)
To determine if KB ╞ α:
◼ Enumerate all possible models.
◼ If in every model where KB is true, α is true, then KB entails α
◼ Otherwise, KB does not entail α
Inference (deduction)
𝛼 ⟹ 𝛽, 𝛼
𝛽
Example,
α The light is on
α⇒β if the light is on then the switch is on
----------
β the switch is on
Inference rules
Modus Tollens
𝛼⇒𝛽, ¬𝛽
¬𝛼
Example,
α⇒β if the light is on then the switch is on
¬𝛽 the switch is not on
----------
¬𝛼 the light is not on
Inference rules
And elimination
𝛼𝛽
𝛼
𝛼⇔𝛽
(𝛼⇒𝛽)(𝛽⇒𝛼)
(𝛼 ⇒ 𝛽)(𝛽 ⇒ 𝛼)
𝛼⇔𝛽
Inference rules
Double negation elimination
¬(¬ 𝛼 )
α
Logical equivalence
α ≡ ß iff α╞ β and β╞ α
Validity and satisfiability
A sentence is valid if it is true in all models,
e.g., True, A A, A A, (A (A B)) B
Valid sentences are also known as tautology
Validity is connected to inference via the Deduction Theorem:
KB ╞ α if and only if (KB α) is valid
A B C AC B C KB α
False False False False True False False
False False True True False False False
False True False False True False True
False True True True True True True
True False False True True True True
KB╞ α
True False True True False False True
True True False True True True True
True True True True True True True
Example 1
A B C AC B C KB α KB⇒𝛼
False False False False True False False True
False False True True False False False True
False True False False True False True valid
True
False True True True True True True
True
True False False True True True True
True
True False True True False False True
True
True True False True True True True
True
True True True True True True True
Example 2
Determine the logical consequence of
S = (P∨ R) ∧(Q ∨ R) from T= {P, Q}, (T ╞ S)
P Q R P R QR T S
False False False False True False False
False False True True True False True
False True False False True False False
T╞ S
False True True True False False False S is true in
True False False True True True True every
model in
True False True True True True True
which T is
True True False True True False True True
True True True True False False False
Inference Rules Examples
Example 1
Show that
{A, B ⇒ C, ( A ∧B ) ⇒ (C ∨ D), B } ⊢ D
1. A hypothesis
2. B ⇒ C hypothesis
3. ( A ∧B ) ⇒ (C ∨ D) hypothesis
4. B hypothesis
B ⇒ C B
From 2, 4 Modus Ponens
C
5.
Example 1 (Cont.)
𝐴 𝐵
6. From 1, 4 ∧ introduction
𝐴∧𝐵
( A ∧B ) ⇒ (C ∨ D) 𝐴 ∧𝐵
7. From 3, 6 Modus Ponens
𝐶 ∨𝐷
C 𝐶 ∨𝐷
8. From 5, 7 ∨-elimination
𝐷
Note
Finding a proof is a search problem.
A state is a set of sentences.
The initial state is the initial KB.
The actions consists of all the inference rules
applied to all sentences in KB.
The goal state is the sentence we are trying to
prove.
Monotonicity
A property of logical systems.
If KB ⊨ α then KB ∧ 𝛽 ⊨ α
Semantic tableau
Checking for satisfiability of propositional logic sentence can be
performed by truth tables.
Semantic tableau is another efficient method for deciding
satisfiability for sentences.
The method (or algorithm) systematically searches for a model
for a formula. If it is found, the formula is satisfiable, else not
satisfiable.
A literal is an atomic sentence or negation of it.
For any atom P, the set {P, P} is complementary pair of
literals.
For any sentence S, {S, S} is complementary pair of sentence.
Example 1 of analysis of the satisfiability
of a sentence
For a sentence A = P ∧ ( Q ∨ P), has an arbitrary model (or
interpretation) M.
M(A) = True iff M(P) = True and M( Q ∨ P) = True .
Hence, M(A) = True iff either:
1. M(P) = True and M(¬Q) = True, or
2. M(P) = True and M(¬P) = True
Therefore, A is satisfiable if either, model 1 holds or model 2 holds.
Model 2 is not possible, then A is satisfiable when the model 1 holds true.
The satisfiability of a formula is reduced to the satisfiability of literals.
A set of literals is satisfied if and only if it does not contain complementary
pair of literals.
Example 1 of analysis of the satisfiability
of a sentence
For a sentence A = P ∧ ( Q ∨ P), has an arbitrary
model (or interpretation) M.
M(A) = True iff M(P) = True and M( Q ∨ SinceP)there
= True
is .
a model for
Hence, M(A) = True iff either: the sentence
(P=True and
1. M(P) = True and M(¬Q) = True, or Q= False) it is
satisfiable
(P ∨ Q) ∧ (P ∧Q)
(P ∨ Q) , (P ,Q)
P, P ,Q Q, P ,Q
x x
Resolution inference rule
PQ
P
Q
Example,
Ramy is in the library Hany is in the library
Ramy is NOT in the library
Hany is in the library
Resolution
In general, for n proposition :
P 𝑄1 𝑄2 … 𝑄𝑛
P
𝑄1 𝑄2 … 𝑄𝑛
Resolution
Conjunctive Normal Form (CNF)
conjunction () of disjunctions of literals
clauses
E.g., (A B) (B C D)
l1 … lk, m1 … mn
l1 … li-1 li+1 … lk m1 … mj-1 mj+1 ... mn
P
P
empty clause which is always false
Note