1 RBS CS 331/531 Dr M M Awais Production Systems  Symbolic based Rule based system  Based on simple working principle  System consists of:  production.

Slides:



Advertisements
Similar presentations
Lahore University of Management Sciences, Lahore, Pakistan Dr. M.M. Awais- Computer Science Department Lecture 2 Development Life Cycle of ES.
Advertisements

Inference Rules Universal Instantiation Existential Generalization
CHAPTER 13 Inference Techniques. Reasoning in Artificial Intelligence n Knowledge must be processed (reasoned with) n Computer program accesses knowledge.
1 Rule Based Systems Introduction to Production System Architecture.
Fuzzy Approach.
Methods of Proof Chapter 7, second half.. Proof methods Proof methods divide into (roughly) two kinds: Application of inference rules: Legitimate (sound)
Methods of Proof Chapter 7, Part II. Proof methods Proof methods divide into (roughly) two kinds: Application of inference rules: Legitimate (sound) generation.
Logic.
CS 484 – Artificial Intelligence1 Announcements Choose Research Topic by today Project 1 is due Thursday, October 11 Midterm is Thursday, October 18 Book.
Simplifying CFGs There are several ways in which context-free grammars can be simplified. One natural way is to eliminate useless symbols those that cannot.
Conflict Resolution  what to do if there is more than 1 matching rule in each inference cycle? match WM with LHS of rules select one rule (conflict resolution)
B. Ross Cosc 4f79 1 Forward chaining backward chaining systems: take high-level goal, and prove it by reducing it to a null goal - to reduce it to null,
Reasoning System.  Reasoning with rules  Forward chaining  Backward chaining  Rule examples  Fuzzy rule systems  Planning.
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
Expert System Human expert level performance Limited application area Large component of task specific knowledge Knowledge based system Task specific knowledge.
Chapter 4 Normal Forms for CFGs Chomsky Normal Form n Defn A CFG G = (V, , P, S) is in chomsky normal form if each rule in G has one of.
Proof methods Proof methods divide into (roughly) two kinds: –Application of inference rules Legitimate (sound) generation of new sentences from old Proof.
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.
Lecture 04 Rule Representation
1 Pertemuan 6 RULE-BASED SYSTEMS Matakuliah: H0383/Sistem Berbasis Pengetahuan Tahun: 2005 Versi: 1/0.
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.
Methods of Proof Chapter 7, second half.
© 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.
Planning Techniques Planning:The problem of finding some action to achieve some goal System’s Plan:The sequence of such actions is called System’s Plan.
Knoweldge Representation & Reasoning
EXPERT SYSTEMS Part I.
Lahore University of Management Sciences, Lahore, Pakistan Dr. M.M. Awais- Computer Science Department Lecture 5 Knowledge Representation Formal Method.
Artificial Intelligence
Modelling planning problems using PDDL
Artificial Intelligence
INTELLIGENT SYSTEMS Rule based systems 1. Aims of session To understand  Basic principles  Forward chaining  Problems with rule-based systems  Backward.
Empirical Explorations with The Logical Theory Machine: A Case Study in Heuristics by Allen Newell, J. C. Shaw, & H. A. Simon by Allen Newell, J. C. Shaw,
Knowledge based Humans use heuristics a great deal in their problem solving. Of course, if the heuristic does fail, it is necessary for the problem solver.
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 
Logical Agents Logic Propositional Logic Summary
An Introduction to Artificial Intelligence – CE Chapter 7- Logical Agents Ramin Halavati
Syntax Why is the structure of language (syntax) important? How do we represent syntax? What does an example grammar for English look like? What strategies.
Rule Based Systems  If then  Rules to solve problems  What is forward chaining?  What is backward chaining?  Expert systems.
Expert System Note: Some slides and/or pictures are adapted from Lecture slides / Books of Dr Zafar Alvi. Text Book - Aritificial Intelligence Illuminated.
COM362 Knowledge Engineering Inferencing 1 Inferencing: Forward and Backward Chaining John MacIntyre
Automated Reasoning Early AI explored how to automated several reasoning tasks – these were solved by what we might call weak problem solving methods as.
Automated Reasoning Early AI explored how to automate several reasoning tasks – these were solved by what we might call weak problem solving methods as.
1 Knowledge Based Systems (CM0377) Lecture 10 (Last modified 19th March 2001)
Closure Properties Lemma: Let A 1 and A 2 be two CF languages, then the union A 1  A 2 is context free as well. Proof: Assume that the two grammars are.
© Copyright 2008 STI INNSBRUCK Intelligent Systems Propositional Logic.
Dr. Shazzad Hosain Department of EECS North South Universtiy Lecture 04 – Part B Propositional Logic.
Backward chaining Assume the same representation of rules as in forward chaining, i.e. If is true, is true, … is true Then is true. Rule interpretation.
1 Propositional Logic Limits The expressive power of propositional logic is limited. The assumption is that everything can be expressed by simple facts.
Logical Agents Chapter 7. Outline Knowledge-based agents Propositional (Boolean) logic Equivalence, validity, satisfiability Inference rules and theorem.
Forward and Backward Chaining
Expert System Seyed Hashem Davarpanah University of Science and Culture.
Proof Methods for Propositional Logic CIS 391 – Intro to Artificial Intelligence.
Artificial Intelligence: Applications
Intelligent Systems Rule based systems 1. Aims of session To understand Basic principles Forward chaining Problems with rule-based systems Backward chaining.
Logical Agents. Outline Knowledge-based agents Logic in general - models and entailment Propositional (Boolean) logic Equivalence, validity, satisfiability.
Lecture 20. Recap The main components of an ES are –Knowledge Base (LTM) –Working Memory (STM) –Inference Engine (Reasoning)
EA C461 Artificial Intelligence
Chapter 9. Rules and Expert Systems
STATE SPACE REPRESENTATION
Forward Chaining DFS can supply compatible bindings for forward chaining.
Chapter 9. Rules and Expert Systems
Methods of Proof Chapter 7, second half.
Presentation transcript:

