0% found this document useful (0 votes)
48 views28 pages

AIFA 5 Predicate Logic Resolution 040923

The document discusses the process of converting first-order logic formulas to clause normal form. It involves the following steps: 1. Eliminating implications and moving negations inward to break formulas into clauses. 2. Introducing existential quantifiers and eliminating redundant quantifiers. 3. Renaming variables that are quantified more than once. 4. Skolemizing existential quantifiers by replacing them with function symbols. 5. Distributing conjunctions over disjunctions and applying Boolean algebra to obtain the conjunctive normal form (CNF). The resulting CNF consists of a set of clauses that can be used for resolution-based theorem proving. Various resolution strategies like unit

Uploaded by

Das Skrillex
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
48 views28 pages

AIFA 5 Predicate Logic Resolution 040923

The document discusses the process of converting first-order logic formulas to clause normal form. It involves the following steps: 1. Eliminating implications and moving negations inward to break formulas into clauses. 2. Introducing existential quantifiers and eliminating redundant quantifiers. 3. Renaming variables that are quantified more than once. 4. Skolemizing existential quantifiers by replacing them with function symbols. 5. Distributing conjunctions over disjunctions and applying Boolean algebra to obtain the conjunctive normal form (CNF). The resulting CNF consists of a set of clauses that can be used for resolution-based theorem proving. Various resolution strategies like unit

Uploaded by

Das Skrillex
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 28

Resolution in Predicate Logic

04/09/2023

Sudeshna Sarkar
Arnab Sarkar
Koustav Rudra
Conversion to Normal Form
• A formula is said to be in clause form if it is of the form:
• ∀!"∀!#… ∀!$ [C1∧C2 ∧… ∧Ck]
• Each of these clauses could be disjunction of some predicates

• All first-order logic formulas could be converted to clausal form

• ∀! {p(x)à ∃% {~∀& 𝑞 𝑥, 𝑦 à𝑝 𝑓 𝑥1 ∧ ∀& 𝑞 𝑥, 𝑦 à𝑝 𝑥 }}


Conversion to Normal Form
• Step1: Take the existential closure and eliminate redundant quantifiers. This
introduces ∃!" and eliminates ∃% , so:

• ∀! {p(x)à ∃% {~∀& 𝑞 𝑥, 𝑦 à𝑝 𝑓 𝑥1 ∧ ∀& 𝑞 𝑥, 𝑦 à𝑝 𝑥 }}

• ∃!" ∀! {p(x)à {~∀& 𝑞 𝑥, 𝑦 à𝑝 𝑓 𝑥1 ∧ ∀& 𝑞 𝑥, 𝑦 à𝑝 𝑥 }}


Conversion to Normal Form
• Step2: Rename any variable that is quantified more than once
• y has been quantified twice, so:

• ∃!" ∀! {p(x)à {~∀& 𝑞 𝑥, 𝑦 à𝑝 𝑓 𝑥1 ∧ ∀& 𝑞 𝑥, 𝑦 à𝑝 𝑥 }}

• ∃!" ∀! {p(x)à {~∀& 𝑞 𝑥, 𝑦 à𝑝 𝑓 𝑥1 ∧ ∀% 𝑞 𝑥, 𝑧 à𝑝 𝑥 }}


Conversion to Normal Form
• Step3: Eliminate implication

• ∃!" ∀! {p(x)à {~∀& 𝑞 𝑥, 𝑦 à𝑝 𝑓 𝑥1 ∧ ∀% 𝑞 𝑥, 𝑧 à𝑝 𝑥 }}

• ∃!" ∀! {~p(x) ∨ {~∀& ~𝑞 𝑥, 𝑦 ∨𝑝 𝑓 𝑥1 ∧ ∀% ~𝑞 𝑥, 𝑧 ∨𝑝 𝑥 }}


Conversion to Normal Form
• Step4: Move ~ all the way inwards

• ∃!" ∀! {~p(x) ∨ {~∀& ~𝑞 𝑥, 𝑦 ∨𝑝 𝑓 𝑥1 ∧ ∀% ~𝑞 𝑥, 𝑧 ∨𝑝 𝑥 }}

