Professional Documents
Culture Documents
Intelligence
Module Code & Version #
Knowledge Representation
Topic & Structure of The Lesson
• Procedural Representation
• Semantic Networks
• Frames
Production Rules
• It is in form of IF <condition> THEN <action>.
• If the condition of the rules is True (according to the facts
currently in the working memory), the action associated with
the rule is performed.
Similarly,
R2: IF <client working? is YES> and <salary is unknown> R7: IF <client working? is NO> and
THEN ask “What is your salary?” <client student? is NO>
read SALARY THEN refuse loan
remove <salary? is unknown> clear database
add <salary is SALARY> finish
Fire Rule 1
Fire Rule 4
How it works?
1. Find all the rules that have condition (IF part) satisfied.
2. Select one, using conflict resolution strategies. (discuss
later)
3. Perform action in conclusion, possibly modifying the
working memory until no rules can be fire or halt in working
memory.
Strategy 2: Prefer to fire rules that involve the facts that have
been recently added to working memory.
• If initially R2 fires, smoky will be added to the working
memory, thus R1 will fires rather than R4 as smoky has been
recently added to the working memory.
Working Memory
F6: tempreture (kitchen, hot)
F7: environment (kitchen, smoky)
F8: fire_in (R)
How it works?
1. If G is in the initial facts in the working memory then it is
proven.
2. Otherwise, find a rule which can be used to conclude G, and
try to prove each of the rule’s preconditions. G is then
proved True if all the preconditions are proved True.
G1: switch_on_sprinklers
Check whether the goal is match the facts in initial state of the working memory. As it isn’t
there, try to match it against the conclusion of the rules. It matches R3. The precondition of
this rule is set as a new goal to prove:
G2: Fire
Now, this isn’t in the initial facts in the working memory but it matches the conclusion of
R1, so R1 preconditions are set as new goals to prove:
G3: smoky
G4: hot
Module Code and Module Title Title of Slides Slide ‹ 5 of 24
Backward Chaining
R1: IF hot AND smoky THEN ADD fire Initial State
R2: IF alarm_beeps THEN ADD smoky
Working Memory
R3: IF fire THEN ADD switch_on_sprinklers
F1: alarm_beeps
F2: hot
G5: alarm_beeps
fire
G4: hot
R1
Alarm_beeps
F1
Example:
Forward Chaining
IF the animal produce live offerings (condition)
THEN the animal is mammal (conclusion)
Backward Chaining
The animal is a mammal (conclusion)
IF animal produces live offspring. (condition)
Examples:
There are three main modes of transport: land, sea and air.
Sea-based locomotion is by ship. Tankers are designed for carrying freight, while
ferries are designed for carrying people.
Air travel is by aeroplane or helicopter. Aeroplanes are designed for carrying people
and freight, while helicopters are designed for carrying people
Answer
As in a database, the column headings are called attributes, with the values
listed in the rows below. The factor table produces a set of attribute–value
pairs, which classify each type of transport.
For example, here is the set of attribute–value pairs for a car: mode = land,
cargo = people, locomotion = road
The rows of the factor table correspond to rules, and the columns
correspond to conditions or questions. So, for the factor table above, there
should be eight rules, with up to three conditions each.
has-part
Is_a
size colour
Large Elephant Grey
Is_an
is_an
likes
Clyde Nellie Apple
Write
Processor
Letters
has used to
used to
has Store
Memory Computer
names
has used to
I/O devices Play games
is a
Dell
Otiplex
Mat
Tom owned
caught
color
John
Bird
Ginger
Animal Mammal:
subclass: animal
subclass subclass has-part: head
has-part
Elephant:
Reptile Mammal Head
subclass: Mammal
colour: grey
subclass
size: large
size colour
Large Elephant Grey Nellie:
instance: Elephant
instance
instance likes: apple
likes
Clyde Nellie Apple
Write Computer:
Processor
has used to
Letters has: processor
has: memory
has: I/O devices
used to
has Store use to: write letters
Memory Computer
names use to: Store names
use to: Play games
has used to
Play games Dell Optiplex:
I/O devices
is a subclass: Computer
Dell
Otiplex
Q&A
• Uniform Search