Introduction to Expert System Chapter 11. Rule-Based AI 2013/5/2 1.

Slides:



Advertisements
Similar presentations
Modelling with expert systems. Expert systems Modelling with expert systems Coaching modelling with expert systems Advantages and limitations of modelling.
Advertisements

Chapter 1: Introduction to Expert Systems
CHAPTER 13 Inference Techniques. Reasoning in Artificial Intelligence n Knowledge must be processed (reasoned with) n Computer program accesses knowledge.
CS 484 – Artificial Intelligence1 Announcements Choose Research Topic by today Project 1 is due Thursday, October 11 Midterm is Thursday, October 18 Book.
Inferences The Reasoning Power of Expert Systems.
Expert System Shells - Examples
Chapter 7: Introduction to CLIPS
Intelligent systems Lecture 6 Rules, Semantic nets.
Knowledge Engineering.  Process of acquiring knowledge from experts and building knowledge base  Narrow perspective  Knowledge acquisition, representation,
Rule Based Systems Michael J. Watts
Artificial Intelligence Lecture No. 16
Chapter 12: Expert Systems Design Examples
Intelligent Systems and Soft Computing
Introduction to Expert Systems
Chapter 1: Introduction to Expert Systems
1 5.0 Expert Systems Outline 5.1 Introduction 5.2 Rules for Knowledge Representation 5.3 Types of rules 5.4 Rule-based systems 5.5 Reasoning approaches.
1 Chapter 9 Rules and Expert Systems. 2 Chapter 9 Contents (1) l Rules for Knowledge Representation l Rule Based Production Systems l Forward Chaining.
Rules and Expert Systems
© C. Kemke1Reasoning - Introduction COMP 4200: Expert Systems Dr. Christel Kemke Department of Computer Science University of Manitoba.
© C. Kemke Control 1 COMP 4200: Expert Systems Dr. Christel Kemke Department of Computer Science University of Manitoba.
Production Rules Rule-Based Systems. 2 Production Rules Specify what you should do or what you could conclude in different situations. Specify what you.
EXPERT SYSTEMS Part I.
Chapter 1: Introduction to Expert Systems
Chapter 1: Introduction to Expert Systems
Chapter 1: Introduction to Expert Systems
Building Knowledge-Driven DSS and Mining Data
Artificial Intelligence CSC 361
Introduction to Rule-Based Systems, Expert Systems, Fuzzy Systems Introduction to Rule-Based Systems, Expert Systems, Fuzzy Systems (sections 2.7, 2.8,
Sepandar Sepehr McMaster University November 2008
Expert Systems Infsy 540 Dr. Ocker. Expert Systems n computer systems which try to mimic human expertise n produce a decision that does not require judgment.
Decision Trees & Rule-based AI. Decision Tree Advantages ▫Fast and easy to implement, Simple to understand ▫Modular, Re-usable ▫Can be learned  can be.
Artificial Intelligence Lecture No. 15 Dr. Asad Ali Safi ​ Assistant Professor, Department of Computer Science, COMSATS Institute of Information Technology.
Review Topics Test 1. Background Topics Definitions of Artificial Intelligence & Turing Test Physical symbol system hypothesis vs connectionist approaches.
Introduction to Expert Systems. 2 Objectives Learn the meaning of an expert system Understand the problem domain and knowledge domain Learn the advantages.
Chapter 14: Artificial Intelligence Invitation to Computer Science, C++ Version, Third Edition.
Notes for Chapter 12 Logic Programming The AI War Basic Concepts of Logic Programming Prolog Review questions.
13: Inference Techniques
Chapter 7: Introduction to CLIPS Expert Systems: Principles and Programming, Fourth Edition.
11 C H A P T E R Artificial Intelligence and Expert Systems.
Chapter 1: Introduction to Expert Systems Expert Systems: Principles and Programming, Fourth Edition.
Chapter 1: Introduction to Expert Systems Expert Systems: Principles and Programming, Fourth Edition Original by Course Technology Modified by Ramin Halavati.
IDDS: Rules-based Expert Systems
School of Computer Science and Technology, Tianjin University
Expert Systems An Introduction to Expert Systems and CLIPS by Charles Weddle.
Chapter 9: Rules and Expert Systems Lora Streeter.
 Architecture and Description Of Module Architecture and Description Of Module  KNOWLEDGE BASE KNOWLEDGE BASE  PRODUCTION RULES PRODUCTION RULES 
Jess: A Rule-Based Programming Environment Reporter: Yu Lun Kuo Date: April 10, 2006 Expert System.
 Dr. Syed Noman Hasany 1.  Review of known methodologies  Analysis of software requirements  Real-time software  Software cost, quality, testing.
ES component and structure Dr. Ahmed Elfaig The production system or rule-based system has three main component and subcomponents shown in Figure 1. 1.Knowledge.
COM362 Knowledge Engineering Inferencing 1 Inferencing: Forward and Backward Chaining John MacIntyre
1 Knowledge Based Systems (CM0377) Lecture 10 (Last modified 19th March 2001)
Chapter 1: Introduction to Expert Systems Expert Systems: Principles and Programming, Fourth Edition Original by Course Technology Modified by Ramin Halavati.
Chapter 4: Inference Techniques
 Negnevitsky, Pearson Education, Introduction, or what is knowledge? Knowledge is a theoretical or practical understanding of a subject or a domain.
Artificial Intelligence
ITEC 1010 Information and Organizations Chapter V Expert Systems.
Artificial Intelligence, simulation and modelling.
Knowledge Engineering. Review- Expert System 3 Knowledge Engineering The process of building an expert system: 1.The knowledge engineer establishes a.
1 Chapter 13 Artificial Intelligence and Expert Systems.
Artificial Intelligence: Applications
EXPERT SYSTEMS BY MEHWISH MANZER (63) MEER SADAF NAEEM (58) DUR-E-MALIKA (55)
Advanced AI Session 2 Rule Based Expert System
Intelligent Systems and Soft Computing
Chapter 9. Rules and Expert Systems
Introduction to Expert Systems Bai Xiao
Architecture Components
Decision Trees & Rule-based AI
Chapter 7: Introduction to CLIPS
MANAGING KNOWLEDGE FOR THE DIGITAL FIRM
Chapter 1: Introduction to Expert Systems
Presentation transcript:

Introduction to Expert System Chapter 11. Rule-Based AI 2013/5/2 1

What is an expert system? “An expert system is a computer system that emulates, or acts in all respects, with the decision-making capabilities of a human expert.” Professor Edward Feigenbaum Stanford University 2

Expert System Main Components Knowledge base – obtainable from books, magazines, knowledgeable persons, etc. – An expert’s knowledge is specific to one problem domain – medicine, finance, science, engineering, etc. Inference engine – draws conclusions from the knowledge base 3

Basic Functions of Expert Systems 4

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 5

The Goal of Expert Systems We need to be able to separate the actual meanings of words with the reasoning process itself. We need to make inferences w/o relying on semantics. We need to reach valid conclusions based on facts only. 6

Figure 2.2 The Pyramid of Knowledge 7

Productions A number of knowledge-representation techniques have been devised: Rules: IF-THEN rules Semantic nets Frames Scripts Logic Conceptual graphs 8

9

Knowledge Engineering The process of building an expert system: 1.The knowledge engineer establishes a dialog with the human expert to elicit knowledge. 2.The knowledge engineer codes the knowledge explicitly in the knowledge base. 3.The expert evaluates the expert system and gives a critique to the knowledge engineer. 10

Development of an Expert System 11

Structure of a Rule-Based Expert System 12

Elements of an Expert System User interface – mechanism by which user and system communicate. Explanation 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. 13

Elements Continued 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. 14

Direct Reasoning Modus Ponens 15

Some Rules of Inference 16

Rules of Inference 17

Production Rules Knowledge base is also called production memory. Production rules can be expressed in IF-THEN pseudocode format. In rule-based systems, the inference engine determines which rule antecedents are satisfied by the facts. 18

Chaining Chain – a group of multiple inferences that connect a problem with its solution A chain that is searched / traversed from a problem to its solution is called a forward chain. A chain traversed from a hypothesis back to the facts that support the hypothesis is a backward chain. Problem with backward chaining is find a chain linking the evidence to the hypothesis. 19

General Methods of Inferencing Forward chaining – reasoning from facts to the conclusions resulting from those facts – best for prognosis, monitoring, and control. – data-driven Backward chaining – reasoning in reverse from a hypothesis, a potential conclusion to be proved to the facts that support the hypothesis – best for diagnosis problems. – goal driven 20

Production Systems Rule-based expert systems – most popular type today. Knowledge is represented as multiple rules that specify what should/not be concluded from different situations. Forward chaining – start w/facts and use rules do draw conclusions/take actions. Backward chaining – start w/hypothesis and look for rules that allow hypothesis to be proven true. 21

Figure 3.21 Causal Forward Chaining 22

What is CLIPS? CLIPS is a multiparadigm programming language that provides support for: – Rule-based – Object-oriented – Procedural programming Syntactically, CLIPS resembles: – Eclipse – CLIPS/R2 – JESS 23

Other CLIPS Characteristics CLIPS supports only forward-chaining rules. The OOP capabilities of CLIPS are referred to as CLIPS Object-Oriented Language (COOL). The procedural language capabilities of CLIPS are similar to languages such as: – C – Ada – Pascal – Lisp 24

CLIPS Characteristics CLIPS is an acronym for C Language Integrated Production System. CLIPS was designed using the C language at the NASA/Johnson Space Center. CLIPS is portable – PC  CRAY. 25

(deftemplate goal (slot move) (slot on-top-of)) (deffacts initial-state (stack A B C) (stack D E F) (goal (move C) (on-top-of E)) (stack)) (defrule move-directly ?goal <- (goal (move ?block1) (on-top-of ?block2)) ?stack-1 <- (stack ?block1 $?rest1) ?stack-2 <- (stack ?block2 $?rest2) => (retract ?goal ?stack-1 ?stack-2) (assert (stack $?rest1)) (assert (stack ?block1 ?block2 $?rest2)) (printout t ?block1 " moved on top of " ?block2 "." crlf)) 26

(defrule move-to-floor ?goal <- (goal (move ?block1) (on-top-of floor)) ?stack-1 <- (stack ?block1 $?rest) => (retract ?goal ?stack-1) (assert (stack ?block1)) (assert (stack $?rest)) (printout t ?block1 " moved on top of floor." crlf)) (defrule clear-upper-block (goal (move ?block1)) (stack ?top $? ?block1 $?) => (assert (goal (move ?top) (on-top-of floor)))) (defrule clear-lower-block (goal (on-top-of ?block1)) (stack ?top $? ?block1 $?) => (assert (goal (move ?top) (on-top-of floor)))) 27

Advantages of Expert Systems Increased availability Reduced cost Reduced danger Performance Multiple expertise Increased reliability 28

Advantages Continued Explanation Fast response Steady, unemotional, and complete responses at all times Intelligent tutor Intelligent database 29

Problems with Algorithmic Solutions Conventional computer programs generally solve problems having algorithmic solutions. Algorithmic languages include C, Java, and C#. Classic AI languages include LISP and PROLOG. 30

Limitations of Expert Systems Typical expert systems cannot generalize through analogy to reason about new situations in the way people can. A knowledge acquisition bottleneck results from the time-consuming and labor intensive task of building an expert system. 31

Chapter 11. Rule-Based AI 32

Real-time strategy simulation game Keep track of the player's current state of technology so that the computer opponent can plan and deploy offensive and defensive resources accordingly Send out scouts to collect information and then make inferences given the information as it is received 33

Real-time strategy simulation game 34

Martial arts fighting game Anticipate the player's next strike so that the computer opponent can make the appropriate countermove, such as a counter strike, a dodge, or a parry For example, if during the fight the player throws a punch, punch combination, what will the player most likely throw next: a punch, a low kick, or a high kick? 35

11.1 Rule-Based System Basics Working memory – stores known facts and assertions made by the rules Rules memory – stores known facts and assertions made by the rules As rules are triggered, or fired in rule-based system lingo, they can trigger some action or state change 36

Example working memory enum TMemoryValue{Yes, No, Maybe, Unknown}; TMemoryValue Peasants; TMemoryValue Woodcutter; TMemoryValue Stonemason; TMemoryValue Blacksmith; TMemoryValue Barracks; … 37

Making rules The computer can gather facts on the player's current state of technology by sending out scouts and making observations if(Woodcutter == Yes && Stonemason == Yes && Temple == Unknown) Temple = Maybe; 38

Example priest rule if(Priest == Yes) { Temple = Yes; Barracks = Yes; Woodcutter= Yes; Stonemason= Yes; } 39

Write such rules and execute them continuously during the game to maintain an up-to-date picture of the computer opponent's view of the player's technology capabilities Use this knowledge in other AI subsystems to decide how to deploy its attack forces and defenses. 40

Forward Chaining 1.matching rules to facts stored in working memory 2.Conflict resolution – more than one rule can match a given set of facts in working memory – matching rule, random, highest weight 3.Fire the rule The whole process is repeated until no more rules can be fired 41

Conflict resolution Refractotiness – A rule should not be allowed to fire more than once on the same data Recency Specificity 42

Backward Chaining Start with some outcome, or goal, and we try to figure out which rules must be fired to arrive at that outcome or goal if(Blacksmith == Yes) Cavalry =Yes 43

11.2 Fighting Game Strike Prediction Predict a human opponent's next strike in a martial arts fighting game – punch, low kick, or high kick – 27 rules to capture all possible three-strike combinations 44

Working memory enum TStrikes {Punch, LowKick, HighKick, Unknown}; struct TWorkingMemory { TStrikes strikeA; // previous, previous strike (data) TStrikes strikeB; // previous strike (data) TStrikes strikeC; // next, predicted, strike (assertion) }; 45

Rules class TRule { public: TRule(); void SetRule(TStrikes A, TStrikes B, TStrikes C); TStrikes antecedentA; TStrikes antecedentB; TStrikes consequentC; bool matched; int weight; }; 46

27 Rules void TForm1::Initialize(void) { – Rules[0].SetRule(Punch, Punch, Punch); – Rules[1].SetRule(Punch, Punch, LowKick); – Rules[2].SetRule(Punch, Punch, HighKick); – Rules[3].SetRule(Punch, LowKick, Punch); – Rules[4].SetRule(Punch, LowKick, LowKick); – Rules[5].SetRule(Punch, LowKick, HighKick); – Rules[6].SetRule(Punch, HighKick, Punch); – … 47

Strike Prediction 1.Populates the working memory 1.collect some data from the player 2.Processing the previous prediction – Reinforce the matched rule by increasing the rule's weight(meta-knowledge) 3.Find the rules that match the facts stored in working memory, conflict resolution(most weighted) Experiments saw success rates from 33% up to 65-80% 48