SlideShare a Scribd company logo
1 of 18
AI3391 ARTIFICAL INTELLIGENCE
(II YEAR (III Sem))
Department of Artificial Intelligence and Data
Science
Session 27
by
Asst.Prof.M.Gokilavani
NIET
1/24/2024 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.
1/24/2024 Dpaertment of CSE ( AL & ML) 2
Topics covered in session 27
• Logical Reasoning: Knowledge-Based Agents
• Propositional Logic
• Propositional Theorem Proving
• Effective Propositional Model Checking
• Agents Based on Propositional Logic
• First order logic
• Syntax and semantics
• Knowledge representation and engineering
• Inference and first order logic
• Forward and backward chaining
• Inference
1/24/2024 Dpaertment of CSE ( AL & ML) 3
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.
1/24/2024 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.
1/24/2024 5
Dpaertment of CSE ( AL & ML)
First order logic
1/24/2024 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).
1/24/2024 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).
1/24/2024 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.
1/24/2024 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].
1/24/2024 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.
1/24/2024 11
Dpaertment of CSE ( AL & ML)
Algorithm
1/24/2024 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).
1/24/2024 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.
1/24/2024 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}.
1/24/2024 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.
1/24/2024 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}.
1/24/2024 17
Dpaertment of CSE ( AL & ML)
Topics to be covered in next session 28
• Resolution in First Order Logic (FOL)
Thank you!!!
1/24/2024 Dpaertment of CSE ( AL & ML) 18

More Related Content

Similar to AI3391 Artificial intelligence session 27 inference and unification.pptx

AI3391 Artificial intelligence Unit IV Notes _ merged.pdf
AI3391 Artificial intelligence Unit IV Notes _ merged.pdfAI3391 Artificial intelligence Unit IV Notes _ merged.pdf
AI3391 Artificial intelligence Unit IV Notes _ merged.pdfAsst.prof M.Gokilavani
 
The Intersection Axiom of Conditional Probability
The Intersection Axiom of Conditional ProbabilityThe Intersection Axiom of Conditional Probability
The Intersection Axiom of Conditional ProbabilityRichard Gill
 
AI_session 24 knowledge representation.pptx
AI_session 24 knowledge representation.pptxAI_session 24 knowledge representation.pptx
AI_session 24 knowledge representation.pptxAsst.prof M.Gokilavani
 
Basic review on topic modeling
Basic review on  topic modelingBasic review on  topic modeling
Basic review on topic modelingHiroyuki Kuromiya
 
AI NOTES ppt 4.pdf
AI NOTES ppt 4.pdfAI NOTES ppt 4.pdf
AI NOTES ppt 4.pdfARMANVERMA7
 
Propositional logic(part 2)
Propositional logic(part 2)Propositional logic(part 2)
Propositional logic(part 2)SURBHI SAROHA
 
Discrete Mathematics Lecture Notes
Discrete Mathematics Lecture NotesDiscrete Mathematics Lecture Notes
Discrete Mathematics Lecture NotesFellowBuddy.com
 
Dependent Types in Natural Language Semantics
Dependent Types in Natural Language SemanticsDependent Types in Natural Language Semantics
Dependent Types in Natural Language SemanticsDaisuke BEKKI
 
AIML 7th semester VTU
AIML 7th semester VTUAIML 7th semester VTU
AIML 7th semester VTUAyushiLodha3
 
A survey on different definitions of soft points: limitations, comparisons and...
A survey on different definitions of soft points: limitations, comparisons and...A survey on different definitions of soft points: limitations, comparisons and...
A survey on different definitions of soft points: limitations, comparisons and...Journal of Fuzzy Extension and Applications
 

Similar to AI3391 Artificial intelligence session 27 inference and unification.pptx (20)

AI3391 Artificial intelligence Unit IV Notes _ merged.pdf
AI3391 Artificial intelligence Unit IV Notes _ merged.pdfAI3391 Artificial intelligence Unit IV Notes _ merged.pdf
AI3391 Artificial intelligence Unit IV Notes _ merged.pdf
 
Lesson 26
Lesson 26Lesson 26
Lesson 26
 
AI Lesson 26
AI Lesson 26AI Lesson 26
AI Lesson 26
 
AI_Session 20 Horn clause.pptx
AI_Session 20 Horn clause.pptxAI_Session 20 Horn clause.pptx
AI_Session 20 Horn clause.pptx
 
The Intersection Axiom of Conditional Probability
The Intersection Axiom of Conditional ProbabilityThe Intersection Axiom of Conditional Probability
The Intersection Axiom of Conditional Probability
 
AI_session 23 Resolution.pptx
AI_session 23 Resolution.pptxAI_session 23 Resolution.pptx
AI_session 23 Resolution.pptx
 
AI_session 24 knowledge representation.pptx
AI_session 24 knowledge representation.pptxAI_session 24 knowledge representation.pptx
AI_session 24 knowledge representation.pptx
 
Fol
FolFol
Fol
 