1 RBS CS 331/531 Dr M M Awais Production Systems  Symbolic based Rule based system  Based on simple working principle  System consists of:  production rules  working memory  recognise-act control cycle.

2 RBS CS 331/531 Dr M M Awais Production Rules (Productions) Production Rules are: Condition – Action Pair Defines the associated problem-solving step. Pattern that determines when to apply rule

3 RBS CS 331/531 Dr M M Awais Working Memory  Contains the description of current state  WM state is compared with the condition part of the production rules to determine the type of action required.  Always changes when productions are applied

4 RBS CS 331/531 Dr M M Awais Recognise – Act Cycle Initialise Working Memory Productions - Conditions Conflict Set Conflict Resolution (if the two match) (one pattern taken at a time) (Enabled) Production - (Fired) Match the WM memory with the conditions of rules

5 RBS CS 331/531 Dr M M Awais Recognise – Act Cycle Initialise Working Memory Productions - Conditions Conflict Set Conflict Resolution (if the two match) (one pattern taken at a time) (Enabled) Production - (Fired) Productions can only fire when conditions in production-conditions are matched in the working memory (WM). If they match a subset of productions is formed called Conflict Set. Part of Production That Are Enabled

6 RBS CS 331/531 Dr M M Awais Recognise – Act Cycle Initialise Working Memory Productions - Conditions Conflict Set Conflict Resolution (if the two match) (one pattern taken at a time) (Enabled) Production - (Fired) It chooses a rule from conflict set for firing. Selection of any rule may be based on complex rule selection heuristics.

7 RBS CS 331/531 Dr M M Awais Recognise – Act Cycle Initialise Working Memory Productions - Conditions Conflict Set Conflict Resolution (if the two match) (one pattern taken at a time) (Enabled) Production - (Fired) Fire a rule and update the WM

8 RBS CS 331/531 Dr M M Awais Feedback in the Systems in which no conflict resolution remains. All conflicts are resolved A Production System WMPatterns P  A1 P  A2 - Pattern  Action

