CHAPTER 11
Expert Systems
Artificial Intelligence: Building Intelligent Systems — Parag Kulkarni & Prachi Joshi
Learning Objectives
❑ Understand the relationship between Expert Systems and AI
❑ Understand the concept of Expert Systems and the process of building one
❑ Study the importance of knowledge representation for Expert Systems
❑ Study the role of reasoning (forward & backward chaining)
❑ Identify the impact of uncertainty in Expert Systems
❑ Gain knowledge about inferring and various types of Expert Systems in practice
Introduction
An Expert System (ES) is a computer system that possesses or emulates the decision-making
capabilities of a human expert. It is not simply any program with domain knowledge; it must incorporate a
strong knowledge representation and a robust reasoning and inferring mechanism.
Expert Systems have their roots in cognitive science, combining artificial intelligence and psychology.
They are the first successful applications of AI to real-world problem solving. Major application domains
include medicine, finance, and space research.
Brief History: A rule-based system was first proposed by E. Post in 1943. In 1961, a General Problem
Solver was proposed by A. Newell and H. Simon. Later, DENDRAL and MYCIN became the most
representative examples of ES. An ES finds its place in problem-solving domains and gives a reasonable
solution by comprising a knowledge base and a strong inferring mechanism. It can be classified for
prediction, planning, monitoring, and diagnosis.
11.1 Architecture of Expert System
An Expert System requires a strong Knowledge Base (KB) and an Inference Mechanism. The user
provides facts and the ES processes rules and gives outcomes/predictions.
Architecture Components
• Knowledge Base (KB): Contains factual knowledge (generally agreed-upon facts) and heuristic
knowledge (experience-based, helps in good predictions).
• Inference Mechanism: Derives conclusions using KB. Takes user-provided facts and produces
outcomes.
• Problem Knowledge: Specific to the type of problem at hand.
• Domain Knowledge: Persists with know-how about solving specific problems; forms a subset of
problem knowledge.
11.1.1 Parameters in Building an Expert System
Three basic parameters guide the building process:
Parameter Description
Domain Exploration Exploration of knowledge about the domain in which the system is
operational. Objects, their relationships, and relevant information are
identified from the KB-building perspective.
Expertise Transfer Transfer of expertise from expert to the system. Stages include:
Acquisition → Representation → Inference Building → Outcomes. At
every stage, some expertise is transferred as knowledge.
Meta-knowledge Knowledge about available knowledge. It is systematic and
domain-independent, helping build a generalised expert system.
Hierarchy: Data → Information → Knowledge → Meta-knowledge.
11.2 Confidence Factors
Confidence factors are values associated with a particular variable indicating the degree of truth. They
introduce fuzziness into the ES, allowing it to handle uncertainty and give multiple recommendations
simultaneously.
Obtaining the Confidence Factor
Confidence factors can be obtained through:
• User Input (Direct/Indirect): The user specifies the confidence level for a variable. Example: 'Yes,
50% chances are there that I will appear for the exam.' Indirect: rankings from a database serve as
confidence factors.
• Rule Set: Rules with associated confidence factors. Example: IF (degree=Computer Engineering) AND
(Masters=Computer Engineering) THEN High_salary_job=true with CF=75.
• Probabilistic Approaches: Probability values from prior data serve as confidence factors, though they
may not always be effective for all judgments.
11.3 Existing Expert Systems
MYCIN
Developed in the 1970s at Stanford University. Designed to assist physicians in diagnosing and treating
meningitis and bacterial infections.
MYCIN — Key Points
• Takes inputs from physicians via a dialogue and provides diagnosis + drug recommendations.
• Works in two phases: (1) Diagnosis, (2) Drug recommendation.
• Uses certainty factors based on doctor confidence to assist decisions.
• Physician can ask 'WHY?' — MYCIN explains the hypothesis under consideration and traces the
entire reasoning process.
• Each rule has a unique certainty factor (e.g., Rule 333 → 0.8 likelihood of infection, Rule 366 →
0.45 indicating disease is less likely).
• Limitation: Physicians cannot question existing rules; reasoning is restricted to available
knowledge.
• Set the benchmark for all subsequent expert systems in the medical domain.
DENDRAL
Started by AI researcher Edward Feigenbaum and geneticist Joshua Ledeberg in 1965. Purpose:
Expert system for chemical analysis — analyses organic compounds to determine their structure.
Strategy used: Plan-Generate-Test comprising three sub-programs:
• Generator: Forms the core of the heuristic approach. Generates potential solutions as larger graphs of
chemical atoms. CONGEN technique restricts structure generation.
• Planning Programs (MSPRUNE, MSRANK): Analyse data, infer constraints, make testable
predictions, and discard scenarios not satisfying specific criteria.
• Tester: Tests and ranks generated structures.
DENDRAL stages: Initial planning → Hypothesis formation → Generator (potential solutions) → Tester
(predictions). Applications: structure determination of organic acids in human urine, antibiotics,
manufactured chemicals. Meta-DENDRAL was introduced to automatically formulate rules and build a
stronger KB.
11.4 Knowledge Acquisition
Knowledge acquisition is the process by which the knowledge engineer extracts knowledge from the
domain expert to build the KB. It is complex because experts may be unwilling to cooperate fully, and the
KB must be refined to match required performance.
Knowledge Acquisition Systems are programs that assist in building effective KB. They: (a) input the
knowledge, (b) maintain consistency, and (c) make knowledge richer. They are most effective when
confined to specific problem-solving tasks.
Key Acquisition Systems
System Description
MORE Elicits knowledge from experts; most commonly used for diagnostic inferring.
Refines domain model with newly available info using a causal relations model.
MOLE Extension of MORE. Builds MOLE-p(performance) KB. Handles under-specified
knowledge, refines incomplete KB, identifies weak slots, and fills them. Used for
diagnostic problems in car engines, etc.
SALT Works on the propose-and-revise principle for design tasks. Incrementally
constructs designs by proposing values for design parameters. Stores knowledge
in a dependency network. Originally developed for elevator system configurer.
Meta-DENDRAL Automatic rule formulation program for building strong KB. Resulted in higher
accuracy in predicting correct spectra of new molecules.
11.5 Shells and Explanations
Shells
Shells (also called AI tools or skeletons) are interpreters used for building Expert Systems. By separating
the inference mechanism from domain-specific knowledge, the same shell can be reused for different
domains — only task knowledge needs to be entered. Example: EMYCIN (Empty MYCIN).
Shell Components (Figure 11.5)
• Inference mechanism
• Knowledge base subset
• Explanations
• User interface
Note: Shells simplify building but do NOT help in knowledge acquisition directly. Some advanced shells,
however, include tools for knowledge acquisition.
Explanations
Explanation is an important feature of the ES that shows the ability of the system to express itself. It
makes the system interactive and provides details on how a particular conclusion was drawn. Explanations
are based on the rules used in the inference process.
Two aspects of explanations: (1) Why certain questions are being asked during inference, and (2) How a
conclusion was derived once it is reached. Backward reasoning and previously answered questions
enable the ES to provide these explanations.
11.6 Self-Explaining System
A Self-Explaining System is a feature of the ES that shows its ability to explain itself — justifying why a
particular question is being asked and how it arrived at its conclusions. In some systems (particularly
medical diagnosis), a self-explaining module is inbuilt to provide reasoning for the diagnosis.
11.7 Rule-Based Expert Systems
Rule-based systems consist of rules (if-then), facts, and an interpreter. The rules constitute the
complete KB. The inference engine seeks necessary information and relationships from the KB to answer
queries and find the right facts.
Example rule: If the number is divisible by 2, then it is even.
Semantics of Rules
Semantic Type Explanation
Relation Specifies the relationship between antecedent and consequent. Example:
If the water is boiling, then the water is hot.
Recommendation Gives advice. Example: If the water in glass is hot, then advice not to touch
the glass.
Strategy Tells what needs to be checked; advises actions for betterment. Example:
If road 1 is blocked, then try road 2.
Directive Implies some action that needs to be carried out. Example: If the light is
green, then you can proceed.
Heuristic States a guidelines-based rule. Example: If there is severe pain in chest
and difficult to breathe, then the diagnosis might be a heart attack.
Conflict Resolution in Rule-Based Systems
Conflict can arise in rule selection or consequent mapping. Resolution strategies:
• Apply explicit ranking (prioritising rules).
• Sequential triggering — fire rules in order.
• Fire the rule with the highest-ranking current data.
• Trigger the longest rule.
Pros and Cons
Advantages • Knowledge representation resembles human reasoning. • Can handle uncertain
knowledge. • Easy to understand and explain.
Disadvantages • Managing and updating KB gets complex with large data. • Conflict resolution
gets more complicated as KB grows. • Rigid behaviour — useless outside the
domain scope.
11.8 Forward and Backward Chaining
Inference Mechanisms at a Glance
Forward Chaining (Data-Driven): Processes facts first. Keeps looking for the next matching rule
until it fires and proceeds. A rule fires when the antecedent is matched, else it halts. Best used
when data collection is expensive and the data set is small.
Backward Chaining (Goal-Driven): Starts from the goal/conclusion and moves backward to find
evidence to prove it. Matches the consequent rather than the antecedent. Antecedents become
new sub-goals. Best used when the data to be handled is substantially large or when specific
characteristics need to be evaluated.
Worked Example
Rules: Rule 1: If P and Q, then A. | Rule 2: If P and R, then B. | Rule 3: If S, then R. | Rule 4: If B, then C.
To prove: C is true given P and S are true.
Forward Chaining: Start → Rule 3 matches (S → R is true) → Facts: P, S, R → Rule 2 matches (P and R
→ B) → Rule 4 matches (B → C). C is proved.
Backward Chaining: Goal C → From Rule 4: need B → From Rule 2: need P and R → From Rule 3:
need S → S is true (given). Tracing back: R is true, B is true, C is true. Proved.
11.9 Frame-Based Expert Systems
Expert systems that use frames for knowledge representation are called Frame-Based Expert Systems.
A frame (Minsky's frame) is a data structure with typical knowledge about an object or concept — it has a
name and a set of attributes (slots).
Each slot can contain: frame name, relationships with other frames, values or ranges, and procedural
information. Slot content triggers a procedure when any event (e.g., change in slot value) occurs.
Frame Types
• Class-frame: Refers to a group (e.g., Car, Person, Bird).
• Instance-frame: Refers to a specific object (e.g., Car-i10, Car-Verna).
Concepts of generalisation (is-a), aggregation (part-of), and association (belongs-to) apply to frames,
making them suitable for object-oriented programming techniques.
Methods in Frame-Based Systems
Since an expert system needs methods (procedures) in addition to knowledge, methods and demons are
added to frames.
• When-changed method: Executed when the value of a slot changes.
• When-needed method: Used to obtain the value for an attribute when it is required during problem
solving.
• Demon: Uses if-then structure; simpler. Methods are used for more complex tasks.
Guidelines to Build a Frame-Based Expert System
1. Define the scope and specificity of the problem with utmost clarity.
2. Identify classes, instances, and attributes.
3. Since methods are key role players in evaluation, design the display in a simple and transparent
manner.
4. Decide on the 'when-changed' and 'when-needed' methods based on step 3.
5. Define rules along with the methods.
6. Perform full evaluation of the built system and handle expansion if required.
11.10 Fuzzy Expert Systems
A Fuzzy Expert System makes use of fuzzy logic — providing mapping for uncertainty where
approximate reasoning exists rather than exactness. The most common rule form: If X is low and Y is high,
then Z is medium, where X, Y are inputs, Z is output, and low/high/medium define the degree of
membership.
The set of fuzzy rules constitutes the KB. Fuzzy expert systems can have multiple conclusions per rule.
Four Processes of the Fuzzy Inference Mechanism
Process Description
1. Fuzzification Membership functions are defined on variables. Input variables are applied to
actual values to determine the degree of truth for each rule premise (called
alpha).
2. Inference The truth value for the premise is calculated. Mechanisms: min (output
membership cut off at computed degree of truth) and product (output scaled
by computed degree of truth).
3. Composition Fuzzy subsets are combined to form a single fuzzy subset for the output
variable. Methods: sum (point-wise sum over fuzzy sets) and max (point-wise
maximum over fuzzy sets).
4. Defuzzification Fuzzy value is converted to a crisp value. Methods: centroid (calculates fuzzy
centroid) and maximum (average-maximum where maximum truth value
occurs).
Advantages of Fuzzy Expert Systems
• KB has a limited number of rules — efficient.
• Knowledge is structurally shallow, so run-time chaining for inferences is not required.
• Exhibit less maintenance cost and can be built at a faster rate.
• KB is semantically rich — well-suited for decision-making.
• Most effectively used in pattern recognition.
11.11 Uncertainty Management in Expert Systems
Uncertainty means lack of exact knowledge that prevents arriving at an exact conclusion. Information can
be partial, incomplete, and uncertain. Uncertainty arises from: different opinions from multiple sources,
missing data values, dependency on domain experts for concrete rules.
Expert systems require a probabilistic approach for handling uncertainty. The KB itself is also a major
source of uncertain knowledge. Rule-based expert systems are good at handling uncertain knowledge.
Commonly used methods:
• Certainty Factors — numerical values indicating the degree of confidence.
• Bayesian Probability — statistical probabilistic approach.
• Dempster–Shafer Theory — generalises Bayesian probability to handle ignorance.
Note: The selection of method depends on the available reliable statistical information for the application.
11.12 Expert System and Decision Support System (DSS)
ES technology is embedded in DSS. DSS is categorised into: data-oriented DSS (data warehouse),
model-oriented DSS (small databases), and process-oriented DSS (question-oriented models). ES falls
under process-oriented DSS.
ES often faces the problem of lack of deep knowledge. DSS is not built by just ES — it includes other
components that support decisions. DSSs are used at a higher level of business intelligence for strategic
decisions.
ES vs DSS
• When data sets are structured: DSS can wholly rely on ES.
• When data is complex and unstructured: DSS uses other methods in addition to ES.
• The nature of expected output from the DSS determines how ES is to be used in it.
11.13 Pros and Cons of Expert Systems
<b>Advantages</b> <b>Disadvantages</b>
Consistent output Cannot handle new dynamic situations
Quick and fast response Not adaptive based on decisions taken earlier
Location/date/day/time independent Limited knowledge → limited decision outcomes
Can be made generalised Development cost could be high
Efficient utilisation of knowledge (considers all rules and scenarios)
Simple future enhancements (add knowledge/rules easily)
Easy system maintenance
11.14 Case Study — PROSPECTOR (Geology Domain ES)
PROSPECTOR is an expert system in the geology domain designed to evaluate the mineral potential
of a geological region. It handles geological settings, structural controls, and different types of rocks and
minerals.
Aspect Details
Target Users Geologists at an early stage of investigating a potential drilling site.
Key Points Can handle uncertain and incomplete data. Domain independent. Data is
matched to models to check the presence of ore to identify drilling sites.
KB Structure General KB: Domain-independent background info applicable to other
areas. Special Purpose KB: Domain-specific knowledge in the form of an
inference network.
Methodology Uses production rules and semantic networks. Employs backward
chaining inference strategy.
Representation Uses an Inference Network — a collection of evidence and hypotheses
linked together. Form: If E (evidence), then H (hypothesis). Uses Bayes's
theorem to update probabilities of E and H during execution. Computes
probabilities of influential factors via semantic networks (associative
memory model).
Inference Mechanism Handles uncertainty using Bayesian methods, certainty factors, and fuzzy
sets. Uses odds-theorem (a form of Bayes's theorem). Measure of
sufficiency (when E is known to exist) and measure of necessity (when E is
not known to exist). Models: Logical operators model (And/Or), Plausible
combination model (rules with DS, DN), Context identification model
(Certainty factor).
Chapter Summary
Chapter 11 — Expert Systems: Key Takeaways
• Expert Systems help in problem solving by combining a Knowledge Base and an Inference
Mechanism.
• MYCIN and DENDRAL are early landmark expert systems, now used as benchmarks.
• Knowledge acquisition involves obtaining and refining knowledge; tools include MORE, MOLE,
SALT.
• Forward chaining is data-driven; backward chaining is goal-driven.
• Frame-based ES are best suited for object-oriented approaches.
• Fuzzy ES use fuzzy logic — Fuzzification → Inference → Composition → Defuzzification.
• Uncertainty is managed via Certainty Factors, Bayesian Probability, and Dempster–Shafer Theory.
• Shells (e.g., EMYCIN) simplify ES construction by separating inference from domain knowledge.
• ES is embedded in DSS to assist with structured decision-making.
• Drawbacks: No common sense, non-incremental, domain-specific, requires expert maintenance.
Keywords
Expert System:
An AI-based computer program that simulates expert judgment using knowledge and inference
mechanism to offer advice or infer.
Inference Mechanism:
Responsible for getting conclusions with the help of KB.
Domain Exploration:
Concerned with the exploration of knowledge about the domain in which the expert system is active.
Expertise Transfer:
In the process of ES building, expertise is transferred from one entity to another in the form of
knowledge to build KB.
Meta-knowledge:
Helps in building a domain-independent expert system.
MYCIN:
Early expert system developed to aid physicians in diagnosis and treatment of meningitis and
bacterial infections.
DENDRAL:
Early expert system that analyses organic compounds to determine their structure.
Knowledge Acquisition:
Acquiring expert knowledge; though not fully automatic, acquisition tools assist in building effective
KB.
Shells:
Interpreters used for building the ES; also called AI tools or skeletons.
Explanations:
Features of the ES that tell about the reasoning; allow the system to express itself.
Self-explaining System:
Ability of an ES to justify why a rule is fired.
Rule-based ES:
Expert system based on if-then rules, facts, and the inference mechanism.
Frame-based ES:
Expert system that makes use of knowledge as frames.
Fuzzy Expert System:
Expert system that makes use of fuzzy logic with membership functions and rules to reason.
End of Chapter 11 Notes — Artificial Intelligence: Building Intelligent Systems