Expert Systems
Expert Systems
Module 5
Contents
Expert Systems:
What an expert system is;
How it works and how it is built,
Basic components of an expert system, Expert System
Architectures,
Examples of Expert Systems.
Rule-based Expert systems: Structure of rule based expert
system, Conflict resolution, Uncertainty Management,
Advantages & disadvantages of rule-based.
Introduction to Frame-based Expert systems.
Types of Expert Systems
• Types of Expert Systems
1. Forward chaining – Answers the question, “What can happen in the future?”
2. Backward chaining – Answers the question, “Why did this happen?”
Forward Chaining
• Forward chaining is a form of reasoning which start with atomic sentences in the knowledge
base and applies inference rules (Modus Ponens) in the forward direction to extract more
data until a goal is reached.
• The Forward-chaining algorithm starts from known facts, triggers all rules whose premises
are satisfied, and add their conclusion to the known facts. This process repeats until the
problem is solved.
Forward Chaining in Propositional Logic
• In propositional logic, forward chaining starts its journey from the given knowledge base. If
all the premises of the implication are known, then its conclusion will be added to the set of
known facts.
• Let’s see an example:
1. If D barks and D eats bone, then D is a dog.
2. If V is cold and V is sweet, then V is ice-cream.
3. If D is a dog, then D is black.
4. If V is ice-cream, then it is Vanilla.
• Derive forward chaining using the given known facts to prove Tomy is black.
• Let’s see an example:
1. If D barks and D eats bone, then D is a dog.
2. If V is cold and V is sweet, then V is ice-cream.
3. If D is a dog, then D is black.
4. If V is ice-cream, then it is Vanilla.
• Derive forward chaining using the given known facts to prove Tomy
is black.
Tomy barks.
Tomy eats bone.
Solution: Given Tomy barks.
• From (1), it is clear:
• If Tomy barks and Tomy eats bone, then Tomy is a dog.
• From (3), it is clear:
• If Tomy is a dog, then Tomy is black.
• Hence, it is proved that Tomy is black.
Example 1
Example 2
Backward chaining
• A backward chaining algorithm is a form of reasoning, which starts with
the goal and works backward, chaining through rules to find known facts
that support the goal.
Properties of backward chaining:
• It is known as a top-down approach.
• Backward-chaining is based on modus ponens inference rule.
• In backward chaining, the goal is broken into sub-goal or sub-goals to
prove the facts true.
• It is called a goal-driven approach, as a list of goals decides which rules are
selected and used.
• Backward -chaining algorithm is used in game theory, automated theorem
proving tools, inference engines, proof assistants, and various AI
applications.
• The backward-chaining method mostly used a depth-first search strategy
for proof.
Backward Chaining in Propositional Logic
• In propositional logic, backward chaining begins from the
goal and using the given propositions, it proves the asked
goal. There is a backward chaining algorithm which is
used to perform backward chaining for the given axioms.
Given that:
1. If D barks and D eats bone, then D is a dog.
2. If V is cold and V is sweet, then V is ice-cream.
3. If D is a dog, then D is black.
4. If V is ice-cream, then it is Vanilla.
Derive backward chaining using the given known facts to prove Tomy is black.
• Tomy barks.
• Tomy eats bone.
Solution:
1. On replacing D with Tomy in (3), it becomes:
• If Tomy is a dog, then Tomy is black.
• Thus, the goal is matched with the above axiom.
• Now, we have to prove Tomy is a dog. …(new goal)
• Replace D with Tomy in (1), it will become:
• If Tomy barks and Tomy eats bone, then Tomy is a dog. …(new goal)
• Again, the goal is achieved.
• Now, we have to prove that Tomy barks and Tomy eats bone. …(new goal)
• As we can see, the goal is a combination of two sentences which can be further divided as:
• Tomy barks.
• Tomy eats bone.
• From (1), it is clear that Tomy is a dog.
• Hence, Tomy is black.
Example 1
Building an Expert System in Artificial
Intelligence
1. Determine the characteristics of the problem.
2. Knowledge engineers and domain experts collaborate to define the issue.
• Domain expert – A person or group of people whose skills and
knowledge are acquired to develop the knowledge base.
• Knowledge engineer – A technical person who uses the acquired
knowledge and integrates it with expert computer systems.
3. The knowledge engineer, after defining the problem, translates it into
understandable computer language knowledge. The knowledge engineer
designs the inference engine that uses the knowledge when called to assist.
4. The knowledge expert also integrates the use of unknown knowledge in
the reasoning process with an explanation.
Examples of expert systems
Expert systems that are in use include the following examples:
• CaDet (Cancer Decision Support Tool) is used to identify cancer in its
earliest stages.
• DENDRAL helps chemists identify unknown organic molecules.
• DXplain is a clinical support system that diagnoses various diseases.
• MYCIN identifies bacteria such as bacteremia and meningitis, and
recommends antibiotics and dosages.
• PXDES determines the type and severity of lung cancer a person has.
• R1/XCON is an early manufacturing expert system that automatically
selects and orders computer components based on customer
specifications.
Rule-based Expert systems
What is knowledge?
Knowledge Engineer:
• is someone who is capable of designing, building and testing an expert system.
• interviews the domain expert to find out how a particular problem is solved.
• establishes what reasoning methods the expert uses to handle facts and rules and
decides how to represent them in the expert system.
• choose some development software or an expert systems shell, or look at
programming languages for encoding the knowledge.
• responsible for testing, revising and integrating the expert system into the workplace.
Programmer:
• is the person responsible for the actual programming, describing the domain
knowledge in terms that a computer can understand.
• needs to have the skills in symbolic programming in such AI language such as
Prolog.
• should also know conventional programming language like C, Pascal, FORTRAN
and Basic
Project Manager:
• is the leader of the expert system development team, responsible for keeping the
project on track
• makes sure that all deliverables and milestones are met, interacts with the
expert, knowledge engineer, programmer and end-user
End-user:
• often called the user
• is a person who uses the expert system when it is developed
• must not only be confident in the expert system performance but also feel
comfortable using it
Basic Structure of a rule-based
expert system
Knowledge base contains the domain knowledge useful for problem
solving
• In rule-based expert system, the knowledge is represented as a set of
rules. Each rule specifies a relation, recommendation, directive,
strategy or heuristic and has the IF (condition) THEN (action)
structure.
• When the condition part of a rule is satisfied, the rule is said to fire
and the action part is executed
• The database includes a set of facts used to match against the IF
(condition) parts of rules stored in the knowledge base.
• The inference engineer carries out the reasoning whereby the
expert system reaches a solution. It links the rules given in the
knowledge base with the facts provided in the database.
• The explanation facilities enable the user to ask the expert system
how a particular conclusion is reached and why a specific fact is
needed
• The user interface is the means of communication between a user
seeking a solution to the problem and an expert system
Conflict Resolution
Let us consider two simple rules for crossing a road. And let us now add the third rule:
Rule 1:
IF the ‘traffic light’ is green THEN the action is go
Rule 2:
IF the ‘traffic light’ is red THEN the action is stop
Rule 3:
IF the ‘traffic light’ is red THEN the action is go
We have two rules, Rule 2 and Rule 3, with the same IF part. Thus both of them
can be set to fire when the condition part is satisfied.
These rules represent a conflict set
The inference engine must determine which rule to fire from such a set
A method for choosing a rule to fire when more than one rule can be fired in a given
cycle is called conflict resolution
Uncertainty Management in Rule-based Expert
Systems
Information can be incomplete, inconsistent, uncertain, or all three.
Uncertainty is defined as the lack of the exact knowledge that would enable us to
reach a perfectly reliable conclusion.
Classical logic permits only exact reasoning. Classical logic permits only exact
reasoning. It assumes that perfect knowledge always exists and the law of the
excluded middle can always be applied:
Facts and inferences dealt with so far have been categorical - either true or false; real
life facts and rules are often less than certain
Uncertainty can be expressed numerically as certainty/confidence factor (cf) or
measure of belief (mb)
cf usually is a real number in a particular range, eg, 0 to 1 or -1 to 1
Various schemes have been proposed to deal with uncertainty
Advantages of rule-based expert systems
Separation of knowledge from its processing
• The structure of a rule-based expert system provides an effective
separation of the knowledge base from the inference engine.
• This makes it possible to develop different applications using the
same expert system shell.