Predicate Logic Create
Predicate Logic Create
&
Reasoning
Part II
Predicate Logic
(First-Order Predicate Logic)
Course on AI@IID
Mannes Poel
Designing rational agents
• Knowledge/logic based approach to designing
and implementing the ? component of
rational agents.
• Example:
∀𝑥𝑥 𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃 𝑥𝑥, 𝐴𝐴𝐴𝐴 ⇒ 𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆 𝑥𝑥
∀𝑥𝑥 𝐻𝐻𝐻𝐻𝐻𝐻𝐻𝐻𝐻𝐻 𝑥𝑥 ⇒ ∃𝑦𝑦 𝐿𝐿𝐿𝐿𝐿𝐿𝐿𝐿𝐿𝐿 𝑥𝑥, 𝑦𝑦
Course on AI@IID: 2018-2019 10
Exercise
• How do we model in Predicate Logic the
sentence “All students who take the course on
AI are smart”?
𝑀𝑀(𝛼𝛼)
𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶(𝐶𝐶) where C
new constant referring
to the crown.
C is called a Skolem
constant.
1. Transforming to CNF
2. Unification
3. Resolution
1. Replace all A ⇔ B by (A ⇒ B) ∧ (B ⇒ A)
2. Replace all A ⇒ B by ¬A ∨ B
3. Move negation signs inwards starting from the outside
until every negation sign is directly in front of a literal
4. Remove quantifiers
5. Distribute ∨ over ∧ until you obtain CNF
¬𝐺𝐺𝐺𝐺𝐺𝐺𝐺𝐺𝐺𝐺𝐺𝐺𝐺𝐺𝐺𝐺𝐺𝐺𝐺𝐺𝐺𝐺 𝑥𝑥, 𝑦𝑦 ∨
[𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃(𝑥𝑥, 𝑆𝑆(𝑥𝑥, 𝑦𝑦)) ∧ 𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃(𝑆𝑆(𝑥𝑥, 𝑦𝑦), 𝑦𝑦)]
(distributivity)
𝑥𝑥 = 𝐺𝐺
𝑦𝑦 = 𝐽𝐽𝐽𝐽𝐽𝐽𝐽
𝑥𝑥 = 𝐺𝐺
𝑦𝑦 = 𝐽𝐽𝐽𝐽𝐽𝐽𝐽
𝑤𝑤 = 𝑆𝑆(𝐺𝐺, 𝐽𝐽𝐽𝐽𝐽𝐽𝐽)
𝑥𝑥 = 𝐺𝐺
𝑦𝑦 = 𝐽𝐽𝐽𝐽𝐽𝐽𝐽
𝑤𝑤 = 𝑆𝑆(𝐺𝐺, 𝐽𝐽𝐽𝐽𝐽𝐽𝐽)