9 RBS CS 331/531 Dr M M Awais Example: Production Set: 1.ba  ab 2.ca  ac 3.cb  bc (whenever a pattern on the LHS appears replace it with the one on the RHS ) Working Memory = acbcc Conflict Set=3 Rule fired=3 cbbc a cb cca bc cc

10 RBS CS 331/531 Dr M M Awais Example: Production Set: 1.ba  ab 2.ca  ac 3.cb  bc

11 RBS CS 331/531 Dr M M Awais Example: Production Set: 1.ba  ab 2.ca  ac 3.cb  bc Iteration#WMConflict SetRule Fired 0cbaca1,2,31 1cabca22 2acbca2,32 3acbac1,31 4acabc22 5aacbc33 6aabccNIL

12 RBS CS 331/531 Dr M M Awais Example: Production Set: 1.ba  ab 2.ca  ac 3.cb  bc Iteration#WMConflict SetRule Fired 0cbaca1,2,31 1cabca22 2acbca2,32 3acbac1,31 4acabc22 5aacbc33 6aabccNIL

13 RBS CS 331/531 Dr M M Awais Example: Production Set: 1.ba  ab 2.ca  ac 3.cb  bc Iteration#WMConflict SetRule Fired 0cbaca1,2,31 1cabca22 2acbca2,32 3acbac1,31 4acabc22 5aacbc33 6aabccNIL

14 RBS CS 331/531 Dr M M Awais Example: Production Set: 1.ba  ab 2.ca  ac 3.cb  bc Iteration#WMConflict SetRule Fired 0cbaca1,2,31 1cabca22 2acbca2,32 3acbac1,31 4acabc22 5aacbc33 6aabccNIL

15 RBS CS 331/531 Dr M M Awais Example: Production Set: 1.ba  ab 2.ca  ac 3.cb  bc Iteration#WMConflict SetRule Fired 0cbaca1,2,31 1cabca22 2acbca2,32 3acbac1,31 4acabc22 5aacbc33 6aabccNIL

16 RBS CS 331/531 Dr M M Awais Example: Production Set: 1.ba  ab 2.ca  ac 3.cb  bc Iteration#WMConflict SetRule Fired 0cbaca1,2,31 1cabca22 2acbca2,32 3acbac1,31 4acabc22 5aacbc33 6aabccNIL

17 RBS CS 331/531 Dr M M Awais Example: Production Set: 1.ba  ab 2.ca  ac 3.cb  bc Iteration#WMConflict SetRule Fired 0cbaca1,2,31 1cabca22 2acbca2,32 3acbac1,31 4acabc22 5aacbc33 6aabccNIL

18 RBS CS 331/531 Dr M M Awais Production Set: 1.p ^ q  goal 2.r ^ s  p 3.w ^ r  q 4.t ^ u  q 5.v  s 6.Start  v ^ r ^ q IF symbols on the LHS appear then add the symbols on the RHS to the WM Data Driven Search in Production System

19 RBS CS 331/531 Dr M M Awais 1.p ^ q  goal 2.r ^ s  p 3.w ^ r  q 4.t ^ u  q 5.v  s 6.start  v ^ r ^ q Data Driven: Production Set: Iteration#WMConflict SetRule Fired 0start66 1start,v,y,q6,55 2start,v,r,q,s6,5,22 3start,v,r,q,s,p6,5,2,11 4start,v,r,q,s,p, goal 6,5,2,1NIL

20 RBS CS 331/531 Dr M M Awais 1.p ^ q  goal 2.r ^ s  p 3.w ^ r  q 4.t ^ u  q 5.v  s 6.start  v ^ r ^ q Data Driven: Production Set: Iteration#WMConflict SetRule Fired 0start66 1start,v,r,q6,55 2start,v,r,q,s6,5,22 3start,v,r,q,s,p6,5,2,11 4start,v,r,q,s,p, goal 6,5,2,1NIL

