Professional Documents
Culture Documents
Rule Engine Ppshow
Rule Engine Ppshow
Definition
START
putOnTable(bowl)
putOnTable(spoon)
putOnTable(napkin)
open(cereal-container)
pour(cereal)
open(milk-container)
pour(milk)
inviteOwner("You may begin eating")
END
The Robot Example
Teaching a robot to drive is much more difficult because the task vary
according
to environmental conditions
a. Robot must not do the tasks for backing out of garage if the garage door is
closed or if there is a little girl on a tricycle right behind the car
b. Backing out will be different on warm days and cold days. Also, in a
parking spaces, backing up procedures will be different in different
Settings
Domain experts (or business analysts) are readily available, but are
nontechnical
Advantages of a Rule Engine
Declarative Programming
Centralization of Knowledge
Tool Integration
Explanation Facility
High Level view of a Rule Engine
Working Memory. The data that rules work on. Also called the fact base.
Production Memory. Knowledge and inferences are stored in rules, which are called
production rules.
Pattern Matcher. Determines which rules to apply to the data in working memory.
• There are a number of algorithms used for Pattern Matching by Inference Engines
including:
• Linear
• Rete
• Treat
• Leaps
Execution Engine. The part of the rules engine that is responsible for applying rules to
data and then performing the action part of the rules that have fired.
Architecture of Typical Rule Based
System
observed data
working memory
select modify
rule
Inference
memory fire output
engine
Reasoning with production rules
Architecture of a typical production
system:
New information
working memory
select modify
rule
interpreter
memory fire output
Reasoning with production rules
Architecture of a typical production
system:
New information
rule
interpreter
memory fire output
Reasoning with production rules
Architecture of a typical production
system:
New information
working memory
select
modify
Inference
rule engine
memory output
fire executes
actions
Reasoning with production rules
Architecture of a typical production
system:
New information
working memory
select modify
Inference
rule engine
memory
fire executes output
actions
Reasoning with production rules
Architecture of a typical production
system:
New information
rule
interpreter
memory fire output
Reasoning with production rules
Architecture of a typical production
system:
New information
working memory
select
modify
Inference
rule engine
memory executes output
fire
actions
Reasoning with production rules
Architecture of a typical production
system:
New information
working memory
select modify
Inference
rule engine
memory executes
fire output
actions
Methods of execution for a rule system
Forward Chaining Backward Chaining
Goal Goal
Start
Start
Forward Chaining
Goal
conclude the color of my pet Fritz
GREEN he croaks
eats flies
frog
Backward Chaining
Goal
conclude the color of my pet Fritz
1. conclude the color of my pet 1. If X croaks and eats flies - Then X is a frog
Fritz 2. If X chirps and sings - Then X is a canary
3. If X is a frog - Then X is green
4. If X is a canary - Then X is yellow
Goal List
Working Memory
1. conclude the color of my pet Fritz
he croaks 2. X is a frog
eats flies 3. X is a canary
So my pet Fritz