U - III Propositional Logic
U - III Propositional Logic
First-Order Logic
19CS15E – Artificial Intelligence
Unit III – Knowledge Representation
CO: Represent a problem using first order and
predicate logic
By
Dr.V.Gomathi, Prof. & Head/ CSE
NEC, Kovilpatti
Introduction to Logic
⚫ Logic is a great knowledge
representation language for many
AI problems
⚫ Propositional logic (PL) is the
simple foundation and fine for
some AI problems
⚫ First order logic (FOL) is much
more expressive as a KR language
and more commonly used in AI
⚫ There are many variations: horn
logic, higher order logic,
Propositional logic
⚫ Logical constants: true, false
⚫ Propositional symbols: P, Q,... (atomic
sentences)
⚫ Wrapping parentheses: ( … )
⚫ Sentences are combined by connectives:
∧ and [conjunction]
∨ or [disjunction]
⇒ implies [implication /
conditional]
⇔ is equivalent [biconditional]
¬ not [negation]
⚫ Literal: atomic sentence or negated
atomic sentence
P, ¬ P
Formal Grammar of PL
Sentence 🡪 Atomic Sentence | Complex
Sentence
12
Proving W13
~S11
(R1) ~S11 => ~W11 ^ ~W12 ^ ~W21
We can prove
that the
Wumpus is in
(1,3) using the
four rules
given.
See R&N
section 7.5
Proving W13
Apply MP with ¬S11 and R1:
¬ W11 ∧ ¬ W12 ∧ ¬ W21
Apply And-Elimination to this, yielding 3 sentences:
¬ W11, ¬ W12, ¬ W21
Apply MP to ~S21 and R2, then apply And-elimination:
¬ W22, ¬ W21, ¬ W31
Apply MP to S12 and R4 to obtain:
W13 ∨ W12 ∨ W22 ∨ W11
Apply Unit resolution on (W13 ∨ W12 ∨ W22 ∨ W11)
and ¬W11:
W13 ∨ W12 ∨ W22
Apply Unit Resolution with (W13 ∨ W12 ∨ W22) and
¬W22:
W13 ∨ W12
Apply UR with (W13 ∨ W12) and ¬W12:
W13
Propositional Wumpus hunter problems
⚫ Lack of variables prevents stating more
general rules
⚫ We need a set of similar rules for each
cell
⚫ Change of the KB over time is difficult
to represent
⚫ Standard technique is to index facts
with the time when they’re true
⚫ This means we have a separate KB for
every time point
Propositional logic summary
⚫ Inference is the process of deriving new
sentences from old
⚫ Sound inference derives true conclusions given
true premises
⚫ Complete inference derives all true
conclusions from a set of premises
⚫ A valid sentence is true in all worlds under all
interpretations
⚫ If an implication sentence can be shown to be
valid, then—given its premise—its
consequent can be derived
⚫ Different logics make different commitments
about what the world is made of and what