61
7/23/2019 Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf http://slidepdf.com/reader/full/dr-j-vijipriya-expert-system-lecture-notes-chapter-12345pdf 1/61 Hawassa University Institute of Technology School of Informatics Course Tile: Expert System Course Code: InTe 4392/InSy 3102 Instructor Name: Dr. J. VIJIPRIYA Course Credit: 3 1. Course Description: The course will explains and explores essential concepts and methods of Expert Systems and their design and development, and reviews expert knowledge-based problem-solving systems. It will concentrate on an analysis of the architecture, knowledge and problem- solving style, their classification and comparison. Topics covered includes: introduction to AI, definitions and historical development of ES, methodology tools for analysis and design, survey of existing systems, inference engines, and theory and applications of fuzzy relational products to new developments in inference engines. In addition students will be introduced with the practical application of Expert Systems technology using CLISP- expert system development language. 2. Course Goals or Learning Outcome: After completing this course students will be able to: comprehend and explain the main principles, components, and application areas for expert systems express methods for knowledge representation and reasoning in computers demonstrate expert systems’ role in operations and strategy, and specify their strength and limitations understand the structure of expert systems apply expert systems techniques for specific tasks implementation design and develop expert systems using appropriate knowledge based software tools 3. Required Texts: v Text Book Joseph Giarratano, Gary Riley, Expert Systems: Principles and Programming (4 th Edition), Thomson Course Technology, 2004 CLIPS User’s Guide v Reference Peter Jackson, Introduction to Expert Systems ( 3rd edition), Addison Wesley Longman, Harlow, England, 1999 David S. Prerau, Developing and Managing Expert Systems, John Durkin, Expert Systems: Catalog of Applications, 4. Assessment: Tests/Quiz: (20%) Project/Assignment: (10%) Attendance (5%) Quiz (15%) Final examination: (50%)

Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

Embed Size (px)

Citation preview

Page 1: Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

7/23/2019 Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

http://slidepdf.com/reader/full/dr-j-vijipriya-expert-system-lecture-notes-chapter-12345pdf 1/61

Hawassa University

Institute of Technology

School of InformaticsCourse Tile: Expert System Course Code: InTe 4392/InSy 3102

Instructor Name: Dr. J. VIJIPRIYA Course Credit: 3

1. Course Description:

The course will explains and explores essential concepts and methods of Expert Systems and their

design and development, and reviews expert knowledge-based problem-solving systems. It willconcentrate on an analysis of the architecture, knowledge and problem- solving style, their

classification and comparison. Topics covered includes: introduction to AI, definitions and historicaldevelopment of ES, methodology tools for analysis and design, survey of existing systems, inference

engines, and theory and applications of fuzzy relational products to new developments in inferenceengines. In addition students will be introduced with the practical application of Expert Systemstechnology using CLISP- expert system development language.

2. Course Goals or Learning Outcome:

After completing this course students will be able to:∑ comprehend and explain the main principles, components, and application areas for expert

systems

∑ express methods for knowledge representation and reasoning in computers

∑ demonstrate expert systems’ role in operations and strategy, and specify their strength andlimitations

∑ understand the structure of expert systems

∑ apply expert systems techniques for specific tasks implementation

∑ design and develop expert systems using appropriate knowledge based software tools

3. Required Texts:

v Text Book ∑ Joseph Giarratano, Gary Riley, Expert Systems: Principles and Programming (4th Edition),

Thomson Course Technology, 2004

∑ CLIPS User’s Guide

v Reference

∑ Peter Jackson, Introduction to Expert Systems ( 3rd edition), Addison Wesley Longman,

Harlow, England, 1999

∑ David S. Prerau, Developing and Managing Expert Systems,

∑ John Durkin, Expert Systems: Catalog of Applications,

4. Assessment:

Tests/Quiz: (20%)Project/Assignment: (10%)

Attendance (5%)Quiz (15%)Final examination: (50%)

Page 2: Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

7/23/2019 Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

http://slidepdf.com/reader/full/dr-j-vijipriya-expert-system-lecture-notes-chapter-12345pdf 2/61

5. Topics to be covered in this course::

Chapter 1 Introduction to AI

1.1 Definition of AI1.2 State of the art1.3 Intelligent agents. types, structure and environments

1.4 Problem types & its formulation1.5 ES and AI

Chapter 2 Introduction to Expert Systems

2.1 What is an Expert System?2.2 Expert System: Principles, Elements, Characteristics2.3 Advantages and Limitations of ES

2.4 Applications of ES2.5 ES relationship with other programming

Chapter 3 Knowledge Representation

3.1 Knowledge definition3.2 Knowledge Representation

ß Atoms, connectives, quantifiersß Semantic Nets, Frames, Logic

Chapter 4 Inference Methods and Reasoning

4.1 Inference Methodsß Inference rules, Predicate Logic, Resolution

ß Forward and backward chaining

4.2 Reasoning

ß Reasoning with Uncertainty

ß Probability

ß Inexact Reasoning

Chapter 5 Expert System Design and Pattern Matching

5.1 Expert System Design

ß Selection of appropriate problemß Stage in development of ESß Software Engineering and ESsß ES life Cycle and Model

5.2 Pattern Matchingß Variables, Functions, Expressions, Constraints

5.3 Expert Systems technology using CLISP- expert system development language

Page 3: Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

7/23/2019 Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

http://slidepdf.com/reader/full/dr-j-vijipriya-expert-system-lecture-notes-chapter-12345pdf 3/61

InTe 4392/InSy 3102 Expert System

1

Prepared by Dr. J. VIJIPRIYA

Chapter 1

Introduction to Artificial Intelligence

1.1 Definition of AI , AI Technologies

∑ Definition of AI

- Branch of Computer Science concerned with making computers behaves like

humans

- Study and Design of Intelligent Agent

- Used to make computer that think and act like human’s Intelligent rationally

(through the use of computer models)

- AI is permanent, can be easily duplicated, can be less expensive, and can be

documented over natural intelligence

∑ List the major AI technologies

- Expert systems

-  Neural networks

- Intelligent agents- Fuzzy logic

- Genetic algorithms

-  Natural language processing

- Robotics

- Speech understanding

- Speech (voice) recognition

- Computer vision and scene recognition

- Intelligent computer-aided instruction

-  Neural computing, intelligent agents

- Automatic programming translation of languages

1.2 State of the Art (What can AI do today?)

1. Autonomous Planning and Scheduling :

 NASA Remote Agent monitored the operation of the space craft

Page 4: Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

7/23/2019 Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

http://slidepdf.com/reader/full/dr-j-vijipriya-expert-system-lecture-notes-chapter-12345pdf 4/61

InTe 4392/InSy 3102 Expert System

2

Prepared by Dr. J. VIJIPRIYA

2. Game Playing:

IBM’s Deep Blue is the first computer program to defeat the world champion

in chess

3. Autonomous Control :

ALVINN computer vision system control the steering of vehicle

4. Diagnosis:

Medical diagnosis program based on probabilistic analysis have been able to

 perform at the level of expert physician.

5. Logistics Planning:

Logistics planning and scheduling for transport

6. Robotics:

Many surgeons now use robot assistants in microsurgery

7. Language Understanding and Problem solving:

Computer program that solves crossword puzzles better than human beings

using constraints on possible word fillers, large database of past puzzles and a

variety of information sources including dictionaries and online database

1.3 Intelligent Agents

∑ Definition of Intelligent Agent,

- An agent is anything that can be viewed as perceiving its environment through

sensors and acting upon that environment through effectors (Actuators).

- An ideal rational agent always takes the action that maximizes its

 performance given the percept sequence and its environment knowledge

- Example 1:

A human agent has eyes, ears, and other organs for sensors, and hands, legs,

mouth, and other body parts for effectors.

- Example 2:

A robotic agent substitutes cameras and infrared range finders for the sensors

and various motors for the effectors.

Example 3:

Software Agent

Page 5: Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

7/23/2019 Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

http://slidepdf.com/reader/full/dr-j-vijipriya-expert-system-lecture-notes-chapter-12345pdf 5/61

InTe 4392/InSy 3102 Expert System

3

Prepared by Dr. J. VIJIPRIYA

Sensor: Keystroke, file contents and Network packets

Effectors: Displaying on screen, Writing Files and sending Network Packets

How Agent should actSensors

Percepts

?

Environment

Agent

Actions

Effectors

Figure 1.1 Agents interact with environments through sensors and effectors

• A generic agent is diagrammed in Figure 1.1.

• The agent function maps from percept histories to actions:

[ f : P*‡

A]• The agent program runs on the physical architecture to produce f 

Vacuum-cleaner world

Fig 1.2 Vacuum cleaner-world with just two locations

• Percepts: location and contents, e.g., [A,Dirty]

• Actions: Left , Right , Suck , NoOp

Agent Function

Page 6: Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

7/23/2019 Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

http://slidepdf.com/reader/full/dr-j-vijipriya-expert-system-lecture-notes-chapter-12345pdf 6/61

InTe 4392/InSy 3102 Expert System

4

Prepared by Dr. J. VIJIPRIYA

Percept Sequence Action

[A, Clean]

[A, Dirty]

[B, Clean]

[B. Dirty]

Move Right

Suck up to dirty

Left

Suck up to dirty

Agent Program

Function Vacuum-gent (location, states) returns an action

If status = dirty then return suck Else if location = A then return Right

Else if location=B then return Left

Rational agents

• An agent should strive to "do the right thing", based on what it can perceive and the

actions it can perform. The right action is the one that will cause the agent to be

most successful

• Performance measure: An objective criterion for success of an agent's behavior 

• E.g., performance measure of a vacuum-cleaner agent could be amount of dirt

cleaned up, amount of time taken, amount of electricity consumed, amount of noise

generated, etc.

• Rational Agent: For each possible percept sequence, a rational agent should select

an action that is expected to maximize its performance measure, given the evidence

 provided by the percept sequence and whatever built-in knowledge the agent has.

• Rationality is distinct from omniscience (all-knowing with infinite knowledge)

