1 RBS CS 331/531 Dr M M Awais Production Systems Symbolic based Rule based system Based on simple...
-
date post
19-Dec-2015 -
Category
Documents
-
view
218 -
download
3
Transcript of 1 RBS CS 331/531 Dr M M Awais Production Systems Symbolic based Rule based system Based on simple...
CS 331/531 Dr M M Awais 1
RBS
Production Systems
Symbolic based Rule based systemBased on simple working principleSystem consists of:
production rulesworking memoryrecognise-act control cycle.
CS 331/531 Dr M M Awais 2
RBS
Production Rules (Productions)
Production Rules are:
Condition – Action Pair
Defines the associated problem-solving step.
Pattern that determines when to apply rule
CS 331/531 Dr M M Awais 3
RBS
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
CS 331/531 Dr M M Awais 4
RBS
Recognise – Act CycleRecognise – 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 rulesMatch the WM memory with the conditions of rules
CS 331/531 Dr M M Awais 5
RBS
Recognise – Act CycleRecognise – 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 EnabledPart of Production That Are Enabled
CS 331/531 Dr M M Awais 6
RBS
Recognise – Act CycleRecognise – 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 It chooses a rule from conflict set for firing. Selection of any rule may be based on complex rule selection heuristics.may be based on complex rule selection heuristics.
CS 331/531 Dr M M Awais 7
RBS
Recognise – Act CycleRecognise – 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 WMFire a rule and update the WM
CS 331/531 Dr M M Awais 8
RBS
Feedback in the Systems in which no conflict resolution Feedback in the Systems in which no conflict resolution remains. All conflicts are resolvedremains. All conflicts are resolved
A Production System
WMWMPatternsPatterns
P A1P A2
----
Pattern Action
CS 331/531 Dr M M Awais 9
RBS
Example:Production Set:
1.1. ba ba ab ab
2.2. ca ca ac ac
3.3. cb cb bc bc(whenever a pattern on the LHS appears replace it with (whenever a pattern on the LHS appears replace it with
the one on the RHS )the one on the RHS )
Working Memory = acbccWorking Memory = acbcc
Conflict Set = 3
Rule fired = 3
acbcbcc abcbccc
CS 331/531 Dr M M Awais 10
RBS Example:Production Set:
1.1. ba ba ab ab
2.2. ca ca ac ac
3.3. cb cb bc bc
CS 331/531 Dr M M Awais 11
RBS Example:Production Set: 1.1. ba ba ab ab
2.2. ca ca ac ac
3.3. cb cb bc bc
Iteration#
WM Conflict Set
Rule Fired
0 cbaca 1,2,3 1
1 cabca 2 2
2 acbca 2,3 2
3 acbac 1,3 1
4 acabc 2 2
5 aacbc 3 3
6 aabcc NIL NIL
CS 331/531 Dr M M Awais 12
RBS Example:Production Set: 1.1. ba ba ab ab
2.2. ca ca ac ac
3.3. cb cb bc bc
Iteration#
WM Conflict Set
Rule Fired
0 cbaca 1,2,3 1
1 cabca 2 2
2 acbca 2,3 2
3 acbac 1,3 1
4 acabc 2 2
5 aacbc 3 3
6 aabcc NIL NIL
CS 331/531 Dr M M Awais 13
RBS Example:Production Set: 1.1. ba ba ab ab
2.2. ca ca ac ac
3.3. cb cb bc bc
Iteration#
WM Conflict Set
Rule Fired
0 cbaca 1,2,3 1
1 cabca 2 2
2 acbca 2,3 2
3 acbac 1,3 1
4 acabc 2 2
5 aacbc 3 3
6 aabcc NIL NIL
CS 331/531 Dr M M Awais 14
RBS Example:Production Set: 1.1. ba ba ab ab
2.2. ca ca ac ac
3.3. cb cb bc bc
Iteration#
WM Conflict Set
Rule Fired
0 cbaca 1,2,3 1
1 cabca 2 2
2 acbca 2,3 2
3 acbac 1,3 1
4 acabc 2 2
5 aacbc 3 3
6 aabcc NIL NIL
CS 331/531 Dr M M Awais 15
RBS Example:Production Set: 1.1. ba ba ab ab
2.2. ca ca ac ac
3.3. cb cb bc bc
Iteration#
WM Conflict Set
Rule Fired
0 cbaca 1,2,3 1
1 cabca 2 2
2 acbca 2,3 2
3 acbac 1,3 1
4 acabc 2 2
5 aacbc 3 3
6 aabcc NIL NIL
CS 331/531 Dr M M Awais 16
RBS Example:Production Set: 1.1. ba ba ab ab
2.2. ca ca ac ac
3.3. cb cb bc bc
Iteration#
WM Conflict Set
Rule Fired
0 cbaca 1,2,3 1
1 cabca 2 2
2 acbca 2,3 2
3 acbac 1,3 1
4 acabc 2 2
5 aacbc 3 3
6 aabcc NIL NIL
CS 331/531 Dr M M Awais 17
RBS Example:Production Set: 1.1. ba ba ab ab
2.2. ca ca ac ac
3.3. cb cb bc bc
Iteration#
WM Conflict Set
Rule Fired
0 cbaca 1,2,3 1
1 cabca 2 2
2 acbca 2,3 2
3 acbac 1,3 1
4 acabc 2 2
5 aacbc 3 3
6 aabcc NIL NIL
CS 331/531 Dr M M Awais 18
RBS
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 ^ qIF symbols on the LHS appear then add the
symbols on the RHS to the WM
Data Driven Search in Production System
CS 331/531 Dr M M Awais 19
RBS 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#
WM Conflict Set
Rule Fired
0 start 6 6
1 start,v,y,q 6,5 5
2 start,v,r,q,s 6,5,2 2
3 start,v,r,q,s,p
6,5,2,1 1
4 start,v,r,q,s,p, goal
6,5,2,1 NIL
CS 331/531 Dr M M Awais 20
RBS 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#
WM Conflict Set
Rule Fired
0 start 6 6
1 start,v,r,q 6,5 5
2 start,v,r,q,s 6,5,2 2
3 start,v,r,q,s,p
6,5,2,1 1
4 start,v,r,q,s,p, goal
6,5,2,1 NIL
CS 331/531 Dr M M Awais 21
RBS 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#
WM Conflict Set
Rule Fired
0 start 6 6
1 start,v,r,q 6,5 5
2 start,v,r,q,s 6,5,2 2
3 start,v,r,q,s,p
6,5,2,1 1
4 start,v,r,q,s,p, goal
6,5,2,1 NIL
CS 331/531 Dr M M Awais 22
RBS 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#
WM Conflict Set
Rule Fired
0 start 6 6
1 start,v,y,q 6,5 5
2 start,v,r,q,s 6,5,2 2
3 start,v,r,q,s,p
6,5,2,1 1
4 start,v,r,q,s,p, goal
6,5,2,1 NIL
CS 331/531 Dr M M Awais 23
RBS 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#
WM Conflict Set
Rule Fired
0 start 6 6
1 start,v,y,q 6,5 5
2 start,v,r,q,s 6,5,2 2
3 start,v,r,q,s,p
6,5,2,1 1
4 start,v,r,q,s,p, goal
6,5,2,1 NIL
CS 331/531 Dr M M Awais 31
RBS
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
CS 331/531 Dr M M Awais 32
RBS 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# WM Conflict Set Rule Fired
0 Goal 1 1
1 Goal,p,q 1,2,3,4 2
2 Goal,p,q,r,s 1,2,3,4,5 3
3 Goal,p,q,r,s,w 1,2,3,4,5 4
4 Goal,p,q,r,s,w,t,u 1,2,3,4,5 5
5 Goal,p,q,r,s,w,t,u,v 1,2,3,4,5,6 6
6 Goal,p,q,r,s,w,t,u,v,start
1,2,3,4,5,6 NIL
CS 331/531 Dr M M Awais 33
RBS 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# WM Conflict Set Rule Fired
0 Goal 1 1
1 Goal,p,q 1,2,3,4 2
2 Goal,p,q,r,s 1,2,3,4,5 3
3 Goal,p,q,r,s,w 1,2,3,4,5 4
4 Goal,p,q,r,s,w,t,u 1,2,3,4,5 5
5 Goal,p,q,r,s,w,t,u,v 1,2,3,4,5,6 6
6 Goal,p,q,r,s,w,t,u,v,start
1,2,3,4,5,6 NIL
CS 331/531 Dr M M Awais 34
RBS 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# WM Conflict Set Rule Fired
0 Goal 1 1
1 Goal,p,q 1,2,3,4 2
2 Goal,p,q,r,s 1,2,3,4,5 3
3 Goal,p,q,r,s,w 1,2,3,4,5 4
4 Goal,p,q,r,s,w,t,u 1,2,3,4,5 5
5 Goal,p,q,r,s,w,t,u,v 1,2,3,4,5,6 6
6 Goal,p,q,r,s,w,t,u,v,start
1,2,3,4,5,6 NIL
CS 331/531 Dr M M Awais 35
RBS 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# WM Conflict Set Rule Fired
0 Goal 1 1
1 Goal,p,q 1,2,3,4 2
2 Goal,p,q,r,s 1,2,3,4,5 3
3 Goal,p,q,r,s,w 1,2,3,4,5 4
4 Goal,p,q,r,s,w,t,u 1,2,3,4,5 5
5 Goal,p,q,r,s,w,t,u,v 1,2,3,4,5,6 6
6 Goal,p,q,r,s,w,t,u,v,start
1,2,3,4,5,6 NIL
CS 331/531 Dr M M Awais 36
RBS 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# WM Conflict Set Rule Fired
0 Goal 1 1
1 Goal,p,q 1,2,3,4 2
2 Goal,p,q,r,s 1,2,3,4,5 3
3 Goal,p,q,r,s,w 1,2,3,4,5 4
4 Goal,p,q,r,s,w,t,u 1,2,3,4,5 5
5 Goal,p,q,r,s,w,t,u,v 1,2,3,4,5,6 6
6 Goal,p,q,r,s,w,t,u,v,start
1,2,3,4,5,6 NIL
CS 331/531 Dr M M Awais 37
RBS 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# WM Conflict Set Rule Fired
0 Goal 1 1
1 Goal,p,q 1,2,3,4 2
2 Goal,p,q,r,s 1,2,3,4,5 3
3 Goal,p,q,r,s,w 1,2,3,4,5 4
4 Goal,p,q,r,s,w,t,u 1,2,3,4,5 5
5 Goal,p,q,r,s,w,t,u,v 1,2,3,4,5,6 6
6 Goal,p,q,r,s,w,t,u,v,start
1,2,3,4,5,6 NIL
CS 331/531 Dr M M Awais 38
RBS 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# WM Conflict Set Rule Fired
0 Goal 1 1
1 Goal,p,q 1,2,3,4 2
2 Goal,p,q,r,s 1,2,3,4,5 3
3 Goal,p,q,r,s,w 1,2,3,4,5 4
4 Goal,p,q,r,s,w,t,u 1,2,3,4,5 5
5 Goal,p,q,r,s,w,t,u,v 1,2,3,4,5,6 6
6 Goal,p,q,r,s,w,t,u,v,start
1,2,3,4,5,6 NIL
CS 331/531 Dr M M Awais 46
RBS
Hearsay – II (Erman et.al 1980)
• One of the first developed project
• AIMED at speech recognition system
CS 331/531 Dr M M Awais 47
RBS
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
CS 331/531 Dr M M Awais 48
RBS
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.
CS 331/531 Dr M M Awais 49
RBS
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
CS 331/531 Dr M M Awais 50
RBS
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 AimlesslyR4 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
CS 331/531 Dr M M Awais 51
RBS
Forward Chaining:Rule firing
Alarm beeps Hot 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
CS 331/531 Dr M M Awais 52
RBS
Forward Chaining:Rule firing
Alarm beeps Hot 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
CS 331/531 Dr M M Awais 53
RBS
Forward Chaining:Rule firing
Alarm beeps Hot 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
CS 331/531 Dr M M Awais 54
RBS
Forward Chaining:Rule firing
Alarm beeps Hot 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
CS 331/531 Dr M M Awais 55
RBS
Forward Chaining:Rule firing
Alarm beeps Hot 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
CS 331/531 Dr M M Awais 56
RBS
Forward Chaining:Rule firing
Alarm beeps Hot 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
CS 331/531 Dr M M Awais 57
RBS
Forward Chaining:Rule firing
Alarm beeps Hot 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
CS 331/531 Dr M M Awais 58
RBS
Forward Chaining
End up firing more than required rules
Generally applied when lots of facts are known about the system
CS 331/531 Dr M M Awais 59
RBS
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
CS 331/531 Dr M M Awais 60
RBS
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
CS 331/531 Dr M M Awais 61
RBS
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
CS 331/531 Dr M M Awais 62
RBS
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
smoky hot
R1
Alarm beeps
R2No rule available but present in the facts
CS 331/531 Dr M M Awais 63
RBS
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
smoky hot
R1
Alarm beeps
R2No rule available but present in the facts
CS 331/531 Dr M M Awais 64
RBS
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
smoky hot
R1
Alarm beeps
R2No rule available but present in the facts
CS 331/531 Dr M M Awais 65
RBS
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
smoky hot
R1
Alarm beeps
R2No rule available but present in the facts
CS 331/531 Dr M M Awais 66
RBS
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
smoky hot
R1
Alarm beeps
R2No rule available but present in the facts
No rule available but present in the facts
CS 331/531 Dr M M Awais 67
RBS
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
smoky hot
R1
Alarm beeps
R2No rule available but present in the facts
No rule available but present in the facts
HENCE THE GOAL IS SATISFIEDHENCE THE GOAL IS SATISFIED
CS 331/531 Dr M M Awais 68
RBS 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
CS 331/531 Dr M M Awais 69
RBS
Conflict Resolution General Approaches:
General Conflict Resolution strategies Problem Specific Conflict Resolution
Strategies
Rules that control the resolution process are called META rules
CS 331/531 Dr M M Awais 70
RBS
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
CS 331/531 Dr M M Awais 71
RBS
Examples: Recency Rule1: Credit History Rule:IF X has had credit for less than 3 yearsTHENX’s credit history is very low Rule2: High Risk RuleIF X’s credit history is very lowANDX has been unemployed for more than half of his adult
yearsTHENX is a high credit risk customer Rule 3: Age RuleIF X’s age is less than 25 yearsTHENX is young
CS 331/531 Dr M M Awais 72
RBS Examples: Recency
Rule1: Credit History Rule:IF X has had credit for less than 3 yearsTHENX’s credit history is very low Rule2: High Risk RuleIF X’s credit history is very lowANDX has been unemployed for more than half of his adult
yearsTHENX is a high credit risk customer Rule 3: Age RuleIF X’s age is less than 25 yearsTHENX is young
1. Atif is 25 years old2. Atif has 1 yr of credit history3. Atif unemployed for 3/5
of his adult life
CS 331/531 Dr M M Awais 73
RBS Examples: Recency
Rule1: Credit History Rule:IF X has had credit for less than 3 yearsTHENX’s credit history is very low Rule2: High Risk RuleIF X’s credit history is very lowANDX has been unemployed for more than half of his adult
yearsTHENX is a high credit risk customer Rule 3: Age RuleIF X’s age is less than 25 yearsTHENX is young
1. Atif is 25 years old2. Atif has 1 yr of credit history3. Atif unemployed for 3/5
of his adult life
1. Atif is 25 years old2. Atif has 1 yr of credit history3. Atif unemployed for 3/5 of hisadult life4. Atif’s credit history is very low
R1
Newly added fact
Why wasn’t the Rule 3 fired?, will be answered later
CS 331/531 Dr M M Awais 74
RBS Examples: Recency
Rule1: Credit History Rule:IF X has had credit for less than 3 yearsTHENX’s credit history is very low Rule2: High Risk RuleIF X’s credit history is very lowANDX has been unemployed for more than half of his adult
yearsTHENX is a high credit risk customer Rule 3: Age RuleIF X’s age is less than 25 yearsTHENX is young
1. Atif is 25 years old2. Atif has 1 yr of credit history3. Atif unemployed for 3/5
of his adult life
1. Atif is 25 years old2. Atif has 1 yr of credit history3. Atif unemployed for 3/5 of hisadult life4. Atif’s credit history is very low
R1
Newly added factR2
To be added: Atif is a high credit risk customer
CS 331/531 Dr M M Awais 75
RBS
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
CS 331/531 Dr M M Awais 76
RBSProblem 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 yearsTHENX’s credit history is very low Rule2: High Risk RuleIF X’s credit history is very lowANDX has been unemployed for more than half of
his adult yearsTHENX is a high credit risk customer Rule 3: Age RuleIF X’s age is less than 25 yearsTHENX is young