Basic review on topic modeling
Basic review on  topic modelingBasic review on  topic modeling
Basic review on topic modeling
 
AI NOTES ppt 4.pdf
AI NOTES ppt 4.pdfAI NOTES ppt 4.pdf
AI NOTES ppt 4.pdf
 
Propositional logic(part 2)
Propositional logic(part 2)Propositional logic(part 2)
Propositional logic(part 2)
 
Semantics
SemanticsSemantics
Semantics
 
Thinking with shapes
Thinking with shapesThinking with shapes
Thinking with shapes
 
Discrete Mathematics Lecture Notes
Discrete Mathematics Lecture NotesDiscrete Mathematics Lecture Notes
Discrete Mathematics Lecture Notes
 
Dependent Types in Natural Language Semantics
Dependent Types in Natural Language SemanticsDependent Types in Natural Language Semantics
Dependent Types in Natural Language Semantics
 
AIML 7th semester VTU
AIML 7th semester VTUAIML 7th semester VTU
AIML 7th semester VTU
 
01bkb04p.ppt
01bkb04p.ppt01bkb04p.ppt
01bkb04p.ppt
 
A survey on different definitions of soft points: limitations, comparisons and...
A survey on different definitions of soft points: limitations, comparisons and...A survey on different definitions of soft points: limitations, comparisons and...
A survey on different definitions of soft points: limitations, comparisons and...
 
Module_5_1.pptx
Module_5_1.pptxModule_5_1.pptx
Module_5_1.pptx
 
AI Lab Manual.docx
AI Lab Manual.docxAI Lab Manual.docx
AI Lab Manual.docx
 

More from 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 .pdfAsst.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 .pdfAsst.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 .pdfAsst.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 _.pdfAsst.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 notesAsst.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.pdfAsst.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.pdfAsst.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.pdfAsst.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.pdfAsst.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.pptxAsst.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.pptxAsst.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.pptxAsst.prof M.Gokilavani
 
AI3391 Artificial Intelligence UNIT III Notes_merged.pdf
AI3391 Artificial Intelligence UNIT III Notes_merged.pdfAI3391 Artificial Intelligence UNIT III Notes_merged.pdf
AI3391 Artificial Intelligence UNIT III Notes_merged.pdfAsst.prof M.Gokilavani
 
AI3391 Artificial Intelligence Session 23 Backtracking CSP's.pptx
AI3391 Artificial Intelligence Session 23 Backtracking CSP's.pptxAI3391 Artificial Intelligence Session 23 Backtracking CSP's.pptx
AI3391 Artificial Intelligence Session 23 Backtracking CSP's.pptxAsst.prof M.Gokilavani
 

More from Asst.prof M.Gokilavani (20)

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 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
 
AI3391 Artificial Intelligence UNIT III Notes_merged.pdf
AI3391 Artificial Intelligence UNIT III Notes_merged.pdfAI3391 Artificial Intelligence UNIT III Notes_merged.pdf
AI3391 Artificial Intelligence UNIT III Notes_merged.pdf
 
AI3391 Artificial Intelligence Session 23 Backtracking CSP's.pptx
AI3391 Artificial Intelligence Session 23 Backtracking CSP's.pptxAI3391 Artificial Intelligence Session 23 Backtracking CSP's.pptx
AI3391 Artificial Intelligence Session 23 Backtracking CSP's.pptx
 

Recently uploaded

SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...srsj9000
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxbritheesh05
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZTE
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineeringmalavadedarshan25
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝soniya singh
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLDeelipZope
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 

Recently uploaded (20)

SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptx
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineering
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCL
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
 

AI3391 Artificial intelligence session 27 inference and unification.pptx

  • 1. AI3391 ARTIFICAL INTELLIGENCE (II YEAR (III Sem)) Department of Artificial Intelligence and Data Science Session 27 by Asst.Prof.M.Gokilavani NIET 1/24/2024 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. 1/24/2024 Dpaertment of CSE ( AL & ML) 2
  • 3. Topics covered in session 27 • Logical Reasoning: Knowledge-Based Agents • Propositional Logic • Propositional Theorem Proving • Effective Propositional Model Checking • Agents Based on Propositional Logic • First order logic • Syntax and semantics • Knowledge representation and engineering • Inference and first order logic • Forward and backward chaining • Inference 1/24/2024 Dpaertment of CSE ( AL & ML) 3
  • 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. 1/24/2024 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. 1/24/2024 5 Dpaertment of CSE ( AL & ML)
  • 6. First order logic 1/24/2024 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). 1/24/2024 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). 1/24/2024 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. 1/24/2024 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]. 1/24/2024 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. 1/24/2024 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). 1/24/2024 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. 1/24/2024 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}. 1/24/2024 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. 1/24/2024 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}. 1/24/2024 17 Dpaertment of CSE ( AL & ML)
  • 18. Topics to be covered in next session 28 • Resolution in First Order Logic (FOL) Thank you!!! 1/24/2024 Dpaertment of CSE ( AL & ML) 18