21 RBS CS 331/531 Dr M M Awais 1.p ^ q  goal 2.r ^ s  p 3.w ^ r  q 4.t ^ u  q 5.v  s 6.start  v ^ r ^ q Data Driven: Production Set: Iteration#WMConflict SetRule Fired 0start66 1start,v,r,q6,55 2start,v,r,q,s6,5,22 3start,v,r,q,s,p6,5,2,11 4start,v,r,q,s,p, goal 6,5,2,1NIL

22 RBS CS 331/531 Dr M M Awais 1.p ^ q  goal 2.r ^ s  p 3.w ^ r  q 4.t ^ u  q 5.v  s 6.start  v ^ r ^ q Data Driven: Production Set: Iteration#WMConflict SetRule Fired 0start66 1start,v,y,q6,55 2start,v,r,q,s6,5,22 3start,v,r,q,s,p6,5,2,11 4start,v,r,q,s,p, goal 6,5,2,1NIL

23 RBS CS 331/531 Dr M M Awais 1.p ^ q  goal 2.r ^ s  p 3.w ^ r  q 4.t ^ u  q 5.v  s 6.start  v ^ r ^ q Data Driven: Production Set: Iteration#WMConflict SetRule Fired 0start66 1start,v,y,q6,55 2start,v,r,q,s6,5,22 3start,v,r,q,s,p6,5,2,11 4start,v,r,q,s,p, goal 6,5,2,1NIL

24 RBS CS 331/531 Dr M M Awais start qrv

25 RBS CS 331/531 Dr M M Awais start qrv s

26 RBS CS 331/531 Dr M M Awais start qrv s p

27 RBS CS 331/531 Dr M M Awais start qrv s p goal

28 RBS CS 331/531 Dr M M Awais start qrv s p goal

29 RBS CS 331/531 Dr M M Awais start qrv s p goal

30 RBS CS 331/531 Dr M M Awais start qrv s p goal

31 RBS CS 331/531 Dr M M Awais Production Set: 1.p ^ q  goal 2.r ^ s  p 3.w ^ r  q 4.t ^ u  q 5.v  s 6.Start  v ^ r ^ q GOAL Driven Search in Production System

32 RBS CS 331/531 Dr M M Awais 1.p ^ q  goal 2.r ^ s  p 3.w ^ r  q 4.t ^ u  q 5.v  s 6.start  v ^ r ^ q Goal Driven: Production Set: Iteration#WMConflict SetRule Fired 0Goal11 1Goal,p,q1,2,3,42 2Goal,p,q,r,s1,2,3,4,53 3Goal,p,q,r,s,w1,2,3,4,54 4Goal,p,q,r,s,w,t,u1,2,3,4,55 5Goal,p,q,r,s,w,t,u,v1,2,3,4,5,66 6Goal,p,q,r,s,w,t,u,v,start1,2,3,4,5,6NIL

33 RBS CS 331/531 Dr M M Awais 1.p ^ q  goal 2.r ^ s  p 3.w ^ r  q 4.t ^ u  q 5.v  s 6.start  v ^ r ^ q Goal Driven: Production Set: Iteration#WMConflict SetRule Fired 0Goal11 1Goal,p,q1,2,3,42 2Goal,p,q,r,s1,2,3,4,53 3Goal,p,q,r,s,w1,2,3,4,54 4Goal,p,q,r,s,w,t,u1,2,3,4,55 5Goal,p,q,r,s,w,t,u,v1,2,3,4,5,66 6Goal,p,q,r,s,w,t,u,v,start1,2,3,4,5,6NIL

34 RBS CS 331/531 Dr M M Awais 1.p ^ q  goal 2.r ^ s  p 3.w ^ r  q 4.t ^ u  q 5.v  s 6.start  v ^ r ^ q Goal Driven: Production Set: Iteration#WMConflict SetRule Fired 0Goal11 1Goal,p,q1,2,3,42 2Goal,p,q,r,s1,2,3,4,53 3Goal,p,q,r,s,w1,2,3,4,54 4Goal,p,q,r,s,w,t,u1,2,3,4,55 5Goal,p,q,r,s,w,t,u,v1,2,3,4,5,66 6Goal,p,q,r,s,w,t,u,v,start1,2,3,4,5,6NIL

