SlideShare a Scribd company logo
1 of 41
AI3391 ARTIFICAL INTELLIGENCE
(II YEAR (III Sem))
Department of Artificial Intelligence and Data Science
Session 29
by
Asst.Prof.M.Gokilavani
NIET
1/23/2024 Department of AI & DS 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/23/2024 Department of AI & DS 2
Topics covered in session 29
1/23/2024 Department of AI & DS 3
• 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
First-Order Logic
Chapter 8
Examples
[04PBT 04PFT 04PLT 04PNT 04PRT]
Genap 2011-2012
[dks0638]
First-order logic
• Whereas propositional logic assumes the
world contains facts,
• first-order logic (like natural language)
assumes the world contains
– Objects: people, houses, numbers, colors,
baseball games, wars, …
– Relations: red, round, prime, brother of, bigger
than, part of, comes between, …
– Functions: father of, best friend, one more
than, plus, …
Syntax of FOL
• Constants KingJohn, 2, UofA,...
• Predicates Brother, >,...
• Functions Sqrt, LeftLegOf,...
• Variables x, y, a, b,...
• Connectives , , , , 
• Equality =
• Quantifiers , 
Example Knowledge Base
The law says that it is a crime for an
American to sell weapons to hostile
nations. The country Nono, an enemy of
America, has some missiles, and all of its
missiles were sold to it by Colonel West,
who is American.
Prove that Col. West is a criminal!
Example Knowledge Base contd.
6
7
8
Properties of forward chaining
9
Sound and complete for first-order definite clauses (proof similar to
propositional proof)
Datalog = first-order definite clauses + no functions (e.g., crime KB)
FC terminates for Datalog in poly iterations: at most p ∙ nk literals
May not terminate in general if  is not entailed
This is unavoidable: entailment with definite clauses is semidecidable
Efficiency of forward chaining
Simple observation: no need to match a rule on iteration k
if a premise wasn't added on iteration k - 1
 match each rule whose premise contains a newly added
literal
Matching itself can be expensive
Database indexing allows O(1) retrieval of known facts
e.g., query Missile(x) retrieves Missile(M1)
Matching conjunctive premises against known facts is NP-hard
Forward chaining is widely used in deductive databases
11
12
13
14
15
16
17
Properties of backward chaining
18
Depth-first recursive proof search: space is linear in size of proof
Incomplete due to infinite loops
 fix by checking current goal against every goal on stack
Inefficient due to repeated subgoals (both success and failure)
 fix using caching of previous results (extra space!)
Widely used (without improvements!) for logic programming
19
21
Resolution refutation proofs involves
the following steps:
1. Put the premises or axioms into clause form.
2. Add the negation of what is to be proved, in
clause form, to the set of axioms.
3. Resolve these clauses together, producing new
clauses that logically follow from them.
4. Produce a contradiction by generating the empty
clause.
5. The substitutions used to produce the empty
clause are those under which the opposite of the
negated goal is true.
A Facts in Propositional Logic
23
Given Axioms Clause Form
P P (1)
(P  Q)  R  P   Q  R (2)
(S  T)  Q  S  Q (3)
 T  Q (4)
T T (5)
Prove R!
Resolution in Propositional Logic
24
 P   Q  R (2)  R
 P   Q P (1)
 T  Q (4)  Q
 T T (5)
