SlideShare a Scribd company logo
ARTIFICAL INTELLIGENCE
(R18 III(II Sem))
Department of computer science and
engineering (AI/ML)
Session 22
by
Asst.Prof.M.Gokilavani
VITS
4/25/2023 Dpaertment of CSE ( AL & ML) 1
TEXTBOOK:
• Artificial Intelligence A modern Approach, Third
Edition, Stuart Russell and Peter Norvig, Pearson
Education.
REFERENCES:
• Artificial Intelligence, 3rd Edn, E. Rich and K.Knight
(TMH).
• Artificial Intelligence, 3rd Edn, Patrick Henny
Winston, Pearson Education.
• Artificial Intelligence, Shivani Goel, Pearson
Education.
• Artificial Intelligence and Expert Systems- Patterson,
Pearson Education.
4/25/2023 Dpaertment of CSE ( AL & ML) 2
Topics covered in session 22
4/25/2023 Dpaertment of CSE ( AL & ML) 3
Logic and Knowledge Representation
First-Order Logic: Representation, Syntax and
Semantics of First-Order Logic, Using First-Order Logic,
Knowledge Engineering in First-Order Logic.
Inference in First-Order Logic: Propositional vs. First-
Order Inference, Unification and Lifting, Forward
Chaining, Backward Chaining, Resolution.
Knowledge Representation: Ontological Engineering,
Categories and Objects, Events. Mental Events and
Mental Objects, Reasoning Systems for Categories,
Reasoning with Default Information.
Propositional vs. First-Order Inference
Propositional logic
• Propositional logic(PL) is a statement made by
propositions.
• It is a simple form of logic.
• Propositions are declarative statements which are
either true or false.
• PL is a technique often used in logical and
mathematical form.
• When we study PL, we usually start with formal
natural language arguments, but they can also be
expressed mathematically.
4/25/2023 4
Dpaertment of CSE ( AL & ML)
• Propositional logic is based on formal logic, deductive reason
and Boolean logic.
• We use symbolic variables to represent the logic. Often true
and false can be symbolized by 1 and 0.
• Propositional logic also consists of an object, relations or
function, and logical connectives.
4/25/2023 5
Dpaertment of CSE ( AL & ML)
First order logic
4/25/2023 6
Dpaertment of CSE ( AL & ML)
• First-order logic(FOL), Predicate logic or First-order
predicate logic is an extension to propositional logic.
• First-order logic expresses information about objects and
expresses relationships between those objects in a more
functional way in comparison to propositional logic.
• First-order logic is more concise than propositional logic.
• In First-order logic, the statements are divided into two
parts: the subject and the predicate.
• The predicate is not a proposition.
• It is neither true nor false.
• Predicates use variables and objects like people, colors,
numbers, letters or ideas.
• They can also represent relationships and functions
• Both syntax and semantics are important to first-
order logic.
• Symbols are the basic syntax of FOL and can be
written in shorthand.
• Syntax is the structure of the logical statements.
Semantics gives meaning to the statements.
Examples:
• Every man has a heart = ∀x man(x) → have (x,
heart).
• Some men are mean = ∃x: man(x) ∧ mean(x).
4/25/2023 7
Dpaertment of CSE ( AL & ML)
What is Unification?
• Unification is a process of making two different
logical atomic expressions identical by finding a
substitution.
• Unification depends on the substitution process.
• It takes two literals as input and makes them
identical using substitution.
• Let Ψ1 and Ψ2 be two atomic sentences and 𝜎 be a
unifier such that, Ψ1𝜎 = Ψ2𝜎, then it can be
expressed as UNIFY(Ψ1, Ψ2).
4/25/2023 8
Dpaertment of CSE ( AL & ML)
Example: Find the MGU for Unify{King(x), King(John)}
Let Ψ1 = King(x), Ψ2 = King(John),
Substitution: θ = {John/x} is a unifier for these atoms and
applying this substitution, and both expressions will be
identical.
• The UNIFY algorithm is used for unification, which takes
two atomic sentences and returns a unifier for those
sentences (If any exist).
• Unification is a key component of all first-order inference
algorithms.
• It returns fail if the expressions do not match with each
other.
• The substitution variables are called Most General Unifier
or MGU.
4/25/2023 9
Dpaertment of CSE ( AL & ML)
Example: Let's say there are two different
expressions, P(x, y), and P(a, f(z)).
In this example, we need to make both above
statements identical to each other.
For this, we will perform the substitution.
P(x, y)......... (i)
P(a, f(z))......... (ii)
• Substitute x with a, and y with f(z) in the first
expression, and it will be represented as a/x and
f(z)/y.
• With both the substitutions, the first expression
will be identical to the second expression and the
substitution set will be: [a/x, f(z)/y].
4/25/2023 10
Dpaertment of CSE ( AL & ML)
Conditions for Unification
Following are some basic conditions for
unification:
• Predicate symbol must be same, atoms or
expression with different predicate symbol can
never be unified.
• Number of Arguments in both expressions
must be identical.
• Unification will fail if there are two similar
variables present in the same expression.
4/25/2023 11
Dpaertment of CSE ( AL & ML)
Algorithm
4/25/2023 12
Dpaertment of CSE ( AL & ML)
Implementation of the Algorithm
• Step 1: Begin by making the substitute set empty.
Step 2: Unify atomic sentences in a recursive manner:
a. Check for expressions that are identical.
b. If one expression is a variable vΨi, and the other
is a term ti which does not contain variable vi, then:
i. Substitute ti / vi in the existing substitutions
ii. Add ti / vi to the substitution set list.
Iii. If both the expressions are functions, then
function name must be similar, and the number of
arguments must be the same in both the expression.
c. Find the most general unifier for each pair of the
following atomic statements (If exist).
4/25/2023 13
Dpaertment of CSE ( AL & ML)
Example 1
Find the MGU of {p(f(a), g(Y)) and p(X, X)}.
Sol: S0 => Here,
• Ψ1 = p(f(a), g(Y)), and
• Ψ2 = p(X, X)
SUBST θ = {f(a) / X}
• S1 => Ψ1 = p(f(a), g(Y)), and Ψ2 = p(f(a), f(a))
SUBST θ = {f(a) / g(y)},
Unification failed.
Unification is not possible for these expressions.
4/25/2023 14
Dpaertment of CSE ( AL & ML)
Example 2
Find the MGU of {p(b, X, f(g(Z))) and p(Z, f(Y), f(Y))}
Sol: Here, Ψ1 = p(b, X, f(g(Z)))
Ψ2 = p(Z, f(Y), f(Y))
S0 => { p(b, X, f(g(Z))); p(Z, f(Y), f(Y))}
SUBST θ={b/Z}
S1 => { p(b, X, f(g(b))); p(b, f(Y), f(Y))}
SUBST θ={f(Y) /X}
S2 => { p(b, f(Y), f(g(b))); p(b, f(Y), f(Y))}
SUBST θ= {g(b) /Y}
S2 => { p(b, f(g(b)), f(g(b)); p(b, f(g(b)), f(g(b))}
Unified Successfully.
And Unifier = { b/Z, f(Y) /X , g(b) /Y}.
4/25/2023 15
Dpaertment of CSE ( AL & ML)
Example 3
Find the MGU of {p (X, X), and p (Z, f(Z))}
Sol: Here, Ψ1 = {p (X, X)
Ψ2 = p (Z, f(Z))
S0 => {p (X, X), p (Z, f(Z))}
SUBST θ= {X/Z}
S1 => {p (Z, Z), p (Z, f(Z))}
SUBST θ= {f(Z) / Z},
Unification Failed.
Therefore, unification is not possible for
these expressions.
4/25/2023 16
Dpaertment of CSE ( AL & ML)
Example 4
UNIFY(knows(Richard, x), knows(Richard, John))
Sol: Here, Ψ1 = knows(Richard, x)
Ψ2 = knows(Richard, John)
S0 => { knows(Richard, x); knows(Richard, John)}
S SUBST θ= {John/x}
S1 => { knows(Richard, John); knows(Richard,
John)},
Successfully Unified.
Unifier: {John/x}.
4/25/2023 17
Dpaertment of CSE ( AL & ML)
Topics to be covered in next session 23
• Resolution in First Order Logic (FOL)
Thank you!!!
4/25/2023 Dpaertment of CSE ( AL & ML) 18

More Related Content

Similar to AI_session 22 inference and unification.pptx

Point-free foundation of Mathematics
Point-free foundation of MathematicsPoint-free foundation of Mathematics
Point-free foundation of Mathematics
Marco Benini
 
Propositional logic(part 2)
Propositional logic(part 2)Propositional logic(part 2)
Propositional logic(part 2)
SURBHI SAROHA
 
PROLOG: Matching And Proof Search In Prolog
PROLOG: Matching And Proof Search In PrologPROLOG: Matching And Proof Search In Prolog
PROLOG: Matching And Proof Search In Prolog
DataminingTools Inc
 
PROLOG: Matching And Proof Search In Prolog
PROLOG: Matching And Proof Search In PrologPROLOG: Matching And Proof Search In Prolog
PROLOG: Matching And Proof Search In Prolog
PROLOG CONTENT
 
MACHINE LEARNING-LEARNING RULE
MACHINE LEARNING-LEARNING RULEMACHINE LEARNING-LEARNING RULE
MACHINE LEARNING-LEARNING RULE
DrBindhuM
 
Discrete Mathematics Lecture Notes
Discrete Mathematics Lecture NotesDiscrete Mathematics Lecture Notes
Discrete Mathematics Lecture Notes
FellowBuddy.com
 
Mc0079 computer based optimization methods--phpapp02
Mc0079 computer based optimization methods--phpapp02Mc0079 computer based optimization methods--phpapp02
Mc0079 computer based optimization methods--phpapp02
Rabby Bhatt
 
First order predicate logic(fopl)
First order predicate logic(fopl)First order predicate logic(fopl)
First order predicate logic(fopl)
surbhi jha
 
Master of Computer Application (MCA) – Semester 4 MC0079
Master of Computer Application (MCA) – Semester 4  MC0079Master of Computer Application (MCA) – Semester 4  MC0079
Master of Computer Application (MCA) – Semester 4 MC0079
Aravind NC
 
AN IMPLEMENTATION, EMPIRICAL EVALUATION AND PROPOSED IMPROVEMENT FOR BIDIRECT...
AN IMPLEMENTATION, EMPIRICAL EVALUATION AND PROPOSED IMPROVEMENT FOR BIDIRECT...AN IMPLEMENTATION, EMPIRICAL EVALUATION AND PROPOSED IMPROVEMENT FOR BIDIRECT...
AN IMPLEMENTATION, EMPIRICAL EVALUATION AND PROPOSED IMPROVEMENT FOR BIDIRECT...
ijaia
 
AI Lab Manual.docx
AI Lab Manual.docxAI Lab Manual.docx
AI Lab Manual.docx
KPRevathiAsstprofITD
 
[SEMINAR] 2nd Tues, 14 May, 2019
[SEMINAR] 2nd Tues, 14 May, 2019[SEMINAR] 2nd Tues, 14 May, 2019
[SEMINAR] 2nd Tues, 14 May, 2019
Naoto Agawa
 
English for Math Pertemuan ke 11
English for Math Pertemuan ke 11English for Math Pertemuan ke 11
English for Math Pertemuan ke 11
Amalia Indrawati Gunawan
 
Compressing the dependent elements of multiset
Compressing the dependent elements of multisetCompressing the dependent elements of multiset
Compressing the dependent elements of multiset
IRJET Journal
 
Jarrar.lecture notes.aai.2011s.ch8.fol.introduction
Jarrar.lecture notes.aai.2011s.ch8.fol.introductionJarrar.lecture notes.aai.2011s.ch8.fol.introduction
Jarrar.lecture notes.aai.2011s.ch8.fol.introductionPalGov
 
Ai lecture 11(unit03)
Ai lecture  11(unit03)Ai lecture  11(unit03)
Ai lecture 11(unit03)
vikas dhakane
 

Similar to AI_session 22 inference and unification.pptx (20)

Point-free foundation of Mathematics
Point-free foundation of MathematicsPoint-free foundation of Mathematics
Point-free foundation of Mathematics
 
Propositional logic(part 2)
Propositional logic(part 2)Propositional logic(part 2)
Propositional logic(part 2)
 
PROLOG: Matching And Proof Search In Prolog
PROLOG: Matching And Proof Search In PrologPROLOG: Matching And Proof Search In Prolog
PROLOG: Matching And Proof Search In Prolog
 
PROLOG: Matching And Proof Search In Prolog
PROLOG: Matching And Proof Search In PrologPROLOG: Matching And Proof Search In Prolog
PROLOG: Matching And Proof Search In Prolog
 
AI Lesson 11
AI Lesson 11AI Lesson 11
AI Lesson 11
 
MACHINE LEARNING-LEARNING RULE
MACHINE LEARNING-LEARNING RULEMACHINE LEARNING-LEARNING RULE
MACHINE LEARNING-LEARNING RULE
 
Discrete Mathematics Lecture Notes
Discrete Mathematics Lecture NotesDiscrete Mathematics Lecture Notes
Discrete Mathematics Lecture Notes
 
Semantics
SemanticsSemantics
Semantics
 
Mc0079 computer based optimization methods--phpapp02
Mc0079 computer based optimization methods--phpapp02Mc0079 computer based optimization methods--phpapp02
Mc0079 computer based optimization methods--phpapp02
 
First order predicate logic(fopl)
First order predicate logic(fopl)First order predicate logic(fopl)
First order predicate logic(fopl)
 
Master of Computer Application (MCA) – Semester 4 MC0079
Master of Computer Application (MCA) – Semester 4  MC0079Master of Computer Application (MCA) – Semester 4  MC0079
Master of Computer Application (MCA) – Semester 4 MC0079
 
AN IMPLEMENTATION, EMPIRICAL EVALUATION AND PROPOSED IMPROVEMENT FOR BIDIRECT...
AN IMPLEMENTATION, EMPIRICAL EVALUATION AND PROPOSED IMPROVEMENT FOR BIDIRECT...AN IMPLEMENTATION, EMPIRICAL EVALUATION AND PROPOSED IMPROVEMENT FOR BIDIRECT...
AN IMPLEMENTATION, EMPIRICAL EVALUATION AND PROPOSED IMPROVEMENT FOR BIDIRECT...
 
Lesson 26
Lesson 26Lesson 26
Lesson 26
 
AI Lesson 26
AI Lesson 26AI Lesson 26
AI Lesson 26
 
AI Lab Manual.docx
AI Lab Manual.docxAI Lab Manual.docx
AI Lab Manual.docx
 
[SEMINAR] 2nd Tues, 14 May, 2019
[SEMINAR] 2nd Tues, 14 May, 2019[SEMINAR] 2nd Tues, 14 May, 2019
[SEMINAR] 2nd Tues, 14 May, 2019
 
English for Math Pertemuan ke 11
English for Math Pertemuan ke 11English for Math Pertemuan ke 11
English for Math Pertemuan ke 11
 
Compressing the dependent elements of multiset
Compressing the dependent elements of multisetCompressing the dependent elements of multiset
Compressing the dependent elements of multiset
 
Jarrar.lecture notes.aai.2011s.ch8.fol.introduction
Jarrar.lecture notes.aai.2011s.ch8.fol.introductionJarrar.lecture notes.aai.2011s.ch8.fol.introduction
Jarrar.lecture notes.aai.2011s.ch8.fol.introduction
 
Ai lecture 11(unit03)
Ai lecture  11(unit03)Ai lecture  11(unit03)
Ai lecture 11(unit03)
 

More from Asst.prof M.Gokilavani

CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
Asst.prof M.Gokilavani
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
Asst.prof M.Gokilavani
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
Asst.prof M.Gokilavani
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
Asst.prof M.Gokilavani
 
IT8073_Information Security_UNIT I _.pdf
IT8073_Information Security_UNIT I _.pdfIT8073_Information Security_UNIT I _.pdf
IT8073_Information Security_UNIT I _.pdf
Asst.prof M.Gokilavani
 
IT8073 _Information Security _UNIT I Full notes
IT8073 _Information Security _UNIT I Full notesIT8073 _Information Security _UNIT I Full notes
IT8073 _Information Security _UNIT I Full notes
Asst.prof M.Gokilavani
 
GE3151 PSPP UNIT IV QUESTION BANK.docx.pdf
GE3151 PSPP UNIT IV QUESTION BANK.docx.pdfGE3151 PSPP UNIT IV QUESTION BANK.docx.pdf
GE3151 PSPP UNIT IV QUESTION BANK.docx.pdf
Asst.prof M.Gokilavani
 
GE3151 PSPP UNIT III QUESTION BANK.docx.pdf
GE3151 PSPP UNIT III QUESTION BANK.docx.pdfGE3151 PSPP UNIT III QUESTION BANK.docx.pdf
GE3151 PSPP UNIT III QUESTION BANK.docx.pdf
Asst.prof M.Gokilavani
 
GE3151 UNIT II Study material .pdf
GE3151 UNIT II Study material .pdfGE3151 UNIT II Study material .pdf
GE3151 UNIT II Study material .pdf
Asst.prof M.Gokilavani
 
GE3151 PSPP All unit question bank.pdf
GE3151 PSPP All unit question bank.pdfGE3151 PSPP All unit question bank.pdf
GE3151 PSPP All unit question bank.pdf
Asst.prof M.Gokilavani
 
GE3151_PSPP_All unit _Notes
GE3151_PSPP_All unit _NotesGE3151_PSPP_All unit _Notes
GE3151_PSPP_All unit _Notes
Asst.prof M.Gokilavani
 
GE3151_PSPP_UNIT_5_Notes
GE3151_PSPP_UNIT_5_NotesGE3151_PSPP_UNIT_5_Notes
GE3151_PSPP_UNIT_5_Notes
Asst.prof M.Gokilavani
 
GE3151_PSPP_UNIT_4_Notes
GE3151_PSPP_UNIT_4_NotesGE3151_PSPP_UNIT_4_Notes
GE3151_PSPP_UNIT_4_Notes
Asst.prof M.Gokilavani
 
GE3151_PSPP_UNIT_3_Notes
GE3151_PSPP_UNIT_3_NotesGE3151_PSPP_UNIT_3_Notes
GE3151_PSPP_UNIT_3_Notes
Asst.prof M.Gokilavani
 
GE3151_PSPP_UNIT_2_Notes
GE3151_PSPP_UNIT_2_NotesGE3151_PSPP_UNIT_2_Notes
GE3151_PSPP_UNIT_2_Notes
Asst.prof M.Gokilavani
 
AI3391 Artificial intelligence Session 29 Forward and backward chaining.pdf
AI3391 Artificial intelligence Session 29 Forward and backward chaining.pdfAI3391 Artificial intelligence Session 29 Forward and backward chaining.pdf
AI3391 Artificial intelligence Session 29 Forward and backward chaining.pdf
Asst.prof M.Gokilavani
 
AI3391 Artificial intelligence Session 28 Resolution.pptx
AI3391 Artificial intelligence Session 28 Resolution.pptxAI3391 Artificial intelligence Session 28 Resolution.pptx
AI3391 Artificial intelligence Session 28 Resolution.pptx
Asst.prof M.Gokilavani
 
AI3391 Artificial Intelligence Session 26 First order logic.pptx
AI3391 Artificial Intelligence Session 26 First order logic.pptxAI3391 Artificial Intelligence Session 26 First order logic.pptx
AI3391 Artificial Intelligence Session 26 First order logic.pptx
Asst.prof M.Gokilavani
 
AI3391 Artificial Intelligence Session 25 Horn clause.pptx
AI3391 Artificial Intelligence Session 25 Horn clause.pptxAI3391 Artificial Intelligence Session 25 Horn clause.pptx
AI3391 Artificial Intelligence Session 25 Horn clause.pptx
Asst.prof M.Gokilavani
 
AI3391 Artificial Intelligence session 24 knowledge representation.pptx
AI3391 Artificial Intelligence session 24 knowledge representation.pptxAI3391 Artificial Intelligence session 24 knowledge representation.pptx
AI3391 Artificial Intelligence session 24 knowledge representation.pptx
Asst.prof M.Gokilavani
 

More from Asst.prof M.Gokilavani (20)

CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
 
IT8073_Information Security_UNIT I _.pdf
IT8073_Information Security_UNIT I _.pdfIT8073_Information Security_UNIT I _.pdf
IT8073_Information Security_UNIT I _.pdf
 
IT8073 _Information Security _UNIT I Full notes
IT8073 _Information Security _UNIT I Full notesIT8073 _Information Security _UNIT I Full notes
IT8073 _Information Security _UNIT I Full notes
 
GE3151 PSPP UNIT IV QUESTION BANK.docx.pdf
GE3151 PSPP UNIT IV QUESTION BANK.docx.pdfGE3151 PSPP UNIT IV QUESTION BANK.docx.pdf
GE3151 PSPP UNIT IV QUESTION BANK.docx.pdf
 
GE3151 PSPP UNIT III QUESTION BANK.docx.pdf
GE3151 PSPP UNIT III QUESTION BANK.docx.pdfGE3151 PSPP UNIT III QUESTION BANK.docx.pdf
GE3151 PSPP UNIT III QUESTION BANK.docx.pdf
 
GE3151 UNIT II Study material .pdf
GE3151 UNIT II Study material .pdfGE3151 UNIT II Study material .pdf
GE3151 UNIT II Study material .pdf
 
GE3151 PSPP All unit question bank.pdf
GE3151 PSPP All unit question bank.pdfGE3151 PSPP All unit question bank.pdf
GE3151 PSPP All unit question bank.pdf
 
GE3151_PSPP_All unit _Notes
GE3151_PSPP_All unit _NotesGE3151_PSPP_All unit _Notes
GE3151_PSPP_All unit _Notes
 
GE3151_PSPP_UNIT_5_Notes
GE3151_PSPP_UNIT_5_NotesGE3151_PSPP_UNIT_5_Notes
GE3151_PSPP_UNIT_5_Notes
 
GE3151_PSPP_UNIT_4_Notes
GE3151_PSPP_UNIT_4_NotesGE3151_PSPP_UNIT_4_Notes
GE3151_PSPP_UNIT_4_Notes
 
GE3151_PSPP_UNIT_3_Notes
GE3151_PSPP_UNIT_3_NotesGE3151_PSPP_UNIT_3_Notes
GE3151_PSPP_UNIT_3_Notes
 
GE3151_PSPP_UNIT_2_Notes
GE3151_PSPP_UNIT_2_NotesGE3151_PSPP_UNIT_2_Notes
GE3151_PSPP_UNIT_2_Notes
 
AI3391 Artificial intelligence Session 29 Forward and backward chaining.pdf
AI3391 Artificial intelligence Session 29 Forward and backward chaining.pdfAI3391 Artificial intelligence Session 29 Forward and backward chaining.pdf
AI3391 Artificial intelligence Session 29 Forward and backward chaining.pdf
 
AI3391 Artificial intelligence Session 28 Resolution.pptx
AI3391 Artificial intelligence Session 28 Resolution.pptxAI3391 Artificial intelligence Session 28 Resolution.pptx
AI3391 Artificial intelligence Session 28 Resolution.pptx
 
AI3391 Artificial Intelligence Session 26 First order logic.pptx
AI3391 Artificial Intelligence Session 26 First order logic.pptxAI3391 Artificial Intelligence Session 26 First order logic.pptx
AI3391 Artificial Intelligence Session 26 First order logic.pptx
 
AI3391 Artificial Intelligence Session 25 Horn clause.pptx
AI3391 Artificial Intelligence Session 25 Horn clause.pptxAI3391 Artificial Intelligence Session 25 Horn clause.pptx
AI3391 Artificial Intelligence Session 25 Horn clause.pptx
 
AI3391 Artificial Intelligence session 24 knowledge representation.pptx
AI3391 Artificial Intelligence session 24 knowledge representation.pptxAI3391 Artificial Intelligence session 24 knowledge representation.pptx
AI3391 Artificial Intelligence session 24 knowledge representation.pptx
 

Recently uploaded

NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
Amil Baba Dawood bangali
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Teleport Manpower Consultant
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
gdsczhcet
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
MdTanvirMahtab2
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Dr.Costas Sachpazis
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
JoytuBarua2
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
seandesed
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
zwunae
 
ML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptxML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptx
Vijay Dialani, PhD
 
AP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specificAP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specific
BrazilAccount1
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation & Control
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
manasideore6
 
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
MLILAB
 
ethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.pptethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.ppt
Jayaprasanna4
 
DESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docxDESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docx
FluxPrime1
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
SamSarthak3
 
English lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdfEnglish lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdf
BrazilAccount1
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
Kamal Acharya
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
thanhdowork
 
WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234
AafreenAbuthahir2
 

Recently uploaded (20)

NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
 
ML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptxML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptx
 
AP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specificAP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specific
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
 
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
 
ethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.pptethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.ppt
 
DESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docxDESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docx
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
 
English lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdfEnglish lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdf
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
 
WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234
 

AI_session 22 inference and unification.pptx

  • 1. ARTIFICAL INTELLIGENCE (R18 III(II Sem)) Department of computer science and engineering (AI/ML) Session 22 by Asst.Prof.M.Gokilavani VITS 4/25/2023 Dpaertment of CSE ( AL & ML) 1
  • 2. TEXTBOOK: • Artificial Intelligence A modern Approach, Third Edition, Stuart Russell and Peter Norvig, Pearson Education. REFERENCES: • Artificial Intelligence, 3rd Edn, E. Rich and K.Knight (TMH). • Artificial Intelligence, 3rd Edn, Patrick Henny Winston, Pearson Education. • Artificial Intelligence, Shivani Goel, Pearson Education. • Artificial Intelligence and Expert Systems- Patterson, Pearson Education. 4/25/2023 Dpaertment of CSE ( AL & ML) 2
  • 3. Topics covered in session 22 4/25/2023 Dpaertment of CSE ( AL & ML) 3 Logic and Knowledge Representation First-Order Logic: Representation, Syntax and Semantics of First-Order Logic, Using First-Order Logic, Knowledge Engineering in First-Order Logic. Inference in First-Order Logic: Propositional vs. First- Order Inference, Unification and Lifting, Forward Chaining, Backward Chaining, Resolution. Knowledge Representation: Ontological Engineering, Categories and Objects, Events. Mental Events and Mental Objects, Reasoning Systems for Categories, Reasoning with Default Information.
  • 4. Propositional vs. First-Order Inference Propositional logic • Propositional logic(PL) is a statement made by propositions. • It is a simple form of logic. • Propositions are declarative statements which are either true or false. • PL is a technique often used in logical and mathematical form. • When we study PL, we usually start with formal natural language arguments, but they can also be expressed mathematically. 4/25/2023 4 Dpaertment of CSE ( AL & ML)
  • 5. • Propositional logic is based on formal logic, deductive reason and Boolean logic. • We use symbolic variables to represent the logic. Often true and false can be symbolized by 1 and 0. • Propositional logic also consists of an object, relations or function, and logical connectives. 4/25/2023 5 Dpaertment of CSE ( AL & ML)
  • 6. First order logic 4/25/2023 6 Dpaertment of CSE ( AL & ML) • First-order logic(FOL), Predicate logic or First-order predicate logic is an extension to propositional logic. • First-order logic expresses information about objects and expresses relationships between those objects in a more functional way in comparison to propositional logic. • First-order logic is more concise than propositional logic. • In First-order logic, the statements are divided into two parts: the subject and the predicate. • The predicate is not a proposition. • It is neither true nor false. • Predicates use variables and objects like people, colors, numbers, letters or ideas. • They can also represent relationships and functions
  • 7. • Both syntax and semantics are important to first- order logic. • Symbols are the basic syntax of FOL and can be written in shorthand. • Syntax is the structure of the logical statements. Semantics gives meaning to the statements. Examples: • Every man has a heart = ∀x man(x) → have (x, heart). • Some men are mean = ∃x: man(x) ∧ mean(x). 4/25/2023 7 Dpaertment of CSE ( AL & ML)
  • 8. What is Unification? • Unification is a process of making two different logical atomic expressions identical by finding a substitution. • Unification depends on the substitution process. • It takes two literals as input and makes them identical using substitution. • Let Ψ1 and Ψ2 be two atomic sentences and 𝜎 be a unifier such that, Ψ1𝜎 = Ψ2𝜎, then it can be expressed as UNIFY(Ψ1, Ψ2). 4/25/2023 8 Dpaertment of CSE ( AL & ML)
  • 9. Example: Find the MGU for Unify{King(x), King(John)} Let Ψ1 = King(x), Ψ2 = King(John), Substitution: θ = {John/x} is a unifier for these atoms and applying this substitution, and both expressions will be identical. • The UNIFY algorithm is used for unification, which takes two atomic sentences and returns a unifier for those sentences (If any exist). • Unification is a key component of all first-order inference algorithms. • It returns fail if the expressions do not match with each other. • The substitution variables are called Most General Unifier or MGU. 4/25/2023 9 Dpaertment of CSE ( AL & ML)
  • 10. Example: Let's say there are two different expressions, P(x, y), and P(a, f(z)). In this example, we need to make both above statements identical to each other. For this, we will perform the substitution. P(x, y)......... (i) P(a, f(z))......... (ii) • Substitute x with a, and y with f(z) in the first expression, and it will be represented as a/x and f(z)/y. • With both the substitutions, the first expression will be identical to the second expression and the substitution set will be: [a/x, f(z)/y]. 4/25/2023 10 Dpaertment of CSE ( AL & ML)
  • 11. Conditions for Unification Following are some basic conditions for unification: • Predicate symbol must be same, atoms or expression with different predicate symbol can never be unified. • Number of Arguments in both expressions must be identical. • Unification will fail if there are two similar variables present in the same expression. 4/25/2023 11 Dpaertment of CSE ( AL & ML)
  • 13. Implementation of the Algorithm • Step 1: Begin by making the substitute set empty. Step 2: Unify atomic sentences in a recursive manner: a. Check for expressions that are identical. b. If one expression is a variable vΨi, and the other is a term ti which does not contain variable vi, then: i. Substitute ti / vi in the existing substitutions ii. Add ti / vi to the substitution set list. Iii. If both the expressions are functions, then function name must be similar, and the number of arguments must be the same in both the expression. c. Find the most general unifier for each pair of the following atomic statements (If exist). 4/25/2023 13 Dpaertment of CSE ( AL & ML)
  • 14. Example 1 Find the MGU of {p(f(a), g(Y)) and p(X, X)}. Sol: S0 => Here, • Ψ1 = p(f(a), g(Y)), and • Ψ2 = p(X, X) SUBST θ = {f(a) / X} • S1 => Ψ1 = p(f(a), g(Y)), and Ψ2 = p(f(a), f(a)) SUBST θ = {f(a) / g(y)}, Unification failed. Unification is not possible for these expressions. 4/25/2023 14 Dpaertment of CSE ( AL & ML)
  • 15. Example 2 Find the MGU of {p(b, X, f(g(Z))) and p(Z, f(Y), f(Y))} Sol: Here, Ψ1 = p(b, X, f(g(Z))) Ψ2 = p(Z, f(Y), f(Y)) S0 => { p(b, X, f(g(Z))); p(Z, f(Y), f(Y))} SUBST θ={b/Z} S1 => { p(b, X, f(g(b))); p(b, f(Y), f(Y))} SUBST θ={f(Y) /X} S2 => { p(b, f(Y), f(g(b))); p(b, f(Y), f(Y))} SUBST θ= {g(b) /Y} S2 => { p(b, f(g(b)), f(g(b)); p(b, f(g(b)), f(g(b))} Unified Successfully. And Unifier = { b/Z, f(Y) /X , g(b) /Y}. 4/25/2023 15 Dpaertment of CSE ( AL & ML)
  • 16. Example 3 Find the MGU of {p (X, X), and p (Z, f(Z))} Sol: Here, Ψ1 = {p (X, X) Ψ2 = p (Z, f(Z)) S0 => {p (X, X), p (Z, f(Z))} SUBST θ= {X/Z} S1 => {p (Z, Z), p (Z, f(Z))} SUBST θ= {f(Z) / Z}, Unification Failed. Therefore, unification is not possible for these expressions. 4/25/2023 16 Dpaertment of CSE ( AL & ML)
  • 17. Example 4 UNIFY(knows(Richard, x), knows(Richard, John)) Sol: Here, Ψ1 = knows(Richard, x) Ψ2 = knows(Richard, John) S0 => { knows(Richard, x); knows(Richard, John)} S SUBST θ= {John/x} S1 => { knows(Richard, John); knows(Richard, John)}, Successfully Unified. Unifier: {John/x}. 4/25/2023 17 Dpaertment of CSE ( AL & ML)
  • 18. Topics to be covered in next session 23 • Resolution in First Order Logic (FOL) Thank you!!! 4/25/2023 Dpaertment of CSE ( AL & ML) 18