CPSC 322 Introduction to Artificial Intelligence December 3, 2004.
CPSC 433 Artificial Intelligence CPSC 433 : Artificial Intelligence Tutorials T01 & T02 Andrew...
-
date post
22-Dec-2015 -
Category
Documents
-
view
232 -
download
1
Transcript of CPSC 433 Artificial Intelligence CPSC 433 : Artificial Intelligence Tutorials T01 & T02 Andrew...
![Page 1: CPSC 433 Artificial Intelligence CPSC 433 : Artificial Intelligence Tutorials T01 & T02 Andrew “M” Kuipers amkuiper@cpsc.ucalgary.ca note: please include.](https://reader035.fdocuments.net/reader035/viewer/2022062314/56649d785503460f94a5b51c/html5/thumbnails/1.jpg)
CPSC 433 Artificial Intelligence
CPSC 433 : Artificial Intelligence Tutorials T01 & T02
Andrew “M” [email protected]
note: please include [cpsc 433] in the subject line of any emails regarding this course
![Page 2: CPSC 433 Artificial Intelligence CPSC 433 : Artificial Intelligence Tutorials T01 & T02 Andrew “M” Kuipers amkuiper@cpsc.ucalgary.ca note: please include.](https://reader035.fdocuments.net/reader035/viewer/2022062314/56649d785503460f94a5b51c/html5/thumbnails/2.jpg)
CPSC 433 Artificial Intelligence
Expert Systems
• Designed to function similar to a human expert operating within a specific problem domain
• Used to:– Provide an answer to a certain problem, or– Clarify uncertainties where normally a human expert would be
consulted
• Often created to operate in conjunction with humans working within the given problem domain, rather than as a replacement for them
![Page 3: CPSC 433 Artificial Intelligence CPSC 433 : Artificial Intelligence Tutorials T01 & T02 Andrew “M” Kuipers amkuiper@cpsc.ucalgary.ca note: please include.](https://reader035.fdocuments.net/reader035/viewer/2022062314/56649d785503460f94a5b51c/html5/thumbnails/3.jpg)
CPSC 433 Artificial Intelligence
Components of an Expert Systems
• Knowledge Base– Stores knowledge used by the system, usually
represented in a formal logical manner
• Inference System– Defines how existing knowledge may be used to
derive new knowledge
• Search Control– Determines which inference to apply at a given stage
of the deduction
![Page 4: CPSC 433 Artificial Intelligence CPSC 433 : Artificial Intelligence Tutorials T01 & T02 Andrew “M” Kuipers amkuiper@cpsc.ucalgary.ca note: please include.](https://reader035.fdocuments.net/reader035/viewer/2022062314/56649d785503460f94a5b51c/html5/thumbnails/4.jpg)
CPSC 433 Artificial Intelligence
Knowledge Representation
• For now, we’ll use a simple If … Then … consequence relation using English semantics
• ie: If [it is raining] Then [I should wear a coat]– [it is raining] is the antecedent of the relation– [I should wear a coat] is the consequent of the relation
• Facts can be understood as consequence relations with an empty antecedent– ie: “If [] Then [it is raining]” is equivalent to the fact that [it is
raining]
![Page 5: CPSC 433 Artificial Intelligence CPSC 433 : Artificial Intelligence Tutorials T01 & T02 Andrew “M” Kuipers amkuiper@cpsc.ucalgary.ca note: please include.](https://reader035.fdocuments.net/reader035/viewer/2022062314/56649d785503460f94a5b51c/html5/thumbnails/5.jpg)
CPSC 433 Artificial Intelligence
Inferring New Knowledge
• New knowledge can be constructed from existing knowledge using inference rules
• For instance, the inference rule modus ponens can be used to derive the consequent of a consequence relation, given that the antecedent is true
• ie: – k1: If [it is raining] Then [I should wear a coat]– k2: [it is raining]– result: [I should wear a coat]
![Page 6: CPSC 433 Artificial Intelligence CPSC 433 : Artificial Intelligence Tutorials T01 & T02 Andrew “M” Kuipers amkuiper@cpsc.ucalgary.ca note: please include.](https://reader035.fdocuments.net/reader035/viewer/2022062314/56649d785503460f94a5b51c/html5/thumbnails/6.jpg)
CPSC 433 Artificial Intelligence
Goal Directed Reasoning
• Inference rules are applied to knowledge base in order to achieve a particular goal
• The goal in an expert system is formed as a question, or query, to which we want the answer
• ie: [I should wear a coat]?– note: this would read easier in English as “should I wear a coat”,
but we want to use the same propositional symbol as is in our knowledge base
• The goal of the search is to determine an answer to the query, which may be boolean as above or more complex
![Page 7: CPSC 433 Artificial Intelligence CPSC 433 : Artificial Intelligence Tutorials T01 & T02 Andrew “M” Kuipers amkuiper@cpsc.ucalgary.ca note: please include.](https://reader035.fdocuments.net/reader035/viewer/2022062314/56649d785503460f94a5b51c/html5/thumbnails/7.jpg)
CPSC 433 Artificial Intelligence
Forward Chaining
• Forward chaining is a data driven method of deriving a particular goal from a given knowledge base and set of inference rules
• Inference rules are applied by matching facts to the antecedents of consequence relations in the knowledge base
• The application of inference rules results in new knowledge (from the consequents of the relations matched), which is then added to the knowledge base
![Page 8: CPSC 433 Artificial Intelligence CPSC 433 : Artificial Intelligence Tutorials T01 & T02 Andrew “M” Kuipers amkuiper@cpsc.ucalgary.ca note: please include.](https://reader035.fdocuments.net/reader035/viewer/2022062314/56649d785503460f94a5b51c/html5/thumbnails/8.jpg)
CPSC 433 Artificial Intelligence
Forward Chaining
• Inference rules are successively applied to elements of the knowledge base until the goal is reached
• A search control method is needed to select which element(s) of the knowledge base to apply the inference rule to at any point in the deduction
![Page 9: CPSC 433 Artificial Intelligence CPSC 433 : Artificial Intelligence Tutorials T01 & T02 Andrew “M” Kuipers amkuiper@cpsc.ucalgary.ca note: please include.](https://reader035.fdocuments.net/reader035/viewer/2022062314/56649d785503460f94a5b51c/html5/thumbnails/9.jpg)
CPSC 433 Artificial Intelligence
Forward Chaining Example
• Knowledge Base:– If [X croaks and eats flies] Then [X is a frog]– If [X chirps and sings] Then [X is a canary]– If [X is a frog] Then [X is colored green]– If [X is a canary] Then [X is colored yellow]– [Fritz croaks and eats flies]
• Goal:– [Fritz is colored Y]?
![Page 10: CPSC 433 Artificial Intelligence CPSC 433 : Artificial Intelligence Tutorials T01 & T02 Andrew “M” Kuipers amkuiper@cpsc.ucalgary.ca note: please include.](https://reader035.fdocuments.net/reader035/viewer/2022062314/56649d785503460f94a5b51c/html5/thumbnails/10.jpg)
CPSC 433 Artificial Intelligence
Forward Chaining Example
Knowledge BaseIf [X croaks and eats flies]Then [X is a frog]
If [X chirps and sings]Then [X is a canary]
If [X is a frog] Then [X is colored green]
If [X is a canary] Then [X is colored yellow]
[Fritz croaks and eats flies]
Goal[Fritz is colored Y]?
![Page 11: CPSC 433 Artificial Intelligence CPSC 433 : Artificial Intelligence Tutorials T01 & T02 Andrew “M” Kuipers amkuiper@cpsc.ucalgary.ca note: please include.](https://reader035.fdocuments.net/reader035/viewer/2022062314/56649d785503460f94a5b51c/html5/thumbnails/11.jpg)
CPSC 433 Artificial Intelligence
Forward Chaining Example
Knowledge BaseIf [X croaks and eats flies]Then [X is a frog]
If [X chirps and sings]Then [X is a canary]
If [X is a frog] Then [X is colored green]
If [X is a canary] Then [X is colored yellow]
[Fritz croaks and eats flies]
Goal[Fritz is colored Y]?
![Page 12: CPSC 433 Artificial Intelligence CPSC 433 : Artificial Intelligence Tutorials T01 & T02 Andrew “M” Kuipers amkuiper@cpsc.ucalgary.ca note: please include.](https://reader035.fdocuments.net/reader035/viewer/2022062314/56649d785503460f94a5b51c/html5/thumbnails/12.jpg)
CPSC 433 Artificial Intelligence
Forward Chaining Example
If [X croaks and eats flies] Then [X is a frog] [Fritz croaks and eats flies]
[Fritz is a frog]
Knowledge BaseIf [X croaks and eats flies]Then [X is a frog]
If [X chirps and sings]Then [X is a canary]
If [X is a frog] Then [X is colored green]
If [X is a canary] Then [X is colored yellow]
[Fritz croaks and eats flies]
Goal[Fritz is colored Y]?
![Page 13: CPSC 433 Artificial Intelligence CPSC 433 : Artificial Intelligence Tutorials T01 & T02 Andrew “M” Kuipers amkuiper@cpsc.ucalgary.ca note: please include.](https://reader035.fdocuments.net/reader035/viewer/2022062314/56649d785503460f94a5b51c/html5/thumbnails/13.jpg)
CPSC 433 Artificial Intelligence
Forward Chaining Example
If [X croaks and eats flies] Then [X is a frog] [Fritz croaks and eats flies]
[Fritz is a frog]
Knowledge BaseIf [X croaks and eats flies]Then [X is a frog]
If [X chirps and sings]Then [X is a canary]
If [X is a frog] Then [X is colored green]
If [X is a canary] Then [X is colored yellow]
[Fritz croaks and eats flies]
[Fritz is a frog]
Goal[Fritz is colored Y]?
![Page 14: CPSC 433 Artificial Intelligence CPSC 433 : Artificial Intelligence Tutorials T01 & T02 Andrew “M” Kuipers amkuiper@cpsc.ucalgary.ca note: please include.](https://reader035.fdocuments.net/reader035/viewer/2022062314/56649d785503460f94a5b51c/html5/thumbnails/14.jpg)
CPSC 433 Artificial Intelligence
Forward Chaining Example
If [X croaks and eats flies] Then [X is a frog] [Fritz croaks and eats flies]
[Fritz is a frog]
?
Knowledge BaseIf [X croaks and eats flies]Then [X is a frog]
If [X chirps and sings]Then [X is a canary]
If [X is a frog] Then [X is colored green]
If [X is a canary] Then [X is colored yellow]
[Fritz croaks and eats flies]
[Fritz is a frog]
Goal[Fritz is colored Y]?
![Page 15: CPSC 433 Artificial Intelligence CPSC 433 : Artificial Intelligence Tutorials T01 & T02 Andrew “M” Kuipers amkuiper@cpsc.ucalgary.ca note: please include.](https://reader035.fdocuments.net/reader035/viewer/2022062314/56649d785503460f94a5b51c/html5/thumbnails/15.jpg)
CPSC 433 Artificial Intelligence
Forward Chaining Example
If [X croaks and eats flies] Then [X is a frog] [Fritz croaks and eats flies]
[Fritz is a frog]
Knowledge BaseIf [X croaks and eats flies]Then [X is a frog]
If [X chirps and sings]Then [X is a canary]
If [X is a frog] Then [X is colored green]
If [X is a canary] Then [X is colored yellow]
[Fritz croaks and eats flies]
[Fritz is a frog]
Goal[Fritz is colored Y]?
![Page 16: CPSC 433 Artificial Intelligence CPSC 433 : Artificial Intelligence Tutorials T01 & T02 Andrew “M” Kuipers amkuiper@cpsc.ucalgary.ca note: please include.](https://reader035.fdocuments.net/reader035/viewer/2022062314/56649d785503460f94a5b51c/html5/thumbnails/16.jpg)
CPSC 433 Artificial Intelligence
Forward Chaining Example
If [X croaks and eats flies] Then [X is a frog] [Fritz croaks and eats flies]
[Fritz is a frog]If [X is a frog]Then [X is colored green]
[Fritz is colored green]
Knowledge BaseIf [X croaks and eats flies]Then [X is a frog]
If [X chirps and sings]Then [X is a canary]
If [X is a frog] Then [X is colored green]
If [X is a canary] Then [X is colored yellow]
[Fritz croaks and eats flies]
[Fritz is a frog]
Goal[Fritz is colored Y]?
![Page 17: CPSC 433 Artificial Intelligence CPSC 433 : Artificial Intelligence Tutorials T01 & T02 Andrew “M” Kuipers amkuiper@cpsc.ucalgary.ca note: please include.](https://reader035.fdocuments.net/reader035/viewer/2022062314/56649d785503460f94a5b51c/html5/thumbnails/17.jpg)
CPSC 433 Artificial Intelligence
Forward Chaining Example
If [X croaks and eats flies] Then [X is a frog] [Fritz croaks and eats flies]
[Fritz is a frog]If [X is a frog]Then [X is colored green]
[Fritz is colored green]
Knowledge BaseIf [X croaks and eats flies]Then [X is a frog]
If [X chirps and sings]Then [X is a canary]
If [X is a frog] Then [X is colored green]
If [X is a canary] Then [X is colored yellow]
[Fritz croaks and eats flies]
[Fritz is a frog]
[Fritz is colored green]
Goal[Fritz is colored Y]?
![Page 18: CPSC 433 Artificial Intelligence CPSC 433 : Artificial Intelligence Tutorials T01 & T02 Andrew “M” Kuipers amkuiper@cpsc.ucalgary.ca note: please include.](https://reader035.fdocuments.net/reader035/viewer/2022062314/56649d785503460f94a5b51c/html5/thumbnails/18.jpg)
CPSC 433 Artificial Intelligence
Forward Chaining Example
If [X croaks and eats flies] Then [X is a frog] [Fritz croaks and eats flies]
[Fritz is a frog]If [X is a frog]Then [X is colored green]
[Fritz is colored green]
?
Knowledge BaseIf [X croaks and eats flies]Then [X is a frog]
If [X chirps and sings]Then [X is a canary]
If [X is a frog] Then [X is colored green]
If [X is a canary] Then [X is colored yellow]
[Fritz croaks and eats flies]
[Fritz is a frog]
[Fritz is colored green]
Goal[Fritz is colored Y]?
![Page 19: CPSC 433 Artificial Intelligence CPSC 433 : Artificial Intelligence Tutorials T01 & T02 Andrew “M” Kuipers amkuiper@cpsc.ucalgary.ca note: please include.](https://reader035.fdocuments.net/reader035/viewer/2022062314/56649d785503460f94a5b51c/html5/thumbnails/19.jpg)
CPSC 433 Artificial Intelligence
Forward Chaining Example
If [X croaks and eats flies] Then [X is a frog] [Fritz croaks and eats flies]
[Fritz is a frog]If [X is a frog]Then [X is colored green]
[Fritz is colored green]
Knowledge BaseIf [X croaks and eats flies]Then [X is a frog]
If [X chirps and sings]Then [X is a canary]
If [X is a frog] Then [X is colored green]
If [X is a canary] Then [X is colored yellow]
[Fritz croaks and eats flies]
[Fritz is a frog]
[Fritz is colored green]
Goal[Fritz is colored Y]?
![Page 20: CPSC 433 Artificial Intelligence CPSC 433 : Artificial Intelligence Tutorials T01 & T02 Andrew “M” Kuipers amkuiper@cpsc.ucalgary.ca note: please include.](https://reader035.fdocuments.net/reader035/viewer/2022062314/56649d785503460f94a5b51c/html5/thumbnails/20.jpg)
CPSC 433 Artificial Intelligence
Forward Chaining Example
If [X croaks and eats flies] Then [X is a frog] [Fritz croaks and eats flies]
[Fritz is a frog]If [X is a frog]Then [X is colored green]
[Fritz is colored green] [Fritz is colored Y] ?
Knowledge BaseIf [X croaks and eats flies]Then [X is a frog]
If [X chirps and sings]Then [X is a canary]
If [X is a frog] Then [X is colored green]
If [X is a canary] Then [X is colored yellow]
[Fritz croaks and eats flies]
[Fritz is a frog]
[Fritz is colored green]
Goal[Fritz is colored Y]?Y = green
![Page 21: CPSC 433 Artificial Intelligence CPSC 433 : Artificial Intelligence Tutorials T01 & T02 Andrew “M” Kuipers amkuiper@cpsc.ucalgary.ca note: please include.](https://reader035.fdocuments.net/reader035/viewer/2022062314/56649d785503460f94a5b51c/html5/thumbnails/21.jpg)
CPSC 433 Artificial Intelligence
Backward Chaining
• Backward chaining is a goal driven method of deriving a particular goal from a given knowledge base and set of inference rules
• Inference rules are applied by matching the goal of the search to the consequents of the relations stored in the knowledge base
• When such a relation is found, the antecedent of the relation is added to the list of goals (and not into the knowledge base, as is done in forward chaining)
![Page 22: CPSC 433 Artificial Intelligence CPSC 433 : Artificial Intelligence Tutorials T01 & T02 Andrew “M” Kuipers amkuiper@cpsc.ucalgary.ca note: please include.](https://reader035.fdocuments.net/reader035/viewer/2022062314/56649d785503460f94a5b51c/html5/thumbnails/22.jpg)
CPSC 433 Artificial Intelligence
Backward Chaining
• Search proceeds in this manner until a goal can be matched against a fact in the knowledge base– Remember: facts are simply consequence relations
with empty antecedents, so this is like adding the ‘empty goal’ to the list of goals
• As with forward chaining, a search control method is needed to select which goals will be matched against which consequence relations from the knowledge base
![Page 23: CPSC 433 Artificial Intelligence CPSC 433 : Artificial Intelligence Tutorials T01 & T02 Andrew “M” Kuipers amkuiper@cpsc.ucalgary.ca note: please include.](https://reader035.fdocuments.net/reader035/viewer/2022062314/56649d785503460f94a5b51c/html5/thumbnails/23.jpg)
CPSC 433 Artificial Intelligence
Backward Chaining Example
Knowledge BaseIf [X croaks and eats flies]Then [X is a frog]
If [X chirps and sings]Then [X is a canary]
If [X is a frog] Then [X is colored green]
If [X is a canary] Then [X is colored yellow]
[Fritz croaks and eats flies]
Goals[Fritz is colored Y]?
![Page 24: CPSC 433 Artificial Intelligence CPSC 433 : Artificial Intelligence Tutorials T01 & T02 Andrew “M” Kuipers amkuiper@cpsc.ucalgary.ca note: please include.](https://reader035.fdocuments.net/reader035/viewer/2022062314/56649d785503460f94a5b51c/html5/thumbnails/24.jpg)
CPSC 433 Artificial Intelligence
Backward Chaining Example
Knowledge BaseIf [X croaks and eats flies]Then [X is a frog]
If [X chirps and sings]Then [X is a canary]
If [X is a frog] Then [X is colored green]
If [X is a canary] Then [X is colored yellow]
[Fritz croaks and eats flies]
Goals[Fritz is colored Y]?
![Page 25: CPSC 433 Artificial Intelligence CPSC 433 : Artificial Intelligence Tutorials T01 & T02 Andrew “M” Kuipers amkuiper@cpsc.ucalgary.ca note: please include.](https://reader035.fdocuments.net/reader035/viewer/2022062314/56649d785503460f94a5b51c/html5/thumbnails/25.jpg)
CPSC 433 Artificial Intelligence
Backward Chaining Example
Knowledge BaseIf [X croaks and eats flies]Then [X is a frog]
If [X chirps and sings]Then [X is a canary]
If [X is a frog] Then [X is colored green]
If [X is a canary] Then [X is colored yellow]
[Fritz croaks and eats flies]
Goals[Fritz is colored Y]?
[Fritz is colored Y]
If [X is a frog]Then [X is colored green]
[X is a frog]
![Page 26: CPSC 433 Artificial Intelligence CPSC 433 : Artificial Intelligence Tutorials T01 & T02 Andrew “M” Kuipers amkuiper@cpsc.ucalgary.ca note: please include.](https://reader035.fdocuments.net/reader035/viewer/2022062314/56649d785503460f94a5b51c/html5/thumbnails/26.jpg)
CPSC 433 Artificial Intelligence
Backward Chaining Example
Knowledge BaseIf [X croaks and eats flies]Then [X is a frog]
If [X chirps and sings]Then [X is a canary]
If [X is a frog] Then [X is colored green]
If [X is a canary] Then [X is colored yellow]
[Fritz croaks and eats flies]
Goals[Fritz is colored Y]?
[X is a frog]
[Fritz is colored Y]
If [X is a frog]Then [X is colored green]
[X is a frog]
![Page 27: CPSC 433 Artificial Intelligence CPSC 433 : Artificial Intelligence Tutorials T01 & T02 Andrew “M” Kuipers amkuiper@cpsc.ucalgary.ca note: please include.](https://reader035.fdocuments.net/reader035/viewer/2022062314/56649d785503460f94a5b51c/html5/thumbnails/27.jpg)
CPSC 433 Artificial Intelligence
Backward Chaining Example
Knowledge BaseIf [X croaks and eats flies]Then [X is a frog]
If [X chirps and sings]Then [X is a canary]
If [X is a frog] Then [X is colored green]
If [X is a canary] Then [X is colored yellow]
[Fritz croaks and eats flies]
Goals[Fritz is colored Y]?
[X is a frog]
[Fritz is colored Y]
If [X is a frog]Then [X is colored green]
[X is a frog]
![Page 28: CPSC 433 Artificial Intelligence CPSC 433 : Artificial Intelligence Tutorials T01 & T02 Andrew “M” Kuipers amkuiper@cpsc.ucalgary.ca note: please include.](https://reader035.fdocuments.net/reader035/viewer/2022062314/56649d785503460f94a5b51c/html5/thumbnails/28.jpg)
CPSC 433 Artificial Intelligence
Backward Chaining Example
Knowledge BaseIf [X croaks and eats flies]Then [X is a frog]
If [X chirps and sings]Then [X is a canary]
If [X is a frog] Then [X is colored green]
If [X is a canary] Then [X is colored yellow]
[Fritz croaks and eats flies]
Goals[Fritz is colored Y]?
[X is a frog]
[Fritz is colored Y]
If [X is a frog]Then [X is colored green]
[X is a frog]
If [X is a canary]Then [X is colored yellow]
[X is a canary]
![Page 29: CPSC 433 Artificial Intelligence CPSC 433 : Artificial Intelligence Tutorials T01 & T02 Andrew “M” Kuipers amkuiper@cpsc.ucalgary.ca note: please include.](https://reader035.fdocuments.net/reader035/viewer/2022062314/56649d785503460f94a5b51c/html5/thumbnails/29.jpg)
CPSC 433 Artificial Intelligence
Backward Chaining Example
Knowledge BaseIf [X croaks and eats flies]Then [X is a frog]
If [X chirps and sings]Then [X is a canary]
If [X is a frog] Then [X is colored green]
If [X is a canary] Then [X is colored yellow]
[Fritz croaks and eats flies]
Goals[Fritz is colored Y]?
[X is a frog]
[X is a canary]
[Fritz is colored Y]
If [X is a frog]Then [X is colored green]
[X is a frog]
If [X is a canary]Then [X is colored yellow]
[X is a canary]
![Page 30: CPSC 433 Artificial Intelligence CPSC 433 : Artificial Intelligence Tutorials T01 & T02 Andrew “M” Kuipers amkuiper@cpsc.ucalgary.ca note: please include.](https://reader035.fdocuments.net/reader035/viewer/2022062314/56649d785503460f94a5b51c/html5/thumbnails/30.jpg)
CPSC 433 Artificial Intelligence
Backward Chaining Example
Knowledge BaseIf [X croaks and eats flies]Then [X is a frog]
If [X chirps and sings]Then [X is a canary]
If [X is a frog] Then [X is colored green]
If [X is a canary] Then [X is colored yellow]
[Fritz croaks and eats flies]
Goals[Fritz is colored Y]?
[X is a frog]
[X is a canary]
[Fritz is colored Y]
If [X is a frog]Then [X is colored green]
[X is a frog]
If [X is a canary]Then [X is colored yellow]
[X is a canary]
![Page 31: CPSC 433 Artificial Intelligence CPSC 433 : Artificial Intelligence Tutorials T01 & T02 Andrew “M” Kuipers amkuiper@cpsc.ucalgary.ca note: please include.](https://reader035.fdocuments.net/reader035/viewer/2022062314/56649d785503460f94a5b51c/html5/thumbnails/31.jpg)
CPSC 433 Artificial Intelligence
Backward Chaining Example
Knowledge BaseIf [X croaks and eats flies]Then [X is a frog]
If [X chirps and sings]Then [X is a canary]
If [X is a frog] Then [X is colored green]
If [X is a canary] Then [X is colored yellow]
[Fritz croaks and eats flies]
Goals[Fritz is colored Y]?
[X is a frog]
[X is a canary]
[Fritz is colored Y]
If [X is a frog]Then [X is colored green]
[X is a frog]
If [X is a canary]Then [X is colored yellow]
[X is a canary]
If [X croaks and eats flies]Then [X is a frog]
[X croaks and eats flies]
![Page 32: CPSC 433 Artificial Intelligence CPSC 433 : Artificial Intelligence Tutorials T01 & T02 Andrew “M” Kuipers amkuiper@cpsc.ucalgary.ca note: please include.](https://reader035.fdocuments.net/reader035/viewer/2022062314/56649d785503460f94a5b51c/html5/thumbnails/32.jpg)
CPSC 433 Artificial Intelligence
Backward Chaining Example
Knowledge BaseIf [X croaks and eats flies]Then [X is a frog]
If [X chirps and sings]Then [X is a canary]
If [X is a frog] Then [X is colored green]
If [X is a canary] Then [X is colored yellow]
[Fritz croaks and eats flies]
Goals[Fritz is colored Y]?
[X is a frog]
[X is a canary]
[X croaks and eats flies]
[Fritz is colored Y]
If [X is a frog]Then [X is colored green]
[X is a frog]
If [X is a canary]Then [X is colored yellow]
[X is a canary]
If [X croaks and eats flies]Then [X is a frog]
[X croaks and eats flies]
![Page 33: CPSC 433 Artificial Intelligence CPSC 433 : Artificial Intelligence Tutorials T01 & T02 Andrew “M” Kuipers amkuiper@cpsc.ucalgary.ca note: please include.](https://reader035.fdocuments.net/reader035/viewer/2022062314/56649d785503460f94a5b51c/html5/thumbnails/33.jpg)
CPSC 433 Artificial Intelligence
Backward Chaining Example
Knowledge BaseIf [X croaks and eats flies]Then [X is a frog]
If [X chirps and sings]Then [X is a canary]
If [X is a frog] Then [X is colored green]
If [X is a canary] Then [X is colored yellow]
[Fritz croaks and eats flies]
Goals[Fritz is colored Y]?
[X is a frog]
[X is a canary]
[X croaks and eats flies]
[Fritz is colored Y]
If [X is a frog]Then [X is colored green]
[X is a frog]
If [X is a canary]Then [X is colored yellow]
[X is a canary]
If [X croaks and eats flies]Then [X is a frog]
[X croaks and eats flies]
![Page 34: CPSC 433 Artificial Intelligence CPSC 433 : Artificial Intelligence Tutorials T01 & T02 Andrew “M” Kuipers amkuiper@cpsc.ucalgary.ca note: please include.](https://reader035.fdocuments.net/reader035/viewer/2022062314/56649d785503460f94a5b51c/html5/thumbnails/34.jpg)
CPSC 433 Artificial Intelligence
Backward Chaining Example
Knowledge BaseIf [X croaks and eats flies]Then [X is a frog]
If [X chirps and sings]Then [X is a canary]
If [X is a frog] Then [X is colored green]
If [X is a canary] Then [X is colored yellow]
[Fritz croaks and eats flies]
Goals[Fritz is colored Y]?
[X is a frog]
[X is a canary]
[X croaks and eats flies]
[Fritz is colored Y]
If [X is a frog]Then [X is colored green]
[X is a frog]
If [X is a canary]Then [X is colored yellow]
[X is a canary]
If [X croaks and eats flies]Then [X is a frog]
[X croaks and eats flies] [Fritz croaks and eats flies]
X = Fritz, Y = green
![Page 35: CPSC 433 Artificial Intelligence CPSC 433 : Artificial Intelligence Tutorials T01 & T02 Andrew “M” Kuipers amkuiper@cpsc.ucalgary.ca note: please include.](https://reader035.fdocuments.net/reader035/viewer/2022062314/56649d785503460f94a5b51c/html5/thumbnails/35.jpg)
CPSC 433 Artificial Intelligence
Backward Chaining Example
Knowledge BaseIf [X croaks and eats flies]Then [X is a frog]
If [X chirps and sings]Then [X is a canary]
If [X is a frog] Then [X is colored green]
If [X is a canary] Then [X is colored yellow]
[Fritz croaks and eats flies]
Goals[Fritz is colored Y]?
[X is a frog]
[X is a canary]
[X croaks and eats flies]
[Fritz is colored Y]
If [X is a frog]Then [X is colored green]
If [X is a canary]Then [X is colored yellow]
[X is a frog] [X is a canary]
If [X croaks and eats flies]Then [X is a frog]
[X croaks and eats flies] [Fritz croaks and eats flies]
X = Fritz, Y = green