Prove fido will die!
1. All dogs are animal.
2. Fido is a dog.
3. All animals will die.
Resolution proof for the “dead dog” problem.
Lucky Student
1. Anyone passing his history exams and
winning the lottery is happy.
2. Anyone who studies or is lucky can
pass all his exams.
3. John did not study but he is lucky.
4. Anyone who is lucky wins the lottery.
Prove that John is happy!
One resolution refutation for the “happy student” problem.
[1] [6]
[5]
[3]
[5]
[7]
[10]
[9]
[9]
[8]
Exciting life
1. All people that are not poor and are smart
are happy.
2. Those people that read are not stupid.
3. John can read and is wealthy.
4. Happy people have exiting lives.
Can anyone be found with an exciting life?
[1]
[3]
[2]
[4]
[6]
[5]
Resolution proof for the “exciting life” problem.
[6] [5]
[1]
[2]
[4]
[3]
Resolution Example
1. John likes all kinds of food.
x: food(x)  likes(john, x)
2. Apples are food.
food(apple)
3. Chicken is food.
food(chicken)
4. Anything anyone eats and isn't killed by is food.
x:(y: eats(y, x)   killedby(y, x))  food(x)
5. Bill eats peanuts and is still alive.
A. eats(Bill, peanuts) B. alive(Bill)
6. Sue eats everything Bill eats.
x:eats(Bill, x) eats(Sue, x)
7. x:y: alive(x)  killedby (x,y)
35
Clause form:
1.  food(x1)  likes(John, x1)
2. food(apples)
3. food(chicken)
4.  eats(y4,x4)  killedby(y4 , x4)  food(x4)
5. Eats (Bill, peanuts)
6. Alive (Bill)
7.  eats(Bill,x7)  eats(Sue,x7)
8.  alive(x8)   killedby(x8, y8)
36
37
Resolution proof that John likes peanuts
 likes (John, peanuts) (1)  food(x1)  likes (John, x1)
 food(peanuts) (4)  eats(y4,x4)  killedby(y4 . x4)  food(x4)
 eats(y4,peanuts)  killedby(y4. peanuts) (5) eats(Bill.peanuts)
killedby(Bill. peanuts) (8)  alive(x8)   killedby(x8 y8)
 alive(Bill) (6) alive(Bill)
peanuts/x1
peanuts/x4
Bill/x8, peanuts/y8
Bill/y4
Topics to be covered in next session 30
• Acting under uncertainity
Thank you!!!
1/23/2024 Department of AI & DS 1

More Related Content

Similar to AI3391 Artificial intelligence Session 29 Forward and backward chaining.pdf

ASSIGNMENT 1 7.4 EXERCISES Using the predicates listed for each.docx
ASSIGNMENT 1 7.4 EXERCISES Using the predicates listed for each.docxASSIGNMENT 1 7.4 EXERCISES Using the predicates listed for each.docx
ASSIGNMENT 1 7.4 EXERCISES Using the predicates listed for each.docxtrippettjettie
 
Logic and mathematics history and overview for students
Logic and mathematics history and overview for studentsLogic and mathematics history and overview for students
Logic and mathematics history and overview for studentsBob Marcus
 
Course Design Best Practices
Course Design Best PracticesCourse Design Best Practices
Course Design Best PracticesKeitaro Matsuoka
 
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
 
L05 Mathematical Induction in Discrete Mathmatics.ppt
L05 Mathematical Induction in Discrete Mathmatics.pptL05 Mathematical Induction in Discrete Mathmatics.ppt
L05 Mathematical Induction in Discrete Mathmatics.pptgbikorno
 
Logic programming (1)
Logic programming (1)Logic programming (1)
Logic programming (1)Nitesh Singh
 
Theory of first order logic
Theory of first order logicTheory of first order logic
Theory of first order logicDevaddd
 
Math and logic overview for students
Math and logic overview for students Math and logic overview for students
Math and logic overview for students Bob Marcus
 
AI NOTES ppt 4.pdf
AI NOTES ppt 4.pdfAI NOTES ppt 4.pdf
AI NOTES ppt 4.pdfARMANVERMA7
 
Critical reading
Critical readingCritical reading
Critical readingjohn6938
 
Physics of Intelligence
Physics of IntelligencePhysics of Intelligence
Physics of IntelligenceRobert Fry
 