35 RBS CS 331/531 Dr M M Awais 1.p ^ q  goal 2.r ^ s  p 3.w ^ r  q 4.t ^ u  q 5.v  s 6.start  v ^ r ^ q Goal Driven: Production Set: Iteration#WMConflict SetRule Fired 0Goal11 1Goal,p,q1,2,3,42 2Goal,p,q,r,s1,2,3,4,53 3Goal,p,q,r,s,w1,2,3,4,54 4Goal,p,q,r,s,w,t,u1,2,3,4,55 5Goal,p,q,r,s,w,t,u,v1,2,3,4,5,66 6Goal,p,q,r,s,w,t,u,v,start1,2,3,4,5,6NIL

36 RBS CS 331/531 Dr M M Awais 1.p ^ q  goal 2.r ^ s  p 3.w ^ r  q 4.t ^ u  q 5.v  s 6.start  v ^ r ^ q Goal Driven: Production Set: Iteration#WMConflict SetRule Fired 0Goal11 1Goal,p,q1,2,3,42 2Goal,p,q,r,s1,2,3,4,53 3Goal,p,q,r,s,w1,2,3,4,54 4Goal,p,q,r,s,w,t,u1,2,3,4,55 5Goal,p,q,r,s,w,t,u,v1,2,3,4,5,66 6Goal,p,q,r,s,w,t,u,v,start1,2,3,4,5,6NIL

37 RBS CS 331/531 Dr M M Awais 1.p ^ q  goal 2.r ^ s  p 3.w ^ r  p 4.t ^ u  q 5.v  s 6.start  v ^ r ^ q Goal Driven: Production Set: Iteration#WMConflict SetRule Fired 0Goal11 1Goal,p,q1,2,3,42 2Goal,p,q,r,s1,2,3,4,53 3Goal,p,q,r,s,w1,2,3,4,54 4Goal,p,q,r,s,w,t,u1,2,3,4,55 5Goal,p,q,r,s,w,t,u,v1,2,3,4,5,66 6Goal,p,q,r,s,w,t,u,v,start1,2,3,4,5,6NIL

38 RBS CS 331/531 Dr M M Awais 1.p ^ q  goal 2.r ^ s  p 3.w ^ r  p 4.t ^ u  q 5.v  s 6.start  v ^ r ^ q Goal Driven: Production Set: Iteration#WMConflict SetRule Fired 0Goal11 1Goal,p,q1,2,3,42 2Goal,p,q,r,s1,2,3,4,53 3Goal,p,q,r,s,w1,2,3,4,54 4Goal,p,q,r,s,w,t,u1,2,3,4,55 5Goal,p,q,r,s,w,t,u,v1,2,3,4,5,66 6Goal,p,q,r,s,w,t,u,v,start1,2,3,4,5,6NIL

39 RBS CS 331/531 Dr M M Awais goal qp

40 RBS CS 331/531 Dr M M Awais goal qp r w

41 RBS CS 331/531 Dr M M Awais goal qp r w s r

42 RBS CS 331/531 Dr M M Awais goal qp r w s r t u

43 RBS CS 331/531 Dr M M Awais goal qp r w s r t u v

44 RBS CS 331/531 Dr M M Awais goal qp r w s r t u start v

45 RBS CS 331/531 Dr M M Awais goal qp r w s r t u start v

46 RBS CS 331/531 Dr M M Awais Hearsay – II (Erman et.al 1980) One of the first developed project AIMED at speech recognition system

47 RBS CS 331/531 Dr M M Awais Rule Based System Modeled as Production systems Production Systems implemented as Cause-Effect rules RBS have IF-THEN rules in their structures Working principle is same as production system Capable of handling vague concepts

48 RBS CS 331/531 Dr M M Awais Rule Based System Find all the rules which have the IF part satisfied Select one rule using conflict resolution Perform action and modify the Working memory Repeat until all the rules have been fired or the goal have been reached.