• Agents can perform actions in order to modify future percepts so as to obtain useful

information (information gathering, exploration)

• An agent is autonomous if its behavior is determined by its own experience (with

ability to learn and adapt)

Page 7: Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

7/23/2019 Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

http://slidepdf.com/reader/full/dr-j-vijipriya-expert-system-lecture-notes-chapter-12345pdf 7/61

InTe 4392/InSy 3102 Expert System

5

Prepared by Dr. J. VIJIPRIYA

PEAS: Performance measure, Environment, Actuators, Sensors

• It must first specify the setting for intelligent agent design

Example 1- Agent: Medical diagnosis system

Performance measure: Healthy patient, minimize costs, lawsuits

Environment: Patient, hospital, staff 

Actuators: Screen display (questions, tests, diagnoses, treatments, referrals)

Sensors: Keyboard (entry of symptoms, findings, patient's answers)

Example 2- Agent: Part-picking robot

Performance measure: Percentage of parts in correct bins

Environment: Conveyor belt with parts, bins

Actuators: Jointed arm and hand

Sensors: Camera, joint angle sensors

Example 3 - Agent: Interactive English tutor

Performance measure: Maximize student's score on test

Environment: Set of students

Actuators: Screen display (exercises, suggestions, corrections)

Sensors: KeyboardStructure of Intelligent Agents

Agent behavior is the action that is performed after any given sequence of percepts.

How the insides work of Agents

The job of AI is to design the agent program: a function that implements the agent

mapping from percepts to actions. This program will run on some sort of computing device

called the architecture. The program has to be one that the architecture will accept and

run.

The Agent architecture might be a plain computer, or it might include special-

 purpose hardware for certain tasks, such as processing camera images or filtering audio

input. It might also include software that provides a degree of insulation between the raw

computer and the agent program, so that we can program at a higher level.

In general, the architecture makes the percepts from the sensors available to the

 program, runs the program, and feeds the program’s action choices to the effectors as they

Page 8: Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

7/23/2019 Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

http://slidepdf.com/reader/full/dr-j-vijipriya-expert-system-lecture-notes-chapter-12345pdf 8/61

InTe 4392/InSy 3102 Expert System

6

Prepared by Dr. J. VIJIPRIYA

are generated. The relationship among agents, architectures, and programs can be summed

up as follows:

agent = architecture + program

Agent functions and programs

An agent is completely specified by the agent function mapping percept sequences

to actions.AI designs the agent program. The program runs on some kind of architecture.

To design an agent program, need to understand: Percepts, Actions, Goals and

Environment

Figure 1.2 shows the basic elements for a selection of agent types.

Agent Type Percepts Actions Goals Environment

Medicaldiagnosis Symptoms, Questions, tests, Healthy patient, Patient, hospital

System findings, patient’s Treatments minimize costs

Answers

Satellite image Pixels of varying Print a Correct Images from

analysis system intensity, color categorization of Categorization orbiting satellite

Scene

Part-picking

robot Pixels of varying Pick up parts and Place parts in Conveyor belt

Intensity sort into bins correct bins with parts

Refinerycontroller  Temperature, Open, close Maximize purity, Refinery

 pressure readings valves; adjust yield, safetyTemperature

Interactive

English Typed words Print exercises, Maximize Set of students

Tutor suggestions, student’s score on

corrections Test

Figure 1.2 Examples of agent types and their PAGE Description

Page 9: Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

7/23/2019 Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

http://slidepdf.com/reader/full/dr-j-vijipriya-expert-system-lecture-notes-chapter-12345pdf 9/61

InTe 4392/InSy 3102 Expert System

7

Prepared by Dr. J. VIJIPRIYA

Agent Types

1. Table –Driven Agent: use a percept sequence/action table in memory to find the

next action. They are implemented by a lookup table.

2. Simple Reflex Agent:  based on condition-action rule implemented with an

appropriate production system

3. Agent with Memory: Internal State-used to keep track of part states of the world.

4. Agent with Goals: In addition to state information, have goal information that

describes desirable situation (past state and future state of the world).

5. Utility-based Agents: based their decisions on classic axiomatic utility theory.

Environment types

• Fully observable (vs. partially observable): An agent's sensors give it access to the

complete state of the environment at each point in time.

• Deterministic (vs. stochastic): The next state of the environment is completely

determined by the current state and the action executed by the agent. (If the

environment is deterministic except for the actions of other agents, then the

environment is strategic)

• Episodic (vs. sequential): The agent's experience is divided into atomic "episodes"

(each episode consists of the agent perceiving and then performing a single action),

and the choice of action in each episode depends only on the episode itself.

• Static (vs. dynamic): The environment is unchanged while an agent is deliberated.

(The environment is semi-dynamic if the environment itself does not change with

the passage of time but the agent's performance score does)

• Discrete (vs. continuous): A limited number of distinct, clearly defined percepts and

actions.

• Single agent (vs. multi agent): An agent operating by itself in an environment.

Page 10: Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

7/23/2019 Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

http://slidepdf.com/reader/full/dr-j-vijipriya-expert-system-lecture-notes-chapter-12345pdf 10/61

InTe 4392/InSy 3102 Expert System

8

Prepared by Dr. J. VIJIPRIYA

Chess with Chess without Taxi driving

a clock a clock  

Fully observable Yes Yes No

Deterministic Strategic Strategic No

Episodic No No No

Static Semi Yes No

Discrete Yes Yes No

Single agent No No No

• The environment type largely determines the agent design

• The real world is (of course) partially observable, stochastic, sequential, dynamic,

continuous, multi-agent

1.4 Problem Types and formulating it

∑ Problem-solving agents: find sequence of actions that achieve goals.

∑ Problem-Solving Steps:

1.   Goal transformation: where a goal is set of acceptable states.

2.   Problem formation: choose the operators and state space.

3.   search

4.   execute solution

Consider the vacuum cleaner world.

Page 11: Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

7/23/2019 Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

http://slidepdf.com/reader/full/dr-j-vijipriya-expert-system-lecture-notes-chapter-12345pdf 11/61

InTe 4392/InSy 3102 Expert System

9

Prepared by Dr. J. VIJIPRIYA

Imagine that our intelligent agent is a robot vacuum cleaner. Let's suppose that

the world has just two rooms. The robot can be in either room and there can be dirt in zero,

one, or two rooms.

Goal formulation: intuitively, we want all the dirt cleaned up. Formally, the goal is { state

7, state 8 }. Note that the { } notation indicates a set.

Problem formulation: After goal formulation, the agent must do problem formulation.

This means choosing a relevant set of states, operators for moving from one state to

another, the goal test function and the path cost function.

- The relevant set of states should include the current state, which is the initial

state, and (at least one!) goal state.

- The operators correspond to "imaginary" actions that the agent might take.

- The goal test function is a function which determines if a single state is a goal

state.

- The path cost is the sum of the cost of individual actions along a path from one

state to another.

In Vacuum cleaner , we already know what the set of all possible states is. The operators

are "move left", "move right", “suck” and "vacuum".

∑ Choosing states and actions:

- The secret of success for any intelligent agent is to choose state descriptions and

actions well. The keyword is abstraction.

- Abstraction means leaving out details about the world which are irrelevant such

as the scenery or how hungry the driver is in the case of driving from Hawassa

to Addis.

∑ Measuring performance

With any intelligent agent, we want it to find a (good) solution based on the

interesting quantities are:

ß the search cost--how long the agent takes to come up with the

solution to the problem, and

ß the path cost--how expensive the actions in the solution are.

The total cost of the solution is the sum of the above two quantities.

Page 12: Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

7/23/2019 Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

http://slidepdf.com/reader/full/dr-j-vijipriya-expert-system-lecture-notes-chapter-12345pdf 12/61

InTe 4392/InSy 3102 Expert System

10

Prepared by Dr. J. VIJIPRIYA

∑ Types of problems:

1.  Single state problems: state is always known with certainty.

2.  Multi state problems: know in which states the agent might be, the regardless of what

the initial state is.

Suppose that the robot has no sensor that can tell it which room it is in and it

doesn't know where it is initially. Then it must consider sets of possible states. Notice that

regardless of what the initial state is, the sequence of actions [right, left, vacuum] ends up

in a goal state.

3. Contingency problems: constructed plans with conditional parts based on sensors.

Suppose that the "vacuum" action sometimes actually deposits dirt on the carpet--

 but only if the carpet is already clean!. Now [right, vacuum, left, vacuum] is NOT a correct

 plan.One room might be clean originally, but they become dirty. [right, vacuum, vacuum,

left, vacuum, vacuum] doesn't work either, and so on. There doesn't exist any FIXED plan

that always works. An agent for this environment MUST have a sensor and it must

combine decision-making, sensing, and execution. This is called interleaving.

4.  Exploration problems: agent must learn the effect of actions.

We have assumed that the robot is ignorant of which rooms are dirty today, but that

the robot knows how many rooms there are and what the effect of each available action is.

Suppose the robot is completely ignorant. Then it must take actions for the purpose of

acquiring knowledge about their effects, NOT just for their contribution towards achieving

a goal. This is called "exploration" and the agent must do learning about the environment.

∑ Example Problems:

- Toy problems:o 8-puzzle

o 8-queen/n-queen

o vacuum world

- Real World

o Traveling Salesperson

o robot navigation

o assembly sequencing

Page 13: Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

7/23/2019 Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

http://slidepdf.com/reader/full/dr-j-vijipriya-expert-system-lecture-notes-chapter-12345pdf 13/61

InTe 4392/InSy 3102 Expert System

11

Prepared by Dr. J. VIJIPRIYA

1.5 ES and AI (Expert System and Artificial Intelligence)

Expert Systems are computer programs that are derived from a branch of

computer science research called  Artificial Intelligence (AI). AI's scientific goal is to

understand intelligence by building computer programs that exhibit intelligent behavior. It

is concerned with the concepts and methods of symbolic inference, or reasoning, by a

computer, and how the knowledge used to make those inferences will be represented inside

the machine.

The term intelligence covers many cognitive skills, including the ability to solve

 problems, learn, and understand language; AI addresses all of those. But most progress todate in AI has been made in the area of problem solving -- concepts and methods for

 building programs that reason about problems rather than calculate a solution.

AI programs that achieve expert-level competence in solving problems in task

areas by bringing to bear a body of knowledge about specific tasks are called knowledge-

based  or expert systems. The term expert system is reserved for programs whose

knowledge base contains the knowledge used by human experts, in contrast to knowledge

gathered from textbooks or non-experts. The two terms, expert systems (ES) and

knowledge-based systems (KBS), are used synonymously. Taken together, they represent

the most widespread type of AI application. The area of human intellectual endeavor to be

captured in an expert system is called the task domain. Task refers to some goal-oriented,

 problem-solving activity.  Domain refers to the area within which the task is being

 performed. Typical tasks are diagnosis, planning, scheduling, configuration and design. An

example of a task domain is aircraft crew scheduling.

Building an expert system is known as knowledge engineering and its practitioners

are called knowledge engineers. The knowledge engineer must make sure that the

computer has all the knowledge needed to solve a problem. The knowledge engineer must

choose one or more forms in which to represent the required knowledge as symbol patterns

in the memory of the computer -- that is, knowledge representation. He must also ensure

that the computer can use the knowledge efficiently by selecting from a handful of

reasoning methods.

Page 14: Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

7/23/2019 Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

http://slidepdf.com/reader/full/dr-j-vijipriya-expert-system-lecture-notes-chapter-12345pdf 14/61

InTe 4392/InSy 3102 Expert System

1

Prepared by Dr. J. VIJIPRIYA

Chapter 2

Expert System and Knowledge Representation

2.1 What is an Expert System?

• Computer System that emulates or acts in all respects with the decision-making

capabilities of a human expert.

• ES take their roots in Cognitive Science  — the study of human mind using

combination of AI and psychology.

• ES were the first successful applications of AI to real–world problems solving

 problems in medicine, chemistry, finance and even in space (Space Shuttle, robots on

other planets).

• In business, ES allow many companies to save $ millions

• Consider several Human Expert examples:

A doctor 

Chess grands–master 

Financial wizard

A chef 

ES- One is more intelligent that another 

Intelligence vs Expertise

• Expertise and intelligence are not the same things (although they are related).

• Expertise requires long time to learn (e.g. it takes 6 years to become a doctor).

• Expertise is a large amount of knowledge (in some domain).

• Expertise is easily recalled.

• Intelligence allows you to use your expertise (apply the knowledge).

• Expertise enables you to find solutions much faster.

Expert System Main Components

• Knowledge base – obtainable from books, magazines, knowledgeable persons, etc.

• Inference engine – draws conclusions from the knowledge base

Page 15: Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

7/23/2019 Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

http://slidepdf.com/reader/full/dr-j-vijipriya-expert-system-lecture-notes-chapter-12345pdf 15/61

InTe 4392/InSy 3102 Expert System

2

Prepared by Dr. J. VIJIPRIYA

Basic Functions of Expert Systems

Problem Domain vs. Knowledge Domain

• An expert’s knowledge is specific to one problem domain – medicine, finance,

science, engineering, etc.

• The expert’s knowledge about solving specific problems is called the knowledge

domain.

• The problem domain is always a superset of the knowledge domain.

Problem and Knowledge Domain Relationship

Representing the Knowledge

• The knowledge of an expert system can be represented in a number of ways, including

IF-THEN rules:

IF you are hungry THEN eat

Page 16: Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

7/23/2019 Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

http://slidepdf.com/reader/full/dr-j-vijipriya-expert-system-lecture-notes-chapter-12345pdf 16/61

InTe 4392/InSy 3102 Expert System

3

Prepared by Dr. J. VIJIPRIYA

Knowledge Engineering

The process of designing an ES is called knowledge engineering. It consists of three stages:

1. Knowledge acquisition : the process of obtaining the knowledge from experts (by

interviewing and/or observing human experts, reading specific books, etc).

2. Knowledge representation : selecting the most appropriate structures to represent the

knowledge (lists, sets, scripts, decision trees, object–attribute–value triplets, etc).

3. Knowledge validation : testing that the knowledge of ES is correct and complete.

2.2 Expert System: Principles, Elements, Characteristics

Elements (components) of an Expert System

• User interface

− mechanism by which user and system communicate.

− Language processor for friendly, problem-oriented communication

−menus and graphics

Page 17: Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

7/23/2019 Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

http://slidepdf.com/reader/full/dr-j-vijipriya-expert-system-lecture-notes-chapter-12345pdf 17/61

InTe 4392/InSy 3102 Expert System

4

Prepared by Dr. J. VIJIPRIYA

• Exploration facility – explains reasoning of expert system to user.

• Working memory – global database of facts used by rules.

• Inference engine

− makes inferences deciding which rules are satisfied and prioritizing.

− The brain of the ES

− The control structure (rule interpreter)

− Provides methodology for reasoning

• Agenda – a prioritized list of rules created by the inference engine, whose patterns are

satisfied by facts or objects in working memory.

• Knowledge acquisition facility – automatic way for the user to enter knowledge in the

system bypassing the explicit coding by knowledge engineer.

• Knowledge Base

− includes the rules of the expert system

− The knowledge base contains the knowledge necessary for understanding,

formulating, and solving problems

ß Two Basic Knowledge Base Elements

ß Facts

− Special heuristics, or rules that direct the use of knowledge

− Knowledge is the primary raw material of ES

− Incorporated knowledge representation

• The Human Element in Expert Systems

o Builder and User o Expert and Knowledge engineer.

o The Expert

 – Has the special knowledge, judgment, experience and methods to give

advice and solve problems

 – Provides knowledge about task performance

o The Knowledge Engineer 

Page 18: Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

7/23/2019 Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

http://slidepdf.com/reader/full/dr-j-vijipriya-expert-system-lecture-notes-chapter-12345pdf 18/61

InTe 4392/InSy 3102 Expert System

5

Prepared by Dr. J. VIJIPRIYA

− Helps the expert(s) structure the problem area by interpreting and

integrating human answers to questions, drawing analogies, posing

counterexamples, and bringing to light conceptual difficulties

− Usually also the System Builder 

o The User

− Possible Classes of Users

ß A non-expert client seeking direct advice - the ES acts as a

Consultant or Advisor

ß A student who wants to learn - an Instructor

ß An ES builder improving or increasing the knowledge base - a

Partner

ß An expert - a Colleague or Assistant

− The User should Anticipate Users' Needs and Limitations When

Designing ES

Characteristics of Expert System

• Expertise

o Exhibit expert performance

o Have high level of skill

o Have adequate robustness

• Symbolic reasoning

o   Represent knowledge symbolically

o Reformulate symbolic knowledge

• Depth

o Handle difficult problem domains

o Use complex rules

• Self-knowledge

o Examine its own Reasoning

o Explain its operation

Expert Systems Types

− Expert Systems Versus Knowledge-based Systems

Page 19: Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

7/23/2019 Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

http://slidepdf.com/reader/full/dr-j-vijipriya-expert-system-lecture-notes-chapter-12345pdf 19/61

InTe 4392/InSy 3102 Expert System

6

Prepared by Dr. J. VIJIPRIYA

− Rule-based Expert Systems

− Frame-based Systems

− Hybrid Systems

− Model-based Systems

− Ready-made (Off-the-Shelf) Systems

− Real-time Expert Systems

Problem Areas Addressed by Expert Systems

−Interpretation systems

−Prediction systems

−Diagnostic systems

−Design systems

−Planning systems

−Monitoring systems

−Debugging systems

−Repair systems

−Instruction systems

−Control systems

2.3 Applications of ES

Interpretation — drawing high–level conclusions based on data.

Prediction — projecting probable outcomes.

Diagnosis — determining the cause of malfunctions, disease, etc.

Design — finding best configuration based on criteria.

Planning — proposing a series of actions to achieve a goal.

Monitoring — comparing observed behaviour to the expected behaviour.

Debugging and Repair — prescribing and implementing remedies.

Instruction — assisting students in learning.

Control — governing the behaviour of a system.

When are expert systems useful?

• Nature of the task

o Experts can do better than nonexperts

Page 20: Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

7/23/2019 Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

http://slidepdf.com/reader/full/dr-j-vijipriya-expert-system-lecture-notes-chapter-12345pdf 20/61

InTe 4392/InSy 3102 Expert System

7

Prepared by Dr. J. VIJIPRIYA

o The task involves reasoning and knowledge, not intuitions or reflexes

o The task can be done by a person in minutes or hours

o The task is concrete enough to codify

o The task is commonly taught to novices in the area

∑ Availability of knowledge

o Recognized experts exist

o There is general agreement among experts

o Experts are able and willing to articulate the way they approach

 problems

2.4 Advantages and Limitations of ES

Advantages:

−Business applications justified by strategic impact (competitive advantage)

−Well-defined and structured applications

- Increased productivity (find solutions much faster than humans).

- Availability of expertise (human experts can be at one place at a

time).

- It can be used in dangerous environments (e.g. in space).

- The problem must be narrow in scope.

- The shell must be of high quality and naturally store and manipulate the knowledge.

- The user interface must be friendly to novice users.

- The problem to be solved must be difficult and important enough to justify the

development of a system.

- Knowledgeable developers with good people skills are needed.

- The impact of the ES must be considered.

- The impact should be favorable.

- Management support is needed.

Limitations:

- Difficulty in engineering, especially acquiring the expertise.

- Mistrust by the users.

- Effective only in specific areas (areas of expertise).

Page 21: Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

7/23/2019 Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

http://slidepdf.com/reader/full/dr-j-vijipriya-expert-system-lecture-notes-chapter-12345pdf 21/61

InTe 4392/InSy 3102 Expert System

8

Prepared by Dr. J. VIJIPRIYA

- Level of knowledge must be sufficiently high.

- Expertise must be available from at least one expert.

- The problem to be solved must by fuzzy.

- Knowledge is not always readily available.

- It can be difficult to extract expertise from humans.

- There are frequently multiple correct assessments.

- Time pressures.

- Users have cognitive limits.

- ES works well only within a narrow domain of knowledge.

- Most experts do not have an independent means to validate results.

- Vocabulary is often limited and difficult to understand.

- Help from knowledge engineers is difficult to obtain and costly.

- Potential for lack of trust on the part of the end-users.

- Knowledge transfer is subject to biases.

2.5 ES relationship with other programming

ES Development

1. Construction of the knowledge base

2. Knowledge separated into

i.   Declarative (factual) knowledge and

ii.   Procedural knowledge

3. Construction (or acquisition) of an inference engine, a blackboard, an explanation

facility, and any other software

4. Determine appropriate knowledge representations

Expert system building tools

− Programming Language

− Shell

ES Shell

− Includes All Generic ES Components

− But No Knowledge

Page 22: Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

7/23/2019 Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

http://slidepdf.com/reader/full/dr-j-vijipriya-expert-system-lecture-notes-chapter-12345pdf 22/61

InTe 4392/InSy 3102 Expert System

9

Prepared by Dr. J. VIJIPRIYA

o EMYCIN from MYCIN

o (E=Empty)

Expert Systems Shells Software Development Packages

− Exsys

− InstantTea

− K-Vision

− KnowledgePro

Shell Vs Programming Language

Features Shells Prog. Lang.

Ease & speed of development Higher Less

KB Structure & reasoning Restricted by the tool May be developed as needed

KB maintenance Easier Difficult

Interfaces Not Always friendlyor Available slower 

Have to be developed

Efficient /Performance Slower Faster  

Explanation Restricted by the tool May be developed as needed

Page 23: Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

7/23/2019 Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

http://slidepdf.com/reader/full/dr-j-vijipriya-expert-system-lecture-notes-chapter-12345pdf 23/61

InTe 4392/InSy 3102 Expert System

1

Prepared by Dr. J. VIJIPRIYA

Chapter 3

Knowledge Representation

3.1 Introduction - Knowledge Representation

∑ Definition: Knowledge-representation is the field of artificial intelligence that

focuses on designing computer representations that capture information about the

world that can be used to solve complex problems such as diagnosing a medical

condition

∑ Knowledge and Representation are two distinct entities. They play central but

distinguishable roles in intelligent system.

- Knowledge is a description of the world. It determines a system's

competence by what it knows

- Representation is the way knowledge is encoded. It defines a system's

 performance in doing something

- Knowledge is a progression that starts with data which is of limited utility.

1. Data is viewed as collection of disconnected facts

Example: It is raining

2. By organizing or analyzing the data, we understand what the data

means, and this becomes information. It provides answers to "who",

"what", "where", and "when".

Example: The temperature dropped 15 degrees and then it started

raining

3. The interpretation or evaluation of information yield knowledge. It provides answers as "how".

Example: If the humidity is very high and the temperature drops

substantially, then atmospheres is unlikely to hold the moisture, so it

rains

4. An understanding of the principles embodied within the knowledge is

wisdom. It provides answers as "why".

Page 24: Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

7/23/2019 Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

http://slidepdf.com/reader/full/dr-j-vijipriya-expert-system-lecture-notes-chapter-12345pdf 24/61

InTe 4392/InSy 3102 Expert System

2

Prepared by Dr. J. VIJIPRIYA

Example: Encompasses understanding of all the interactions that

happen between raining, evaporation, air currents, temperature

gradient and changes.

ß The distinctions between data, information, knowledge, and wisdom

are not very discrete.

o "data"and "information" deal with the past; they are based on

the gathering of factsand adding context. "

o knowledge" deals with the present that enable us to perform.

o "wisdom"deals with the future , acquire vision for what will

 be, rather than for what is or was.

∑ Why we need knowledge Representation?

- Problem solving requires large number amount of knowledge and some

mechanism for manipulating that knowledge.

∑ How do we represent what we know?

- "How to represent knowledge" , requires an analysis to distinguish between

knowledge “how” and knowledge “that”.

- Knowing " how to do something".

ß e.g. "how to drive a car" is a Procedural knowledge

- Knowing "that something is true or false".

ß e.g. "that is the speed limit for a car on a motorway" is a Declarative

knowledge.

∑ Knowledge is categorized into two major types: Tacit and Explicit

- term “Tacit “corresponds to "informal" or "implicit" type of knowledge,- term “Explicit” corresponds to "formal" type of knowledge.

Tacit knowledge Explicit knowledge

1. Exists within a human being;

it is embodied.

2. Difficult to articulate formally

3. Difficult to communicate or share.

Exists outside a human being;

it is embedded.

Can be articulated formally

Can be shared, copied, processed and stored

Page 25: Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

7/23/2019 Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

http://slidepdf.com/reader/full/dr-j-vijipriya-expert-system-lecture-notes-chapter-12345pdf 25/61

InTe 4392/InSy 3102 Expert System

3

Prepared by Dr. J. VIJIPRIYA

4. Hard to steal or copy.

5. Drawn from experience, action,

subjective insight

Easy to steal or copy

Drawn from artifact of some type as

 principle, procedure, process, concepts

∑ Knowledge Typology Map

- The map shows two types of knowledge – Tacit and Explicit knowledge.

- Tacit knowledge comes from "experience", "action", "subjective", "insight".

- Explicit knowledge comes from "principle", procedure", "process", "concepts".

- Facts: are data or instance that is specific and unique.

- Concepts: are classes of items, words, or ideas that are known by a common

name and share common features.

- Processes: are flows of events or activities that describe how things work rather

than how to do things. Procedures: are series of step-by-step actions and

decisions that result in the achievement of a task.

- Principles :are guidelines, rules, and parameters that govern; principles allow to

make predictions and draw implications;

∑ A good knowledge representation enables fast and accurate access to knowledge

and understanding of the content

3.2 Knowledge Representation Methods

Knowledge is represented by Production Rules, Semantic Net, Frames and Logic

Production Rules or Production System:

Rules are used to represent relationships. Rule-based knowledge representation

employs

IF condition (premise or consequent)

THEN action (goal or antecedent) statements.

For example,

IF the heating element glows AND the bread is always dark 

THEN the toaster thermostat is broken

When the problem situation matches th IF part of a rule, the action specified by the

THEN part of the rule is performed

Page 26: Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

7/23/2019 Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

http://slidepdf.com/reader/full/dr-j-vijipriya-expert-system-lecture-notes-chapter-12345pdf 26/61

InTe 4392/InSy 3102 Expert System

4

Prepared by Dr. J. VIJIPRIYA

∑ Production rules are one of the most popular and widely used knowledge

representation languages

Production rule system consists of three componentso working memory contains the information that the system has gained about

the problem thus far.

o rule base contains information that applies to all the problems that the

system may be asked to solve.

o interpreter solves the control problem, i.e., decide which rule to execute on

each selection-execute cycle.

∑ Used both for KR and Problem solving system

∑ Advantages of Production System:

o  Naturalness of expression

o Modularity

o Restricted syntax

o Ability to Represent Uncertain Knowledge

∑ Disadvantages of Production System:

o Inefficient

o Less expressive

3.3 Semantic Net

∑ It is formalism/mechanism for representing information /Knowledge about

objects, people, concepts and specific relationship between them.

∑ The syntax of semantic net is simple. It is a network of labeled nodes and links.

- It’s a directed graph with nodes corresponding to concepts, facts, objects etc.

and arcs showing relation or association between two concepts.

∑ The commonly used links in semantic net are of the following types.

- isa   ‡ subclass of entity (e.g., child hospital is subclass of hospital)

- inst   ‡  particular instance of a class (e.g., India is an instance of country)

- prop  ‡  property link (e.g., property of dog is ‘bark)

Page 27: Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

7/23/2019 Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

http://slidepdf.com/reader/full/dr-j-vijipriya-expert-system-lecture-notes-chapter-12345pdf 27/61

InTe 4392/InSy 3102 Expert System

5

Prepared by Dr. J. VIJIPRIYA

Representation of Knowledge in Semantic Net

Every human, animal and bird is living thing who breathe and eat. All birds can fly.

All man and woman are humans who have two legs. Cat is an animal and has a fur. All

animals have skin and can move. Giraffe is an animal who is tall and has long legs. Parrot

is a bird and is green in color 

Inheritance in Semantic Net

- Inheritance mechanism allows knowledge to be stored at the highest possible level of

abstraction which reduces the size of knowledge base.

ßIt facilitates inference of information associated with semantic nets.

ßIt is a natural tool for representing taxonomically structured information and

ensures that all the members and sub-concepts of a concept share common

 properties.

ßIt also helps us to maintain the consistency of the knowledge base by adding new

concepts and members of existing ones.

- Properties attached to a particular object (class) are to be inherited by all subclasses and

members of that class.

Semantic Net

 breathe, eat

Living_thing prop

isa isa

two legs isa fly

Human Animal Bird

isa isa inst isa inst

 prop green

Man Woman Giraffe Cat Parrot

 prop prop prop

inst fur  

 john skin, move tall, long legs

Page 28: Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

7/23/2019 Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

http://slidepdf.com/reader/full/dr-j-vijipriya-expert-system-lecture-notes-chapter-12345pdf 28/61

InTe 4392/InSy 3102 Expert System

6

Prepared by Dr. J. VIJIPRIYA

Coding of Semantic Net in Prolog

Queries

Advantages of Semantic nets

∑ Easy to visualize

∑ Formal definitions of semantic networks have been developed.

Isa facts Instance facts Property facts

isa(living_thing, nil).

isa(human, living_thing).

isa(animals, living_thing).

isa(birds, living_thing).

isa(man, human ).

isa(woman, human).

isa(cat, animal).

inst(john, man).

inst(giraffe, animal).

inst(parrot, bird)

 prop(breathe, living_thing).

 prop(eat, living_thing).

 prop(two_legs, human).

 prop(skin, animal).

 prop(move, animal).

 prop(fur, bird).

 prop(tall, giraffe).

 prop(long_legs, giraffe).

 prop(tall, animal).

 prop(green, parrot).

Page 29: Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

7/23/2019 Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

http://slidepdf.com/reader/full/dr-j-vijipriya-expert-system-lecture-notes-chapter-12345pdf 29/61

InTe 4392/InSy 3102 Expert System

7

Prepared by Dr. J. VIJIPRIYA

∑ Related knowledge is easily clustered.

∑ Efficient in space requirements

o Objects represented only once

o Relationships handled by pointers

Disadvantages of Semantic nets

∑ Inheritance (particularly from multiple sources and when exceptions in inheritance

are wanted) can cause problems.

Facts placed inappropriately cause problems.

∑  No standards about node and arc values

3.4 Frame

∑ Frame is a semantic net with properties

∑ It represents general concept or specific entry

∑ Frames represent objects as sets of slot/filler pairs

∑ Object can contain programs as well as data (if-needed, if-added, if-removed).

∑ The utility of frames lies in hierarchical frame system and inheritance.

∑ This makes it easy to construct and manipulate a complex knowledge base.

∑ Frames are implicitly associated with one another because value of a slot can be

another frame

∑ There are three components of a frame

(i). Frame name

(ii). Attributes (slots)

(iii). Values (Fillers)

- Fillers can be links to other frames

Page 30: Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

7/23/2019 Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

http://slidepdf.com/reader/full/dr-j-vijipriya-expert-system-lecture-notes-chapter-12345pdf 30/61

InTe 4392/InSy 3102 Expert System

8

Prepared by Dr. J. VIJIPRIYA

Structure of Frame

Book Frame

Slot Filler 

• Title  AI. A modern Approach

• Author  Russell & Norvig 

• Year 2003

Page 31: Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

7/23/2019 Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

http://slidepdf.com/reader/full/dr-j-vijipriya-expert-system-lecture-notes-chapter-12345pdf 31/61

InTe 4392/InSy 3102 Expert System

9

Prepared by Dr. J. VIJIPRIYA

Example

Features of Frame Representation

∑ More natural support of values then semantic nets (each slots has constraints

describing legal values that a slot can take)

∑ Can be easily implemented using object-oriented programming techniques

∑ Inheritance is easily controlled

Advantages

− Domain knowledge model reflected directly

− Support default reasoning

− Efficient

− Support procedural knowledge

Disadvantages

Page 32: Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

7/23/2019 Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

http://slidepdf.com/reader/full/dr-j-vijipriya-expert-system-lecture-notes-chapter-12345pdf 32/61

InTe 4392/InSy 3102 Expert System

10

Prepared by Dr. J. VIJIPRIYA

− Lack of semantics

− Expressive limitations

3.5 Logic

∑ Logic is studied as Knowledge Representation language in Artificial Intelligence

∑ Logic is a language for reasoning, a collection of rules used while doing logical

reasoning

∑ Logic is concerned with the truth of statements about the world.

∑ Generally each statement is either TRUE or FALSE.

Logic includes: Syntax, Semantics and Inference Procedure.∑ Syntax :

Specifies the symbols in the language about how they can be combined to form

sentences. The facts about the world are represented as sentences in logic.

∑ Semantic :

Specifies how to assign a truth value to a sentence based on its meaning in the

world. It Specifies what facts a sentence refers to. A fact is a claim about the world,

and it may be TRUE or FALSE.

∑ Inference Procedure :

Specifies methods for computing new sentences from the existing sentences.

Note

− Facts : are claims about the world that are True or False.

− Representation : is an expression (sentence), stands for the objects and relations.

− Sentence s : can be encoded in a computer program.

Different types of Logic

(i). Propositional Logic

(ii). Predicate Logic

(iii). Temporal Logic

(iv). Modal Logic

(v). Description Logic

− They represent things and allow more or less efficient inference.

Page 33: Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

7/23/2019 Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

http://slidepdf.com/reader/full/dr-j-vijipriya-expert-system-lecture-notes-chapter-12345pdf 33/61

InTe 4392/InSy 3102 Expert System

11

Prepared by Dr. J. VIJIPRIYA

− Propositional logic and Predicate logic are fundamental to all logic.

Propositional Logic: Study of statements and their connectivity

Predicate Logic: Study of individuals and their properties

Logic Representation

∑ Representation is a expression (sentence) stands for the objects and relations

∑ Logic can be used to represent simple facts.

∑ To build a Logic-based representation :

(i) User defines a set of primitive symbols and the associated semantics.

(ii) Logic defines ways of putting symbols together so that user can define legalsentences in the language that represent TRUE facts.

(iii) Logic defines ways of inferring new sentences from existing ones.

(iv) Sentences - either TRUE or false but not both are called propositions.

(v) A declarative sentence expresses a statement with a proposition as content

example:

the declarative "snow is white" expresses that snow is white;

further, "snow is white" expresses that snow is white is TRUE .

Propositional Logic (PL)

A proposition is a statement, which in English would be a declarative sentence. Every

 proposition is either TRUE or FALSE.

Examples:

(a) The sky is blue – it is true in propositional Logic

(b) Snow is cold - it is true in propositional Logic

(c) 12 * 12=144 - it is true in propositional Logic

(d) Close the door- it is false in propositional Logic

− Propositions are “sentences”, either true or false but not both.

− A sentence is smallest unit in propositional logic.

If proposition is true, then truth value is "true".

If proposition is false, then truth value is "false".

Page 34: Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

7/23/2019 Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

http://slidepdf.com/reader/full/dr-j-vijipriya-expert-system-lecture-notes-chapter-12345pdf 34/61

InTe 4392/InSy 3102 Expert System

12

Prepared by Dr. J. VIJIPRIYA

− Propositional logic is fundamental to all logic. Propositional logic is also called

Propositional calculus, sentential calculus, or Boolean algebra.

− Propositional logic tells the ways of joining and/or modifying entire propositions,

statements or sentences to form more complicated

− Propositions, statements or sentences, as well as the logical relationships and

 properties that are derived from the methods of combining or altering statements.

Statement, Variables and Symbols

These and few more related terms, such as, connective, truth value, contingencies,

tautologies, contradictions, antecedent, consequent, argument

∑ Statement

− A simple statement (sentences), TRUE or FALSE, that does not contain any

other statement as a part, is basic propositions;

− Lower-case letters, p, q, r, are symbols for simple statements.

− Large, compound or complex statement are constructed from basic

 propositions by combining them with connectives.

∑ Connective or Operator

− The connectives join simple statements into compounds, and joins compounds

into larger compounds.

− Table below indicates, the basic connectives and their symbols : listed in

decreasing order of operation priority; operations with higher priority is solved

first.

Example of a formula: ((((a Λ ¬b) V c → d) ↔ ¬ (a V c ))

Connectives and Symbols in decreasing order of operation priority

Connective Symbols Read as

assertion P “p is true"

negation ¬p ~ ! NOT "p is false"

conjunction p∧q · && & AND "both p and q are true"

disjunction P v q || | OR "either p is true, or q is true, or both "

implication  p → q⊃⇒ if ..then "if p is true, then q is true"" p implies q "

equivalence ↔ ≡⇔ if and only if "p and q are either both

true or both false"

Page 35: Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

7/23/2019 Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

http://slidepdf.com/reader/full/dr-j-vijipriya-expert-system-lecture-notes-chapter-12345pdf 35/61

InTe 4392/InSy 3102 Expert System

13

Prepared by Dr. J. VIJIPRIYA

 Note :

The propositions and connectives are the basic elements of propositional logic.

TautologiesA proposition that is always true is called a "tautology".

e.g., (P v ¬P) is always true regardless of the truth value of the proposition P.

∑ Contradictions

A proposition that is always false is called a "contradiction".

e.g., (P∧¬P) is always false regardless of the truth value of the proposition P.

∑ Contingencies

A proposition is called a "contingency", if that proposition is neither a tautology

nor a contradiction .

e.g., (P v Q) is a contingency.

∑ Antecedent, Consequent

These two are parts of conditional statements.

In the conditional statements, p → q , the

1st statement or "if - clause" (here p) is called antecedent , 2nd statement or

"then - clause" (here q) is called consequent.

∑ Argument

− An argument is a demonstration or a proof of some statement.

Example: "That bird is a crow; therefore, it's black."

− Any argument can be expressed as a compound statement.

− In logic, an argument is a set of one or more meaningful declarative sentences (or

"propositions") known as the premises along with another meaningful declarative

sentence (or "proposition") known as the conclusion.

− Premise is a proposition which gives reasons, grounds, or evidence for accepting

some other proposition, called the conclusion.

− Conclusion is a proposition, which is purported to be established on the basis of

other propositions.

Page 36: Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

7/23/2019 Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

http://slidepdf.com/reader/full/dr-j-vijipriya-expert-system-lecture-notes-chapter-12345pdf 36/61

InTe 4392/InSy 3102 Expert System

14

Prepared by Dr. J. VIJIPRIYA

− Take all the premises, conjoin them, and make that conjunction the antecedent of a

conditional and make the conclusion the consequent. This implication statement is

called the corresponding conditional of the argument.

 Note: Every argument has a corresponding conditional, and every implication statement

has a corresponding argument. Because the corresponding conditional of an argument is a

statement, it is therefore either a tautology, or a contradiction, or a contingency.

− An argument is valid

"if and only if" its corresponding conditional is a tautology.

− Two statements are consistent

"if and only if" their conjunction is not a contradiction.

− Two statements are logically equivalent t 

"if and only if" their truth table columns are identical;

"if and only if" the statement of their equivalence using " ≡ " is a

tautology.

 Note: The truth tables are adequate to test validity, tautology, contradiction, contingency,

consistency, and equivalence.

Page 37: Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

7/23/2019 Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

http://slidepdf.com/reader/full/dr-j-vijipriya-expert-system-lecture-notes-chapter-12345pdf 37/61

InTe 4392/InSy 3102 Expert System

1

Prepared by Dr. J. VIJIPRIYA

Chapter 4

Inference Methods and Reasoning

4.1 Predicate Logic (First Order Logic)

∑ Predicate Logic allows more flexible and compact representation of knowledge.

∑ FOL assumes that world contains

Objects: people, houses, numbers, colors, wares

Relations: brother of , bigger than, inside, part of 

Properties: red, round, long, short,,,

Functions: father of, best friend, one more thanExample

“One Plus Two Equals Three “

− Objects: One, Two, Three, One Plus Two

− Relations: Equals

− Functions: Plus

“Congratulation Letter written with Blue Pen“

−Objects: Letter, Pen

− Relations: written with

− Properties: Blue, Congratulation

Predicate :

∑ Every complete "sentence" contains two parts: a "subject" and a "predicate".

∑ The subject is what (or whom) the sentence is about.

∑ The predicate tells something about the subject;

Example :

A sentence "Judy {runs}".

The subject is Judy and the predicate is runs .

Predicate, always includes verb, tells something about the subject.

Predicate is a verb phrase template that describes a property of

objects, or a relation among objects represented by the variables.

Page 38: Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

7/23/2019 Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

http://slidepdf.com/reader/full/dr-j-vijipriya-expert-system-lecture-notes-chapter-12345pdf 38/61

InTe 4392/InSy 3102 Expert System

2

Prepared by Dr. J. VIJIPRIYA

Example:

“The car Tom is driving is blue" ;

"The sky is blue" ;

"The cover of this book is blue"

Predicate is “is blue" , describes property.

Predicates are given names; Let ‘B’ is name for predicate "is_blue" .

Sentence is represented as "B(x)" , read as "x is blue" ;

Symbol “x” represents an arbitrary Object .

Syntax of FOL

Sentence AtomicSentence

| Sentence Connective Sentence

| Quantifier Var,,,,,Sentence

|ÿ

Sentence

| (Sentence)

AtomicSentence Predicate(Term,,,,) | Term = Term

Term Function( Term,,,)

| Constant

| Variable

Connective => | ⁄ | L |Û

Quantifier   |

Constant A | 1 | 3 | John | Riad,,,,

Variable a | b | c | x | y | z

Predicate Before | HasColor |After

Function Mother | LeftLegOf | Equal

Page 39: Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

7/23/2019 Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

http://slidepdf.com/reader/full/dr-j-vijipriya-expert-system-lecture-notes-chapter-12345pdf 39/61

InTe 4392/InSy 3102 Expert System

3

Prepared by Dr. J. VIJIPRIYA

Terms and Predicate

Objects: objects are represented by terms. It may be

Constants: represent a thing

Eg:-5, earth

Functions:Given Zero or more arguments. A function produces a

constant as its value

Eg: add(2,2)

Father-of(Jothn)Predicate:

A predicate is like a function, but produces a truth value

Eg: isPlant(earth)- truth

greater(3,5)-false

− Propositions are represented by predicate applied to a tuple of terms

− It represents a property of or relationship between terms

Atomic sentences in FOL:

Atomic sentence is simply a predicate applied to set of terms

Eg:

Own(John,Car)

Sold(John,car,Fred)

Semantics is true or false based on the interpretation

Interpretation specifies referent for constants symbols, predicate symbols

and Function symbols

Connectives:

=> | ⁄ | L |Û

− used to construct complex sentences from atomic sentence

Page 40: Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

7/23/2019 Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

http://slidepdf.com/reader/full/dr-j-vijipriya-expert-system-lecture-notes-chapter-12345pdf 40/61

InTe 4392/InSy 3102 Expert System

4

Prepared by Dr. J. VIJIPRIYA

Eg:

Sold(John,car,Fred) => Own(Fred, Car)

Own(Jothn,Car) ⁄ Own(Fred,Car)

Quantifiers:

− Allows statements about entire collection of objects rather than having to

enumerate the object its by name

Types

(1) Universal Quantifiers: 

x is read as for all, for each, for every

Eg: "x (x, Ethiopia) L (x, Smart)

Every one is at Ethiopia and smart

(2) Existential Quantifiers: x is read as for some or there exists

Eg: $x (x,Ethiopia)  L (x, Smart)

There is someone who is at Ethiopia and is smart

Eg:

All cars have wheels is written as "x, P(x)

"x x P

where

P(x)is predicate tells x has wheels

X is variable of object car 

Eg:

Someone loves you is written as $x, P

$x P

where

P(x) is predicate tells x loves you

X is variable of object someone

Page 41: Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

7/23/2019 Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

http://slidepdf.com/reader/full/dr-j-vijipriya-expert-system-lecture-notes-chapter-12345pdf 41/61

InTe 4392/InSy 3102 Expert System

5

Prepared by Dr. J. VIJIPRIYA

Functions

4.2 Inference Rule

Proofs in Mathematics are valid arguments that establish truth of the mathematical

statements. Argument is the sequence of statements that ends with conclusion. Rules of

inference are template for building argument.

Page 42: Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

7/23/2019 Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

http://slidepdf.com/reader/full/dr-j-vijipriya-expert-system-lecture-notes-chapter-12345pdf 42/61

InTe 4392/InSy 3102 Expert System

6

Prepared by Dr. J. VIJIPRIYA

4.3 Chaining

∑ Simple methods used by most inference engines to produce a line of reasoning

∑ Forward chaining: the engine begins with the initial content of the workspace and proceeds toward a final conclusion

∑ Backward chaining: the engine starts with a goal and finds knowledge to support

that goal

Forward Chaining

∑ Data driven reasoning

o  bottom up

o Search from facts to valid conclusions

∑ Given database of true facts

o Apply all rules that match facts in database

o Add conclusions to database

o Repeat until a goal is reached, OR repeat until no new facts added

Example

Suppose we have three rules:R1: If A and B then D

R2: If B then C

R3: If C and D then E

If facts A and B are present, we infer D from R1 and infer C from R2. With D and C

inferred, we now infer E from R3.

Page 43: Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

7/23/2019 Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

http://slidepdf.com/reader/full/dr-j-vijipriya-expert-system-lecture-notes-chapter-12345pdf 43/61

InTe 4392/InSy 3102 Expert System

7

Prepared by Dr. J. VIJIPRIYA

Backward Chaining

∑ Goal driven reasoning

o top down

o Search from hypothesis and finds supporting facts

∑ To prove goal G:

o If G is in the initial facts, it is proven.

o Otherwise, find a rule which can be used to conclude G, and try to prove

each of that rule’s conditions.

Example

The same three rules:

R1: If A and B then D

R2: If B then C

R3: If C and D then E

If E is known, then R3 implies C and D are true. R2 thus implies B is true (from C) and

R1 implies A and B are true (from D).

Example

Page 44: Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

7/23/2019 Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

http://slidepdf.com/reader/full/dr-j-vijipriya-expert-system-lecture-notes-chapter-12345pdf 44/61

InTe 4392/InSy 3102 Expert System

8

Prepared by Dr. J. VIJIPRIYA

Application of Chaining

∑ Wide use in expert systems

o Backward chaining: Diagnosis systems

ß start with set of hypotheses and try to prove each one, asking

additional questions of user when fact is unknown.

o Forward chaining: design/configuration systems

ß see what can be done with available components.

Comparison of Forward and backward Chaining

4.4 Resolution

∑ Resolution is a procedure used in proving that arguments which are expressible in

 predicate logic are correct.

∑ It produces proofs by refutation or contradiction

∑ Resolution leads to refute a theorem-proving technique for sentences in

 propositional logic and first-order logic

∑ Resolution is a rule of inference

∑ Resolution is a computerized theorem prover ∑ Resolution is only defined for propositional logic. The strategy is that the resolution

techniques of propositional logic can be adapted in predicate logic

4.5 Reasoning and Uncertainty

Motivation

∑ reasoning for real-world problems involves missing knowledge, inexact knowledge,

inconsistent facts or rules, and other sources of uncertainty

Page 45: Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

7/23/2019 Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

http://slidepdf.com/reader/full/dr-j-vijipriya-expert-system-lecture-notes-chapter-12345pdf 45/61

InTe 4392/InSy 3102 Expert System

9

Prepared by Dr. J. VIJIPRIYA

∑ while traditional logic in principle is capable of capturing and expressing these

aspects, it is not very intuitive or practical

o   explicit introduction of predicates or functions

∑ many expert systems have mechanisms to deal with uncertainty

o   sometimes introduced as ad-hoc measures, lacking a sound foundation

Objective

∑  be familiar with various sources of uncertainty and imprecision in knowledge

representation and reasoning

∑  understand the main approaches to dealing with uncertainty

o  probability theory

ß   Bayesian networks

ß   Dempster-Shafer theory

o important characteristics of the approaches

ß   differences between methods, advantages, disadvantages,

 performance, typical scenarios

∑  evaluate the suitability of those approaches

o application of methods to scenarios or tasks

∑  apply selected approaches to simple problems

Introduction

∑  reasoning under uncertainty and with inexact knowledge

o frequently necessary for real-world problems

∑   heuristics

o ways to mimic heuristic knowledge processing methods used by experts

∑  empirical associations

o experiential reasoning

o  based on limited observations

∑   probabilities

o objective (frequency counting)

Page 46: Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

7/23/2019 Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

http://slidepdf.com/reader/full/dr-j-vijipriya-expert-system-lecture-notes-chapter-12345pdf 46/61

InTe 4392/InSy 3102 Expert System

10

Prepared by Dr. J. VIJIPRIYA

o subjective (human experience )

∑   reproducibility

o will observations deliver the same results when repeated

Dealing with Uncertainty

∑   expressiveness

o can concepts used by humans be represented adequately?

o can the confidence of experts in their decisions be expressed?

∑  comprehensibility

o representation of uncertainty

o utilization in reasoning methods

∑   correctness

o  probabilities

ß   adherence to the formal aspects of probability theory

o relevance ranking

ß   probabilities don’t add up to 1, but the “most likely” result is

sufficient

o long inference chains

ß   tend to result in extreme (0,1) or not very useful (0.5) results

∑  computational complexity

o feasibility of calculations for practical purposes

Sources of Uncertainty

∑  data

o data missing, unreliable, ambiguous,

o representation imprecise, inconsistent, subjective, derived from defaults,

∑  expert knowledge

o inconsistency between different experts

o  plausibility

ß   “best guess” of experts

Page 47: Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

7/23/2019 Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

http://slidepdf.com/reader/full/dr-j-vijipriya-expert-system-lecture-notes-chapter-12345pdf 47/61

InTe 4392/InSy 3102 Expert System

11

Prepared by Dr. J. VIJIPRIYA

o quality

o   causal knowledge

ß   deep understanding

o   statistical associations

ß   observations

∑ scope

o   only current domain, or more general

∑  knowledge representation

o restricted model of the real system

o limited expressiveness of the representation mechanism

∑  inference process

o deductive

o   the derived result is formally correct, but inappropriate

o   derivation of the result may take very long

∑ inductive

o   new conclusions are not well-founded

ß   not enough samples

ß   samples are not representative

∑ unsound reasoning methods

o   induction, non-monotonic, default reasoning

Uncertainty in Individual Rules

∑ errors

o   domain errors

o   representation errors

o   inappropriate application of the rule

∑ likelihood of evidence

o   for each premise

o   for the conclusion

o   combination of evidence from multiple premises

Page 48: Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

7/23/2019 Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

http://slidepdf.com/reader/full/dr-j-vijipriya-expert-system-lecture-notes-chapter-12345pdf 48/61

InTe 4392/InSy 3102 Expert System

12

Prepared by Dr. J. VIJIPRIYA

Uncertainty and Multiple Rules

∑   conflict resolution

o if multiple rules are applicable, which one is selected

ß   explicit priorities, provided by domain experts

ß   implicit priorities derived from rule properties

−   specificity of patterns, ordering of patterns creation time of 

rules, most recent usage, …

∑  compatibility

o contradictions between rules

o subsumption

ß   one rule is a more general version of another one

o redundancy

o missing rules

o data fusion

ß   integration of data from multiple sources

4.6 Probability Theory

Basics of Probability Theory

∑  mathematical approach for processing uncertain information

∑  sample space set X = {x1, x2, …, xn}

o collection of all possible events

o can be discrete or continuous

∑  probability number P(x) reflects the likelihood of an event x to occur 

o non-negative value in [0,1]

o total probability of the sample space (sum of probabilities) is 1

o for mutually exclusive events, the probability for at least one of them is

the sum of their individual probabilities

o experimental probability

ß   based on the frequency of events

o subjective probability

i i

Page 49: Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

7/23/2019 Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

http://slidepdf.com/reader/full/dr-j-vijipriya-expert-system-lecture-notes-chapter-12345pdf 49/61

InTe 4392/InSy 3102 Expert System

13

Prepared by Dr. J. VIJIPRIYA

ß   based on expert assessment

Compound Probabilities

∑ describes independent events

o   do not affect each other in any way

∑ joint probability of two independent events A and B

P(A∩B) = n(A∩B) / n(s) = P(A) * P (B)

where n(S) is the number of elements in S

∑ union probability of two independent events A and B

P(A∪

B) = P(A) + P(B) - P(A∩B)

= P(A) + P(B) - P(A) * P (B)

Conditional Probabilities

∑ describes dependent events

o   affect each other in some way

∑ conditional probability

of event A given that event B has already occurred P(A|B) = P(A∩B) / P(B)

Advantages and Problems: Probabilities

∑   advantages

o formal foundation

o reflection of reality (a posteriori)

∑  problems

o may be inappropriate

ß   the future is not always similar to the past

o inexact or incorrect

ß   especially for subjective probabilities

o ignorance

ß   probabilities must be assigned even if no information is available

−   assigns an equal amount of probability to all such items

o non-local reasoning

Page 50: Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

7/23/2019 Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

http://slidepdf.com/reader/full/dr-j-vijipriya-expert-system-lecture-notes-chapter-12345pdf 50/61

InTe 4392/InSy 3102 Expert System

14

Prepared by Dr. J. VIJIPRIYA

ß   requires the consideration of all available evidence, not only from

the rules currently under consideration

o no compositionality

ß   complex statements with conditional dependencies can not be

decomposed into independent parts

4.7 Knowledge & Inexact Reasoning

Knowledge & Inexact Reasoning are

− inexact knowledge (truth of a not clear)

− incomplete knowledge (lack of knowledge about a)

− defaults, beliefs (assumption about truth of a)

− contradictory knowledge (a true and false)

− vague knowledge (truth of a not 0/1)

Inexact Reasoning are represented by

∑ CF Theory - uncertainty

o uncertainty about facts and conclusions

∑ Fuzzy - vagueness

o truth not 0 or 1 but graded (membership fct.)

∑ Truth Maintenance - beliefs, defaults

o assumptions about facts, can be revised

∑ Probability Theory - likelihood of events

o statistical model of knowledge

Inexact Reasoning is NOT necessary when assuming:

∑ complete knowledge about the "world"

∑ no contradictory facts or rules

∑ everything is either true or false

Forms of Inexact Knowledge

Page 51: Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

7/23/2019 Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

http://slidepdf.com/reader/full/dr-j-vijipriya-expert-system-lecture-notes-chapter-12345pdf 51/61

InTe 4392/InSy 3102 Expert System

15

Prepared by Dr. J. VIJIPRIYA

∑ uncertainty (truth not clear)

o  probabilistic models, multi-valued logic (true, false, don't know,...), certainty

factor theory

∑ incomplete knowledge (lack of knowledge)

o P true or false not known (Æ defaults)

∑ defaults, beliefs (assumptions about truth)

o assume P is true, as long as there is no counter-evidence (i.e. that ¬P is true)

o assume P is true with Certainty Factor 

∑ contradictory knowledge (true and false)

o inconsistent fact base; somehow P and ¬P true

∑ vague knowledge (truth value not 0/1; not crisp sets)

o graded truth; fuzzy sets

Inexact Knowledge – Example

Person A walks on Campus towards the bus stop. A few hundred yards away A sees

someone and is quite sure that it's his next-door neighbor B who usually goes by car to the

University. A screams B's name.

Which forms of inexact knowledge and reasoning are involved here?

default - A wants to take a bus

 belief, (un)certainty - it's the neighbor B

 probability, default, uncertainty - the neighbor goes home by car

default - A wants to get a lift

default - A wants to go home

Page 52: Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

7/23/2019 Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

http://slidepdf.com/reader/full/dr-j-vijipriya-expert-system-lecture-notes-chapter-12345pdf 52/61

InTe 4392/InSy 3102 Expert System

1

Prepared by Dr. J. VIJIPRIYA

Chapter 5

Expert System Design

5.1 Creating an expert system

The steps in a typical expert systems analysis and design methodology are summarized in

Figure .

Page 53: Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

7/23/2019 Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

http://slidepdf.com/reader/full/dr-j-vijipriya-expert-system-lecture-notes-chapter-12345pdf 53/61

InTe 4392/InSy 3102 Expert System

2

Prepared by Dr. J. VIJIPRIYA

1. Identification phase

The first step in the identification phase,  Identify problem, is similar to the

 problem definition phase in the traditional systems development life cycle. The objective is

to identify, characterize, and define the problems the system will be expected to solve and

then partition the problem into appropriate sub-tasks.

Once the problem is defined, the resources necessary for acquiring knowledge,

implementing the system, and testing the system are identified. Typical resources include

knowledge, time, computing facilities, and money. Because expert systems are expensive

and creating one takes considerable time, a feasibility study is often conducted before

work progresses beyond this point.

In addition to identifying resources, the expert system analysts and/or designers

also identify the system’s goals and objectives. It is helpful to identify and explicitly

document the goals because certain design approaches, such as heuristic search, breadth

search, depth search, and reasoning are goal-driven.

2. Conceptualization phase

The central task of the conceptualization phase is to diagram the system’s key

concepts and relations to define a conceptual base for a prototype system. Key objectives

include separating the inference engine from the problem domain, factoring (analyzing)

the problem into meta-problems, identifying the system’s key concepts and relations, and

testing those concepts and relations by challenging them (with specific examples of

 problem-solving activities) to ensure that they cover every general case. Many of the tools

and techniques are used in this phase.

3. Formalization PhaseThe formalization phase involves mapping key concepts, sub-problems, and

information flow characteristics isolated during conceptualization into more formal

representations based on various knowledge engineering and problem solving tools and

knowledge representation frame-works. The key objectives are to identify the solution

space (a domain with a collection of all possible solutions), the hypothesis space (the

hypothetical solution space), the underlying model, and the characteristics of the data.

To define the structure of the hypothesis space, the systems analysts or designers

Page 54: Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

7/23/2019 Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

http://slidepdf.com/reader/full/dr-j-vijipriya-expert-system-lecture-notes-chapter-12345pdf 54/61

InTe 4392/InSy 3102 Expert System

3

Prepared by Dr. J. VIJIPRIYA

must formalize the concepts (knowledge in an abstract format that can be used to guide a

searching or reasoning process) and determine how they are joined to form a hypothesis.

The concepts provide clues about the nature of the space such as if it is finite, if a

hierarchy must to be considered, if certain levels of abstraction can be applied, and if a

specific class of the concept must be generated. Such searching techniques as blind search,

heuristic search, and abstracting the solution space are often used. Reasoning techniques

such as assumption building, justification building, and the constraints and goal technique

help to identify the underlying model of the process used to generate solutions in the

domain.

4. System design phase

During the system design phase (sometimes called the logical design phase) the

analyst and/or designer specifies how the system will meet the requirements identified

during the previous three phases. Typically, the reports and other outputs the systems must

 produce are defined first. This phase is similar to the design stage in the traditional systems

development life cycle. Note, however, that the representation schemes used to describe

knowledge differ from traditional methodologies.

Using the knowledge you have acquired and the tool you have selected, you can

now begin the design of the expert system. First, you will need to create an outline, a

hierarchal flow chart, a matrix, decision table, or other format that will help you organize

and understand the knowledge. Using these aids, you will convert the knowledge in to IF-

THEN rules. It is best to follow the specific procedures recommended by the software tool

you are using. Once the basic design is complete, you can begin using the tool to create a

 prototype of one segment of the system. Translate a portion of the knowledge into rules

and test the newly created segment. Test the concept before going ahead with the entire

 program.

5. System development phase

A prototype expert system is created during the system development (or physical

design) stage. This stage is similar to the development stage in the traditional system

development life cycle.

Page 55: Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

7/23/2019 Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

http://slidepdf.com/reader/full/dr-j-vijipriya-expert-system-lecture-notes-chapter-12345pdf 55/61

InTe 4392/InSy 3102 Expert System

4

Prepared by Dr. J. VIJIPRIYA

Once you have satisfied yourself that the system is going to work satisfactorily, now you

can begin to expand the prototype into the final system.

The best way to go about this is to expand the prototype one segment at a time.

6. Testing and evaluation phase

During this phase, the prototype system is evaluated. This phase parallels the

testing stage in the traditional system development life cycle. However, in addition to the

testing tools and techniques, expert systems utilize a dynamic testing technique to verify

the reasoning and/or inference process.

After the expert system has been developed, you will need to spend some time to

testing and debugging it. No expert system will be perfect the first time, and a considerable

amount of work will be required to validate it.

User feedback will show you where to make final changes, corrections, and additions to

achieve the desired performance.

7. Prototype revision phase

An expert system evolves over time, calling for almost constant revision, a trait

expert systems share with most prototypes. Based on the results of the testing/evaluation

 phase, concepts and relations are refined, the solution space, the model, the data

characteristics are re-formalized, and the system is redesigned.

8. Maintain the System

An important part of expert system development is ongoing maintenance, updating

the system with new knowledge, removing knowledge that is no longer applicable, and

otherwise fine tuning the system to keep it fully current and applicable to the problem.

5.2 Software

LISP (list programming language) and PROLOG (programming logic language)

are popular expert system programming languages. Variations include common LISP,

Franz LISP, CProlog, Knowledge Workbench, Quintus Prolog, Prolog-2, Arity Prolog,

UNSW Prolog, and Turbo Prolog.

Popular systems building products include Expert-Ease, ADVISE,

Page 56: Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

7/23/2019 Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

http://slidepdf.com/reader/full/dr-j-vijipriya-expert-system-lecture-notes-chapter-12345pdf 56/61

InTe 4392/InSy 3102 Expert System

5

Prepared by Dr. J. VIJIPRIYA

RULEMASTER, SEEK, and RULE WRITER. Other relevant products include KEE,

KMS, RLL, SRL, SRL+ (frame-based), APES and HSRL (logic based), ROSS,

SMALLTALK, and KBS (object oriented), INTERLISP and PSL (procedure-oriented),

and ARS, ART, EXPERT, EXPERT-II, OPS5, RITA, and ROSIE (rule-based).

CLIPS is a productive development and delivery expert system tool which provides

a complete environment for the construction of rule and/or object based expert

systems. Created in 1985, CLIPS is now widely used throughout the government, industry,

and academia. Its key features are:

∑ Knowledge Representation: CLIPS provides a cohesive tool for handling a wide

variety of knowledge with support for three different programming paradigms: rule-

 based, object-oriented and procedural. Rule-based programming allows knowledge

to be represented as heuristics, or "rules of thumb," which specify a set of actions to

 be performed for a given situation. Object-oriented programming allows complex

systems to be modeled as modular components (which can be easily reused to

model other systems or to create new components). The procedural programming

capabilities provided by CLIPS are similar to capabilities found in languages such

as C, Java, Ada, and LISP.

∑ Portability: CLIPS is written in C for portability and speed and has been installed

on many different operating systems without code changes. Operating systems on

which CLIPS has been tested include Windows XP, MacOS X, and Unix. CLIPS

can be ported to any system which has an ANSI compliant C or C++ compiler.

CLIPS comes with all source code which can  be modified or tailored to meet a

user's specific needs.∑ Integration/Extensi bility: CLIPS can be embedded within procedural code, called as

a subroutine, and integrated with languages such as C, Java, FORTRAN and ADA.

CLIPS can be easily extended by a user through the use of several well-defined

 protocols.

∑ Interactive Development: The standard version of CLIPS provides an interactive,

text oriented development environment, including debugging aids, on-line help, and

an integrated editor. Interfaces providing features such as pulldown menus,

Page 57: Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

7/23/2019 Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

http://slidepdf.com/reader/full/dr-j-vijipriya-expert-system-lecture-notes-chapter-12345pdf 57/61

InTe 4392/InSy 3102 Expert System

6

Prepared by Dr. J. VIJIPRIYA

integrated editors, and multiple windows have been developed for the MacOS,

Windows XP, and X Window environments.

∑ Verification/Validation: CLIPS includes a number of features to support the

verification and validation of expert systems including support for modular design

and partitioning of a knowledge base, static and dynamic constraint checking of slot

values and function arguments, and semantic analysis of rule patterns to determine

if inconsistencies could prevent a rule from firing or generate an error.

∑ Fully Documented: CLIPS comes with extensive documentation including a

Reference Manual and a User's Guide.

∑ Low Cost: CLIPS is maintained as public domain software.

5.3 When is an Expert System Appropriate?

Here are factors which suggest an expert system is appropriate.

• Need justifies cost and e ff ort

• Human expertise not always available

• Problem requires symbolic reasoning• Problem domain is well structured

• Traditional computing methods fail

• Cooperative and articulate experts exist

• Problem is not too large

5.4 Expert System Development Life Cycle

To place the previously described methodology in action, the internal organizationof CLAES is designed according to the activities done through the whole expert system

development life cycle. Three teams in CLAES are sharing the responsibilities of expert

systems development activities: Methodology & Tools team, Development team, and

Training & Evaluation team.

The Methodology and Tools team has two main responsibilities: First, setting up

the standards for both, knowledge engineering and software engineering methodologies.

Second, developing the necessary tools, that are required for the implementation of the

Page 58: Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

7/23/2019 Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

http://slidepdf.com/reader/full/dr-j-vijipriya-expert-system-lecture-notes-chapter-12345pdf 58/61

InTe 4392/InSy 3102 Expert System

7

Prepared by Dr. J. VIJIPRIYA

target knowledge based systems.

The Development team, acquires, analyzes, models, and implements the proposed

expert systems according to the standards specified by the methodology team, using the

developed tools.

(Figure) Expert system development work flow

The Training and Evaluation team, takes the responsibility of expert systems verification, validation,

and evaluation, in addition to organizing training courses for end users on the developed expert

Systems

The actual expert system life cycle runs between the development team, and the training & evaluationteam. As illustrated in Figure the development team starts the first cycle whose output is the

Requirements specification report, the design report, and the first implemented version of the expert

system. The training & evaluation team takes this output and generates three reports: verification

report, validation report, and evaluation report. Verification report includes discrepancies between

the requirements specification report and the design report, and between the design report and the

Implemented system. Validation report includes differences between the implemented system

 behavior and the behavior expected by domain experts. Evaluation report includes comments given

 by domain experts other than those who participated in knowledge acquisition, to certify that the

system is accepted from their point of view.

The produced reports by the testing & evaluation team are forwarded to the development

team who analyzes these reports, and starts new cycle based on the comments documented in these

reports.

5.5 CLIPS Programming Tools

CLIPS stands for C Language Implementation Production System

History of CLIPS

Verification

Requirements   report

DevelopmentSpecification

Training & Validation

Team Design Evaluation   reportTeam

Implementation Evaluationreport

Page 59: Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

7/23/2019 Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

http://slidepdf.com/reader/full/dr-j-vijipriya-expert-system-lecture-notes-chapter-12345pdf 59/61

InTe 4392/InSy 3102 Expert System

8

Prepared by Dr. J. VIJIPRIYA

− influenced by OPS5 and ART

− implemented in C for efficiency and portability

− developed by NASA, distributed & supported by COSMIC

− runs on PC, Mac, UNIX, VAX VMS

CLIPS provides mechanisms for expert systems

− a top-level interpreter 

−  production rule interpreter 

− object oriented programming language

− LISP-like procedural language

Components of CLIPS

1.Rule-based language

− can create a fact list

− can create a rule set

− an inference engine matches facts against rules

2. Object-oriented language (COOL)

− can define classes

− can create different sets of instances

− special forms allow you to interface rules and objects

5.6 Pattern Matching

− Pattern Matching determines if two or more compelx entities (patterns) are

compatible with each other 

o  patterns can be (almost) anything that has a structure

ß  pictures: mugshot vs. person

ß drawings: diagrams of systems

ß expressions: words, sentences of a language, strings

o graphs are often used as the underlying representation

ß the structure of the graphs must be compatible

∑ usually either identical, or one is a sub-graph of the other 

ß the individual parts must be compatible

∑ nodes must have identical or compatible values

Page 60: Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

7/23/2019 Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

http://slidepdf.com/reader/full/dr-j-vijipriya-expert-system-lecture-notes-chapter-12345pdf 60/61

InTe 4392/InSy 3102 Expert System

9

Prepared by Dr. J. VIJIPRIYA

o variables are very valuable

∑ links must indicate compatible relationships

ß compatibility may be dependent on the domain or task 

Pattern Matching Example

Images

Do both images refer to the same individual?

Do they have other commonalities?

----------------‡

Shapes

Constants and Variables

Terms: composed of constants, variables, functions

Page 61: Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

7/23/2019 Dr. J. VijiPriya Expert System Lecture Notes Chapter 1,2,3,4&5.pdf

http://slidepdf.com/reader/full/dr-j-vijipriya-expert-system-lecture-notes-chapter-12345pdf 61/61

InTe 4392/InSy 3102 Expert System

Pattern Matching in Rule-Based Systems

− Pattern Matching is used to match rules with appropriate facts in working

memory

o rules for which facts can be found are satisfied 

o the combination of a rule with the facts that satisfy it is used to form

activation records

ß one of the activation records is selected for execution