Jarrar.lecture notes.aai.2011s.ch7.p logic
Jarrar.lecture notes.aai.2011s.ch7.p logicJarrar.lecture notes.aai.2011s.ch7.p logic
Jarrar.lecture notes.aai.2011s.ch7.p logicPalGov
 

Similar to AI3391 Artificial intelligence Session 29 Forward and backward chaining.pdf (20)

ASSIGNMENT 1 7.4 EXERCISES Using the predicates listed for each.docx
ASSIGNMENT 1 7.4 EXERCISES Using the predicates listed for each.docxASSIGNMENT 1 7.4 EXERCISES Using the predicates listed for each.docx
ASSIGNMENT 1 7.4 EXERCISES Using the predicates listed for each.docx
 
AI_session 23 Resolution.pptx
AI_session 23 Resolution.pptxAI_session 23 Resolution.pptx
AI_session 23 Resolution.pptx
 
Logic and mathematics history and overview for students
Logic and mathematics history and overview for studentsLogic and mathematics history and overview for students
Logic and mathematics history and overview for students
 
AI_5 Resolution/ Channing
AI_5 Resolution/ ChanningAI_5 Resolution/ Channing
AI_5 Resolution/ Channing
 
lect14-semantics.ppt
lect14-semantics.pptlect14-semantics.ppt
lect14-semantics.ppt
 
Course Design Best Practices
Course Design Best PracticesCourse Design Best Practices
Course Design Best Practices
 
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
 
L05 Mathematical Induction in Discrete Mathmatics.ppt
L05 Mathematical Induction in Discrete Mathmatics.pptL05 Mathematical Induction in Discrete Mathmatics.ppt
L05 Mathematical Induction in Discrete Mathmatics.ppt
 
Logic programming (1)
Logic programming (1)Logic programming (1)
Logic programming (1)
 
Theory of first order logic
Theory of first order logicTheory of first order logic
Theory of first order logic
 
Math and logic overview for students
Math and logic overview for students Math and logic overview for students
Math and logic overview for students
 
Predicate logic
 Predicate logic Predicate logic
Predicate logic
 
AI NOTES ppt 4.pdf
AI NOTES ppt 4.pdfAI NOTES ppt 4.pdf
AI NOTES ppt 4.pdf
 
Critical reading
Critical readingCritical reading
Critical reading
 
AI_Session 21 First order logic.pptx
AI_Session 21 First order logic.pptxAI_Session 21 First order logic.pptx
AI_Session 21 First order logic.pptx
 
Physics of Intelligence
Physics of IntelligencePhysics of Intelligence
Physics of Intelligence
 
Theory of Computation Unit 1
Theory of Computation Unit 1Theory of Computation Unit 1
Theory of Computation Unit 1
 
Worksheet
WorksheetWorksheet
Worksheet
 
Jarrar.lecture notes.aai.2011s.ch7.p logic
Jarrar.lecture notes.aai.2011s.ch7.p logicJarrar.lecture notes.aai.2011s.ch7.p logic
Jarrar.lecture notes.aai.2011s.ch7.p logic
 
Year 1 AI.ppt
Year 1 AI.pptYear 1 AI.ppt
Year 1 AI.ppt
 

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 27 inference and unification.pptx
AI3391 Artificial intelligence session 27 inference and unification.pptxAI3391 Artificial intelligence session 27 inference and unification.pptx
AI3391 Artificial intelligence session 27 inference and unification.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
 
AI3391 Artificial intelligence Session 22 Cryptarithmetic problem.pptx
AI3391 Artificial intelligence Session 22 Cryptarithmetic problem.pptxAI3391 Artificial intelligence Session 22 Cryptarithmetic problem.pptx
AI3391 Artificial intelligence Session 22 Cryptarithmetic problem.pptxAsst.prof M.Gokilavani
 
