Unit-7 Expert Systems
Unit-7 Expert Systems
Expert System
7.1. Definition and History of Expert System.
1. User Interface
With the help of a user interface, the expert system interacts with
the user, takes queries as an input in a readable format, and passes it
to the inference engine. After getting the response from the inference
engine, it displays the output to the user. In other words, it is an
interface that helps a non-expert user to communicate with the expert
system to find a solution.
1. Logical Representation.
2. Semantic Networks
3. Frames
4. Production Rules
5. Ontologies
1. Logical Representation
Logical representation involves using formal logic systems like
propositional and predicate logic to represent knowledge in a
structured, precise, and unambiguous way.
Logical representation allows AI systems to perform reasoning by
applying rules of inference to drive conclusions from known facts. It is
commonly used in applications that require rigorous and consistent
decision-making, such as theorem proving and rule-based systems.
Example:
• Fact : patient has fever.
• Rule: IF fever AND rash THEN possibility of measles.
Advantages:
• Precise and unambiguous.
• Facilitates reasoning using inference rules.
Limitations:
• Can become complex for large systems.
2. Semantic Networks
A semantic network is a graphical representation of knowledge where
nodes represent concepts, and edges represent relationships between
those concepts.
Semantic networks are used to model hierarchical relationships (like
class hierarchies in object-oriented programming) and associative
relationships (such as synonymy in natural language processing). They
help AI systems understand the connections between different
concepts and perform tasks like inference, classification, and ontology
mapping.
Example:
Node: Bird
Relationship: can Fly
Node: Robin (a type of Bird)
Advantage:
Visual and easy to understand.
Captures relationships effectively.
3. Frames
Frames are data structures that encapsulate knowledge about objects,
situations, or events in a structured format. Each frame contains
attributes (slots) and their associated values, which can include default
values, constraints, and even procedural knowledge.
Frames are used to represent stereotypical situations or objects,
allowing AI systems to make inferences based on the structure and
relationships within the frames. For example, a frame for a “car” might
include slots for make, model, color, and owner, along with rules for
filling in missing information.
Structure:
Frame: Car
Attribute: Color = Red
Attribute: Model = Sedan
Advantages:
Supports default reasoning and inheritance
Captures structured knowledge well.
Limitations:
May struggle with non-structured knowledge.
4. Production Rules
Production rules are “if-then” statements that express knowledge in
the form of conditions and corresponding actions. They are a key
component of rule-based systems.
Production rules are used in expert systems, where they form the
basis for decision-making and problem-solving. When the condition (if-
part) of a rule is met, the corresponding action (then-part) is executed,
enabling the AI system to derive conclusions, perform tasks, or
generate responses.
Example:
IF condition(s) THEN Actions(s).
IF temperature > 1000F THEN diagnosis =fever.
Advantages:
Intuitive and straightforward.
Easy to update and maintain.
Limitations:
Inefficient for large and complex systems.
5. Ontologies
Ontology is a formal representation of a set of concepts within a
domain and the relationships between them. Ontologies provide a
shared vocabulary and a common understanding of a domain, which
can be used by both humans and AI systems.
Ontologies are widely used in knowledge management, semantic web
technologies, and natural language processing. They enable AI systems
to understand the context of information, perform reasoning across
different domains, and facilitate interoperability between systems. For
example, ontology for the medical domain might define relationships
between diseases, symptoms, and treatment, helping AI systems to
diagnose illnesses or suggest treatment options.
Properties of Forward-Chaining:
• It is a down-up approach, as it moves from bottom to top.
• It is a process of making a conclusion based on known facts or
data, by starting from the initial state and reaches the goal state.
• Forward-Chaining approach is also called as data-driven as we
reach to the goal using available data.
• Forward-chaining approach is commonly used in the expert
system, such as CLIPS, business, and production rule systems.
Example:
Consider a medical diagnosis system:
• Facts: Patient has fever and cough.
• Rules:
1. If the patient has fever and cough, they might have the flu.
2. If the patient has the flu, recommend rest and hydration.
Final Classification:
• The animal is a flying bird.
Facts:
• The animal lays eggs.
• The animal has feathers.
• The animal can fly.
Goal:
Determine if the animal is a flying bird.
Steps (Backward Chaining):
1. Start with the goal: “The animal is a flying bird.”
2. Look for rules that conclude “flying bird”.
• Rule 4: “If the animal is a bird and can fly, it is a flying
bird.”
3. Check the conditions of Rule 4:
• “The animal is a bird” -> subgoal 1.
• “The animal can fly” -> known fact (True).
4. Subgoal 1: Determine if the animal is a bird.
• Look for rules that conclude “bird”.
o Rule 1: “ If the animal lays eggs and has feathers, it is a
bird.”
5. Check the conditions of Rule 1:
• “The animal lays egg” -> known fact (True).
• “The animal has feathers” -> Known fact (True).
Final Conclusion:
The animal is a flying bird.