• ∃!" ∀! {~p(x) ∨ {∃& 𝑞 𝑥, 𝑦 ∧ ~𝑝 𝑓 𝑥1 ∧ ∀% ~𝑞 𝑥, 𝑧 ∨𝑝 𝑥 }}


Conversion to Normal Form
• Step5: Push the quantifiers to the right

• ∃!" ∀! {~p(x) ∨ {∃& 𝑞 𝑥, 𝑦 ∧ ~𝑝 𝑓 𝑥1 ∧ ∀% ~𝑞 𝑥, 𝑧 ∨𝑝 𝑥 }}

• ∃!" ∀! {~p(x) ∨ { ∃& 𝑞 𝑥, 𝑦 ∧ ~𝑝 𝑓 𝑥1 ∧ ∀% ~𝑞 𝑥, 𝑧 ∨𝑝 𝑥 }}


Conversion to Normal Form
• Step6: Eliminate existential quantifier (Skolemization)

• ∃!" ∀! {~p(x) ∨ { ∃# 𝑞 𝑥, 𝑦 ∧ ~𝑝 𝑓 𝑥1 ∧ ∀$ ~𝑞 𝑥, 𝑧 ∨𝑝 𝑥 }}
• Pick out leftmost ∃# B(y) and replace it by B(F(xi1, xi2,…, xin)), where:
• xi1, xi2,…, xin are all the distinct free variables of ∃# B(y) that are universally quantified to the
left of ∃# B(y), and
• F is any n-ary function constant which does not occur already

• ∀!" ∀!% ∀!& ∃# B(y, 𝑥1, 𝑥2, 𝑥3)


• ∀!" ∀!% ∀!& B(F(𝑥1, 𝑥2, 𝑥3), 𝑥1, 𝑥2, 𝑥3)
• ∀!" ∀!% ∀!& ∃# [B1(y, 𝑥1) ∧ B2(𝑥1, 𝑥2)∧ B3(𝑥2, 𝑥3)]
• ∀!" ∀!% ∀!& [B1(F(𝑥1, 𝑥2, 𝑥3), 𝑥1) ∧ B2(𝑥1, 𝑥2)∧ B3(𝑥2, 𝑥3)]
Conversion to Normal Form
• Step6: Eliminate existential quantifier (Skolemization)

• ∃!" ∀! {~p(x) ∨ { ∃& 𝑞 𝑥, 𝑦 ∧ ~𝑝 𝑓 𝑥1 ∧ ∀% ~𝑞 𝑥, 𝑧 ∨𝑝 𝑥 }}

• ∀! {~p(x) ∨ { 𝑞 𝑥, 𝑔(𝑥) ∧ ~𝑝 𝑓 𝑎 ∧ ∀% ~𝑞 𝑥, 𝑧 ∨𝑝 𝑥 }}
Conversion to Normal Form
• Step7: Move all universal quantifiers to the left

• ∀! {~p(x) ∨ { 𝑞 𝑥, 𝑔(𝑥) ∧ ~𝑝 𝑓 𝑎 ∧ ∀% ~𝑞 𝑥, 𝑧 ∨𝑝 𝑥 }}

• ∀! ∀% {~p(x) ∨ { 𝑞 𝑥, 𝑔(𝑥) ∧ ~𝑝 𝑓 𝑎 ∧ ~𝑞 𝑥, 𝑧 ∨𝑝 𝑥 }}

• Right side we have a set of predicates that are quantified from outside
Conversion to Normal Form
• Step8: Distribute ∧ over ∨

• ∀! ∀% {~p(x) ∨ { 𝑞 𝑥, 𝑔(𝑥) ∧ ~𝑝 𝑓 𝑎 ∧ ~𝑞 𝑥, 𝑧 ∨𝑝 𝑥 }}