AI3391 Artificial Intelligence Session 21 CSP.pptx
AI3391 Artificial Intelligence Session 21 CSP.pptxAI3391 Artificial Intelligence Session 21 CSP.pptx
AI3391 Artificial Intelligence Session 21 CSP.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 27 inference and unification.pptx
AI3391 Artificial intelligence session 27 inference and unification.pptxAI3391 Artificial intelligence session 27 inference and unification.pptx
AI3391 Artificial intelligence session 27 inference and unification.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
 
AI3391 Artificial intelligence Session 22 Cryptarithmetic problem.pptx
AI3391 Artificial intelligence Session 22 Cryptarithmetic problem.pptxAI3391 Artificial intelligence Session 22 Cryptarithmetic problem.pptx
AI3391 Artificial intelligence Session 22 Cryptarithmetic problem.pptx
 
AI3391 Artificial Intelligence Session 21 CSP.pptx
AI3391 Artificial Intelligence Session 21 CSP.pptxAI3391 Artificial Intelligence Session 21 CSP.pptx
AI3391 Artificial Intelligence Session 21 CSP.pptx
 

Recently uploaded

Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineeringmalavadedarshan25
 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxvipinkmenon1
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx959SahilShah
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...VICTOR MAESTRE RAMIREZ
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
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
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2RajaP95
 
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
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girlsssuser7cb4ff
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
(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
 
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
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort servicejennyeacort
 
microprocessor 8085 and its interfacing
microprocessor 8085  and its interfacingmicroprocessor 8085  and its interfacing
microprocessor 8085 and its interfacingjaychoudhary37
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
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
 

Recently uploaded (20)

Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineering
 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptx
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
🔝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...
 
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
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
 
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
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girls
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
(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...
 
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
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
 
microprocessor 8085 and its interfacing
microprocessor 8085  and its interfacingmicroprocessor 8085  and its interfacing
microprocessor 8085 and its interfacing
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
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🔝
 

AI3391 Artificial intelligence Session 29 Forward and backward chaining.pdf

  • 1. AI3391 ARTIFICAL INTELLIGENCE (II YEAR (III Sem)) Department of Artificial Intelligence and Data Science Session 29 by Asst.Prof.M.Gokilavani NIET 1/23/2024 Department of AI & DS 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/23/2024 Department of AI & DS 2
  • 3. Topics covered in session 29 1/23/2024 Department of AI & DS 3 • 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
  • 4. First-Order Logic Chapter 8 Examples [04PBT 04PFT 04PLT 04PNT 04PRT] Genap 2011-2012 [dks0638]
  • 5. First-order logic • Whereas propositional logic assumes the world contains facts, • first-order logic (like natural language) assumes the world contains – Objects: people, houses, numbers, colors, baseball games, wars, … – Relations: red, round, prime, brother of, bigger than, part of, comes between, … – Functions: father of, best friend, one more than, plus, …
  • 6. Syntax of FOL • Constants KingJohn, 2, UofA,... • Predicates Brother, >,... • Functions Sqrt, LeftLegOf,... • Variables x, y, a, b,... • Connectives , , , ,  • Equality = • Quantifiers , 
  • 7. Example Knowledge Base The law says that it is a crime for an American to sell weapons to hostile nations. The country Nono, an enemy of America, has some missiles, and all of its missiles were sold to it by Colonel West, who is American. Prove that Col. West is a criminal!
  • 9. 6
  • 10. 7
  • 11. 8
  • 12. Properties of forward chaining 9 Sound and complete for first-order definite clauses (proof similar to propositional proof) Datalog = first-order definite clauses + no functions (e.g., crime KB) FC terminates for Datalog in poly iterations: at most p ∙ nk literals May not terminate in general if  is not entailed This is unavoidable: entailment with definite clauses is semidecidable
  • 13. Efficiency of forward chaining Simple observation: no need to match a rule on iteration k if a premise wasn't added on iteration k - 1  match each rule whose premise contains a newly added literal Matching itself can be expensive Database indexing allows O(1) retrieval of known facts e.g., query Missile(x) retrieves Missile(M1) Matching conjunctive premises against known facts is NP-hard Forward chaining is widely used in deductive databases
  • 14. 11
  • 15. 12
  • 16. 13
  • 17. 14
  • 18. 15
  • 19. 16
  • 20. 17
  • 21. Properties of backward chaining 18 Depth-first recursive proof search: space is linear in size of proof Incomplete due to infinite loops  fix by checking current goal against every goal on stack Inefficient due to repeated subgoals (both success and failure)  fix using caching of previous results (extra space!) Widely used (without improvements!) for logic programming
  • 22. 19
  • 23.
  • 24. 21
  • 25. Resolution refutation proofs involves the following steps: 1. Put the premises or axioms into clause form. 2. Add the negation of what is to be proved, in clause form, to the set of axioms. 3. Resolve these clauses together, producing new clauses that logically follow from them. 4. Produce a contradiction by generating the empty clause. 5. The substitutions used to produce the empty clause are those under which the opposite of the negated goal is true.
  • 26. A Facts in Propositional Logic 23 Given Axioms Clause Form P P (1) (P  Q)  R  P   Q  R (2) (S  T)  Q  S  Q (3)  T  Q (4) T T (5) Prove R!
  • 27. Resolution in Propositional Logic 24  P   Q  R (2)  R  P   Q P (1)  T  Q (4)  Q  T T (5)
  • 28. Prove fido will die! 1. All dogs are animal. 2. Fido is a dog. 3. All animals will die.
  • 29. Resolution proof for the “dead dog” problem.
  • 30. Lucky Student 1. Anyone passing his history exams and winning the lottery is happy. 2. Anyone who studies or is lucky can pass all his exams. 3. John did not study but he is lucky. 4. Anyone who is lucky wins the lottery. Prove that John is happy!
  • 31.
  • 32.
  • 33.
  • 34. One resolution refutation for the “happy student” problem. [1] [6] [5] [3] [5] [7] [10] [9] [9] [8]
  • 35. Exciting life 1. All people that are not poor and are smart are happy. 2. Those people that read are not stupid. 3. John can read and is wealthy. 4. Happy people have exiting lives. Can anyone be found with an exciting life?
  • 37. Resolution proof for the “exciting life” problem. [6] [5] [1] [2] [4] [3]
  • 38. Resolution Example 1. John likes all kinds of food. x: food(x)  likes(john, x) 2. Apples are food. food(apple) 3. Chicken is food. food(chicken) 4. Anything anyone eats and isn't killed by is food. x:(y: eats(y, x)   killedby(y, x))  food(x) 5. Bill eats peanuts and is still alive. A. eats(Bill, peanuts) B. alive(Bill) 6. Sue eats everything Bill eats. x:eats(Bill, x) eats(Sue, x) 7. x:y: alive(x)  killedby (x,y) 35
  • 39. Clause form: 1.  food(x1)  likes(John, x1) 2. food(apples) 3. food(chicken) 4.  eats(y4,x4)  killedby(y4 , x4)  food(x4) 5. Eats (Bill, peanuts) 6. Alive (Bill) 7.  eats(Bill,x7)  eats(Sue,x7) 8.  alive(x8)   killedby(x8, y8) 36
  • 40. 37 Resolution proof that John likes peanuts  likes (John, peanuts) (1)  food(x1)  likes (John, x1)  food(peanuts) (4)  eats(y4,x4)  killedby(y4 . x4)  food(x4)  eats(y4,peanuts)  killedby(y4. peanuts) (5) eats(Bill.peanuts) killedby(Bill. peanuts) (8)  alive(x8)   killedby(x8 y8)  alive(Bill) (6) alive(Bill) peanuts/x1 peanuts/x4 Bill/x8, peanuts/y8 Bill/y4
  • 41. Topics to be covered in next session 30 • Acting under uncertainity Thank you!!! 1/23/2024 Department of AI & DS 1