Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

LAB-03: Expert system Objectives: - To define Expert Systems - To learn how to create and build an expert system - To implement an expert

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

LAB-03: Expert system Objectives: - To define "Expert Systems" - To learn how to create and build an "expert system" - To implement an "expert system" using Prolog - To create an expert system that identify animals - To create an expert system that guide customers to find suitable hotels all over the world Lablearning Outcomes: Students should get familiar with: - How to make an Expert System - Howexpert system works An expert system is a computer system that emulates the decision-making ability of a human expert. Expert systems are designed to solve complex problems by reasoning about knowledge, represented primarily as IF-THEN rules. An expert system is divided into two sub-systems: the inference engine and the knowledge base. The knowledge base represents facts about the world and rules. The inference engine applies the rules to the known facts to deduce newfacts. Inference engines can also include explanation and debugging capabilities. Two examples for expert systems are given here: 1- An expert system that helps to identify animals. 2- An expert system to guide customers and help them to find and locate hotels all over the world with respect to their location, region, services, and season sale. Example: Animals identification Our aim is to write an expert system that helps us identify animals. Suppose we have already obtained the following knowledge about animals, which are rules of inference: - If it has a fur and says woof, then the animal is a dog. - If it has a fur and says meow, then the animal is a cat. - If it has feathers and says quack, then the animal is a duck. The key idea of an expert system is to derive useful new information based on user-provided input. In th following, we see several ways to do this in Prolog. Direct Prolog implementation We now consider an implementation that uses Prolog rules directly to implement the mentioned inference rules. This is straight-forward, using is_true/1 to emit a question and only proceeding with the current clause if the user input is the atom yes: There is a clear drawback of this approach, which is shown in the following sample interaction: ?- animal(A). has fur? I: yes. says woof? I: no. has fur? I: yes. says meow? I: yes. A=cat. Note: The system has asked a question redundantly: Ideally, the fact that the animal does have a fur would have to be stated at most once by the user. Using a different Domain Specific Language Let us view the animal identification task as interpreting the following decision diagram, where dotted lines indicate no, and plain lines indicate yes: In this case, the diagram is in fact a full binary tree which can be represented naturally using Prolog terms. For example, let us represent the decision tree as follows, using a term of the form if then_else for each inner node, and animal and false for leaves: tree(if_then_else("has fur", Such trees can be interpreted in a straight-forward way, using again the definition of is_true to query the user: animal (A): tree (T), tree_animal (T,A). \( \begin{array}{l}\text { tree_animal (animal }(\mathrm{A}), \mathrm{A}) \text {. } \\ \text { tree_animal (if_then else (Cond, Then, Else), A) :- } \\ \text { ( } \text { isttrue (Cond) - } \\ \text { tree_animal (Then, A) } \\ \text {; } \text { tree_animal (Else, A) }\end{array} \) Since each question appears at most once on every path from the root to a leaf, it is not necessary to keep track of which questions have already been answered: ?- animal (A). has fur? I: yes. says woof? I: no. says meow? I: yes. A= cat. Reference: https://www.metalevel.at/prolog/expertsystems

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle Database 19c DBA By Examples Installation And Administration

Authors: Ravinder Gupta

1st Edition

B09FC7TQJ6, 979-8469226970

More Books

Students also viewed these Databases questions