• ∀! ∀% {[~p(x) ∨ 𝑞 𝑥, 𝑔(𝑥) ∧ ~𝑝 𝑓 𝑎 ]∧ [~p(x)∨ ~𝑞 𝑥, 𝑧 ∨𝑝 𝑥 }

• ∀! ∀% {[~p(x) ∨ 𝑞 𝑥, 𝑔(𝑥) ] ∧ ~p(x) ∨ ~𝑝 𝑓 𝑎 ∧ [~p(x)∨~𝑞 𝑥, 𝑧 ∨𝑝 𝑥 ]}

• Right side we have a set of predicates that are quantified from outside
• Use Boolean algebra to get CNF
Resolution Refutation Proof
Procedure for Resolution
• Convert the set of rules and facts into clause form (conjunction of clauses)
• Insert the negation of the goal as another clause
• Use resolution to deduce a refutation

• If the refutation is obtained then the goal can be deduced from the set of facts and
rules

• 𝜑 : F1∧F2∧…∧FnàG
• 𝜑 : ~(F1∧F2∧…∧Fn)∨G Valid

• ~𝜑: F1∧F2∧…∧Fn∧~G Unsatisfiable


Resolution
• If Unify(zj, ~qk) = 𝜃

• z1∨… zm, q1∨…,qn

• SUBST(𝜃, z1∨…zi-1∨ zi-1 … zm ∨ q1∨… qk-1 ∨ qk+1 … ∨ qn)


Example
• Akash, Amit, and Arun are students of a school
• Every student is either wicked or is a good Cricket player, or both
• No Cricket player likes rain and all wicked students like potions
• Arun dislikes whatever Akash likes and likes whatever Akash dislikes
• Arun likes rain and potions

• Is there anyone who is good in Cricket but not in potions?


Representation in Predicate Logic
• Akash, Amit, and Arun are students of a school
• C1: Student(Akash)
• C2: Student(Amit)
• C3: Student(Arun)

• Every student is either wicked or is a good Cricket player, or both


• ∀! Student(x)àWicked(x) ∨ Cricket(x)
• C4: ~Student(x) ∨ Wicked(x) ∨ Cricket(x)
Representation in Predicate Logic
• No Cricket player likes rain and all wicked ones like potions
• ∀! Cricket(x)à~Likes(x, Rain)
• ∀! Wicked(x)àLikes(x, Potions)
• C5: ∀! ~Cricket(x) ∨ ~Likes(x, Rain)
• C6: ∀! ~Wicked(x) ∨ Likes(x, Potions)
Representation in Predicate Logic
• Arun dislikes whatever Akash likes and likes whatever Akash dislikes
• ∀! Likes(Akash, x) ⇔ ~Likes(Arun, x)
• ∀! [Likes(Akash, x) à~Likes(Arun, x)] ∧ [~Likes(Arun, x) àLikes(Akash, x)]
• C7: ∀! ~Likes(Akash, x) ∨ ~Likes(Arun, x)
• C8: ∀! Likes(Akash, x) ∨ Likes(Arun, x)

• Arun likes rain and potions


• C9: Likes(Arun, Rain)
• C10: Likes(Arun, Potions)
Representation in Predicate Logic
• Is there anyone who is good in Cricket but not in potions?
• G: ∃! Cricket(x) ∧ ~Likes(x, Potions)
• ~G: ∀! ~ Cricket(x) ∨ Likes(x, Potions)
• C11: ∀! ~ Cricket(x) ∨ Likes(x, Potions)
C10: Likes(Arun, C7: ~Likes(Akash, x) ∨ C1: Student(Akash)
Potions) ~Likes(Arun, x) C2: Student(Amit)
{x/Potions}
C3: Student(Arun)
C12: ~Likes(Akash, C11: ~ Cricket(x) ∨ C4: ~Student(x) ∨
Potions) Likes(x, Potions) Wicked(x) ∨ Cricket(x)
{x/Akash}
C5: ∀" ~Cricket(x) ∨
C6: ~Wicked(x) ∨ ~Likes(x, Rain)
C13: ~Cricket(Akash)
Likes(x, Potions)
How to make searchC6: ∀" ~Wicked(x) ∨
{x/Akash} procedure efficient?Likes(x, Potions)
C14: ~Wicked(Akash) C7: ∀" ~Likes(Akash, x)
FALSE ∨ ~Likes(Arun, x)
C8: ∀" Likes(Akash, x)
C16: Cricket(Akash) ∨ Likes(Arun, x)

C9: Likes(Arun, Rain)


C1: Student(Akash)
C15: Wicked(Akash) ∨ C10: Likes(Arun, Potions)
Cricket(Akash)
C4: ~Student(x) ∨ {x/Akash} C11: ∀" ~ Cricket(x) ∨
Wicked(x) ∨ Cricket(x) Likes(x, Potions)
Resolution Refutation Strategies
Resolution Strategies
• Unit Resolution
• Every resolution step must involve a unit clause

• Unit clause
• A clause that does not have any OR
• It just has one predicate or its negation

• Leads to a good speedup

• Incomplete in general
• There might be cases that can’t be deduced using unit resolution but can be
deduced using other resolution methods

• Complete for Horn knowledge bases


Resolution Strategies
• Input Resolution
• Every resolution step must involve an input sentence (from the query or KB)
• All can’t be derived clauses

• In Horn knowledge bases, Modus Ponens is a kind of input resolution strategy

• Incomplete in general

• Complete for Horn knowledge bases


C10: Likes(Arun, C7: ~Likes(Akash, x) ∨ C1: Student(Akash)
Potions) ~Likes(Arun, x) C2: Student(Amit)
{x/Potions}
C3: Student(Arun)
C12: ~Likes(Akash, C11: ~ Cricket(x) ∨ C4: ~Student(x) ∨
Potions) Likes(x, Potions) Wicked(x) ∨ Cricket(x)
{x/Akash}
C5: ∀" ~Cricket(x) ∨
C6: ~Wicked(x) ∨ ~Likes(x, Rain)
C13: ~Cricket(Akash)
Likes(x, Potions)
C6: ∀" ~Wicked(x) ∨
{x/Akash} Likes(x, Potions)
C14: ~Wicked(Akash) C7: ∀" ~Likes(Akash, x)
FALSE ∨ ~Likes(Arun, x)
C8: ∀" Likes(Akash, x)
C16: Cricket(Akash) ∨ Likes(Arun, x)

C9: Likes(Arun, Rain)


C1: Student(Akash)
C15: Wicked(Akash) ∨ C10: Likes(Arun, Potions)
Cricket(Akash)
C4: ~Student(x) ∨ {x/Akash} C11: ∀" ~ Cricket(x) ∨
Wicked(x) ∨ Cricket(x) Likes(x, Potions)
Resolution Strategies
• Linear Resolution
• Slight generalization of input resolution

• Allows P and Q to be resolved together either


• if P is in the original KB, or
• if P is an ancestor of Q in the proof tree

• Linear resolution is complete


C1: Student(Akash)
C11: ~ Cricket(x) ∨ C4: ~Student(x) ∨
Likes(x, Potions) Wicked(x) ∨ Cricket(x) C2: Student(Amit)

{x/Akash} C3: Student(Arun)


C4: ~Student(x) ∨
C12: ~Student(Akash) ∨ Wicked(x) ∨ Cricket(x)
C1: Student(Akash)
Wicked(Akash) ∨
Likes(Akash, Potions) C5: ∀" ~Cricket(x) ∨
~Likes(x, Rain)
C6: ~Wicked(x) ∨ C6: ∀" ~Wicked(x) ∨
Likes(x, Potions) Likes(x, Potions)
C13: Wicked(Akash) ∨
Likes(Akash, Potions) C7: ∀" ~Likes(Akash, x)
{x/Akash} ∨ ~Likes(Arun, x)
C14: Likes(Akash, C7: ~Likes(Akash, x) ∨ C8: ∀" Likes(Akash, x)
Potions) ~Likes(Arun, x) ∨ Likes(Arun, x)

{x/Potion} C9: Likes(Arun, Rain)


C15: ~Likes(Arun,
Potions) C10: Likes(Arun, Potions) C10: Likes(Arun, Potions)

C11: ∀" ~ Cricket(x) ∨


FALSE Likes(x, Potions)
What is Deduction?
• Deduction is also a kind of search

• We have to search within the rules, facts, and clauses

• Find them in appropriate order in which to apply them to deduce clauses and goals
Thank You

You might also like