49 RBS CS 331/531 Dr M M Awais Example: RBS with 5 Rules R1: If hot and smoky then add fire R2: If alarm beeps then add smoky R3: If fire then add switch on the sprinklers R4: If dry Then add switch on humidifier R5: If switch on sprinklers then Delete dry Given Facts: Alarm beeps, hot, dry If you associate every fact with symbols it becomes a production system

50 RBS CS 331/531 Dr M M Awais Forward Chaining: Rule firing R2 and R4 can be fired If R2 fired then R1, R3, and R5 will follow As a result: Dry will be deleted from WM If R4 is fired R2, R1, R3, and R5 will be fired As a result: Dry will be deleted from WM R4 is fired Aimlessly R4 is fired Aimlessly R1: If hot and smoky then add fire R2: If alarm beeps then add smoky R3: If fire then add switch on the sprinklers R4: If dry Then add switch on humidifier R5: If switch on sprinklers then Delete dry Given Facts: Alarm beeps, hot, dry

51 RBS CS 331/531 Dr M M Awais Forward Chaining: Rule firing Alarm beepsHot dry R1: If hot and smoky then add fire R2: If alarm beeps then add smoky R3: If fire then add switch on the sprinklers R4: If dry Then add switch on humidifier R5: If switch on sprinklers then Delete dry Given Facts: Alarm beeps, hot, dry

52 RBS CS 331/531 Dr M M Awais Forward Chaining: Rule firing Alarm beepsHot dry Switch_on_humdifiers R4 smoky R2 R1: If hot and smoky then add fire R2: If alarm beeps then add smoky R3: If fire then add switch on the sprinklers R4: If dry Then add switch on humidifier R5: If switch on sprinklers then Delete dry Given Facts: Alarm beeps, hot, dry

53 RBS CS 331/531 Dr M M Awais Forward Chaining: Rule firing Alarm beepsHot dry Switch_on_humdifiers R4 smoky R2 fire R1 R1: If hot and smoky then add fire R2: If alarm beeps then add smoky R3: If fire then add switch on the sprinklers R4: If dry Then add switch on humidifier R5: If switch on sprinklers then Delete dry Given Facts: Alarm beeps, hot, dry

54 RBS CS 331/531 Dr M M Awais Forward Chaining: Rule firing Alarm beepsHot dry Switch_on_humdifiers R4 smoky R2 fire R1 Switch_on_sprinklers R3 R1: If hot and smoky then add fire R2: If alarm beeps then add smoky R3: If fire then add switch on the sprinklers R4: If dry Then add switch on humidifier R5: If switch on sprinklers then Delete dry Given Facts: Alarm beeps, hot, dry

55 RBS CS 331/531 Dr M M Awais Forward Chaining: Rule firing Alarm beepsHot dry Switch_on_humdifiers R4 smoky R2 fire R1 Switch_on_sprinklers R3 R1: If hot and smoky then add fire R2: If alarm beeps then add smoky R3: If fire then add switch on the sprinklers R4: If dry Then add switch on humidifier R5: If switch on sprinklers then Delete dry Given Facts: Alarm beeps, hot, dry Delete dry

56 RBS CS 331/531 Dr M M Awais Forward Chaining: Rule firing Alarm beepsHot dry Switch_on_humdifiers R4 smoky R2 fire R1 Switch_on_sprinklers R3 R1: If hot and smoky then add fire R2: If alarm beeps then add smoky R3: If fire then add switch on the sprinklers R4: If dry Then add switch on humidifier R5: If switch on sprinklers then Delete dry Given Facts: Alarm beeps, hot, dry Delete dry

57 RBS CS 331/531 Dr M M Awais Forward Chaining: Rule firing Alarm beepsHot dry Switch_on_humdifiers R4 smoky R2 fire R1 Switch_on_sprinklers R3 R1: If hot and smoky then add fire R2: If alarm beeps then add smoky R3: If fire then add switch on the sprinklers R4: If dry Then add switch on humidifier R5: If switch on sprinklers then Delete dry Given Facts: Alarm beeps, hot, dry Delete dry Invalid rule

58 RBS CS 331/531 Dr M M Awais Forward Chaining End up firing more than required rules Generally applied when lots of facts are known about the system

59 RBS CS 331/531 Dr M M Awais Backward chaining From the goal find the initial conditions that satisfy the goal. Goals are divided into sub-goals and then further sub-goals are found until the initial conditions are reached Applied when the goal is exactly known

60 RBS CS 331/531 Dr M M Awais Backward chaining Hypothesize that the goal is true and then try to prove the hypothesis Start from the GOAL and see if the WM supports the facts required to make the goal true

61 RBS CS 331/531 Dr M M Awais Example R1: if smoky and hot then add fire R2: If alarm beeps then add smoky R3: If alarm beeps then add ear plugs R4: If fire then add switch on sprinklers R5: If smoky then add poor visibility Facts: Alarm beeps, hot Goal: Switch on sprinklers

62 RBS CS 331/531 Dr M M Awais Example R1: if smoky and hot then add fire R2: If alarm beeps then add smoky R3: If alarm beeps then add ear plugs R4: If fire then add switch on sprinklers R5: If smoky then add poor visibility Facts: Alarm beeps, hot Goal: Switch on sprinklers Switch on sprinklers fire R4 smokyhot R1 Alarm beeps R2 No rule available but present in the facts

63 RBS CS 331/531 Dr M M Awais Example R1: if smoky and hot then add fire R2: If alarm beeps then add smoky R3: If alarm beeps then add ear plugs R4: If fire then add switch on sprinklers R5: If smoky then add poor visibility Facts: Alarm beeps, hot Goal: Switch on sprinklers Switch on sprinklers fire R4 smokyhot R1 Alarm beeps R2 No rule available but present in the facts

64 RBS CS 331/531 Dr M M Awais Example R1: if smoky and hot then add fire R2: If alarm beeps then add smoky R3: If alarm beeps then add ear plugs R4: If fire then add switch on sprinklers R5: If smoky then add poor visibility Facts: Alarm beeps, hot Goal: Switch on sprinklers Switch on sprinklers fire R4 smokyhot R1 Alarm beeps R2 No rule available but present in the facts

65 RBS CS 331/531 Dr M M Awais Example R1: if smoky and hot then add fire R2: If alarm beeps then add smoky R3: If alarm beeps then add ear plugs R4: If fire then add switch on sprinklers R5: If smoky then add poor visibility Facts: Alarm beeps, hot Goal: Switch on sprinklers Switch on sprinklers fire R4 smokyhot R1 Alarm beeps R2 No rule available but present in the facts

66 RBS CS 331/531 Dr M M Awais Example R1: if smoky and hot then add fire R2: If alarm beeps then add smoky R3: If alarm beeps then add ear plugs R4: If fire then add switch on sprinklers R5: If smoky then add poor visibility Facts: Alarm beeps, hot Goal: Switch on sprinklers Switch on sprinklers fire R4 smokyhot R1 Alarm beeps R2 No rule available but present in the facts No rule available but present in the facts

67 RBS CS 331/531 Dr M M Awais Example R1: if smoky and hot then add fire R2: If alarm beeps then add smoky R3: If alarm beeps then add ear plugs R4: If fire then add switch on sprinklers R5: If smoky then add poor visibility Facts: Alarm beeps, hot Goal: Switch on sprinklers Switch on sprinklers fire R4 smokyhot R1 Alarm beeps R2 No rule available but present in the facts No rule available but present in the facts HENCE THE GOAL IS SATISFIED

68 RBS CS 331/531 Dr M M Awais Example IF (lecturing X) and (marking practicals X) Then Add (overworked X) If (month feb) then add (lecturing ali) If (month feb) Then add (marking practical ali) IF (overworked X) or (sleepless X) Then (bad mood X) If (bad mood X) then Delete (happy X) If (lecturing X) the Delete (researching X) IF (year 2004) then (economy bad) Fact Set 1: (month feb), (happy ali), (researching ali) Fact set 2: (month feb), (year 2004) Goal: find whether Ali is in bad mood or not

69 RBS CS 331/531 Dr M M Awais Conflict Resolution General Approaches: General Conflict Resolution strategies Problem Specific Conflict Resolution Strategies Rules that control the resolution process are called META rules

70 RBS CS 331/531 Dr M M Awais General Conflict Resolution strategies: META Rules Law of Recency Prefer rules for which the facts have been added recently Law of Specificity Prefer more specific rules, i.e, rules that have more conditions

71 RBS CS 331/531 Dr M M Awais Examples: Recency Rule1: Credit History Rule: IF X has had credit for less than 3 years THEN X’s credit history is very low Rule2: High Risk Rule IF X’s credit history is very low AND X has been unemployed for more than half of his adult years THEN X is a high credit risk customer Rule 3: Age Rule IF X’s age is less than 25 years THEN X is young

72 RBS CS 331/531 Dr M M Awais Examples: Recency Rule1: Credit History Rule: IF X has had credit for less than 3 years THEN X’s credit history is very low Rule2: High Risk Rule IF X’s credit history is very low AND X has been unemployed for more than half of his adult years THEN X is a high credit risk customer Rule 3: Age Rule IF X’s age is less than 25 years THEN X is young 1.Atif is 25 years old 2.Atif has 1 yr of credit history 3.Atif unemployed for 3/5 of his adult life

73 RBS CS 331/531 Dr M M Awais Examples: Recency Rule1: Credit History Rule: IF X has had credit for less than 3 years THEN X’s credit history is very low Rule2: High Risk Rule IF X’s credit history is very low AND X has been unemployed for more than half of his adult years THEN X is a high credit risk customer Rule 3: Age Rule IF X’s age is less than 25 years THEN X is young 1.Atif is 25 years old 2.Atif has 1 yr of credit history 3.Atif unemployed for 3/5 of his adult life 1.Atif is 25 years old 2.Atif has 1 yr of credit history 3.Atif unemployed for 3/5 of hisadult life 4.Atif’s credit history is very low R1 Newly added fact Why wasn’t the Rule 3 fired?, will be answered later

74 RBS CS 331/531 Dr M M Awais Examples: Recency Rule1: Credit History Rule: IF X has had credit for less than 3 years THEN X’s credit history is very low Rule2: High Risk Rule IF X’s credit history is very low AND X has been unemployed for more than half of his adult years THEN X is a high credit risk customer Rule 3: Age Rule IF X’s age is less than 25 years THEN X is young 1.Atif is 25 years old 2.Atif has 1 yr of credit history 3.Atif unemployed for 3/5 of his adult life 1.Atif is 25 years old 2.Atif has 1 yr of credit history 3.Atif unemployed for 3/5 of hisadult life 4.Atif’s credit history is very low R1 Newly added fact R2 To be added: Atif is a high credit risk customer

75 RBS CS 331/531 Dr M M Awais Specificity Prefer rules with more specific conditions I.e., rules having more antecedents R1: if smoky and hot then add fire R2: If alarm beeps and hot then add smoky R3: If alarm beeps then add ear plugs R4: If fire then add switch on sprinklers R5: If smoky then add poor visibility Facts: Alarm beeps, hot Goal: Switch on sprinklers Which rule is preferred R2 or R3? R2 is more specific, so prefer R2

76 RBS CS 331/531 Dr M M Awais Problem Specific Conflict Resolution strategies: META Rules Prefer rules with credit history over others Rule1: Credit History Rule: IF X has had credit for less than 3 years THEN X’s credit history is very low Rule2: High Risk Rule IF X’s credit history is very low AND X has been unemployed for more than half of his adult years THEN X is a high credit risk customer Rule 3: Age Rule IF X’s age is less than 25 years THEN X is young

77 RBS CS 331/531 Dr M M Awais Decision Trees Vs RBS Decision trees also implement rules Decision trees also implement the decision strategies Sequence of rule firing is built in RBS does not have the sequence built in, the conflict resolution strategies are developed.