Professional Documents
Culture Documents
IF
THEN
R2
IF
THEN
R3
IF
THEN
R4
IF
THEN
R5
IF
THEN
R6
IF
THEN
R7
IF
THEN
R8
IF
THEN
R9
IF
THEN
R10
IF
THEN
R11
IF
THEN
R12
IF
THEN
R13
IF
THEN
R14
IF
THEN
R15
IF
THEN
Solution (Q1).
Working Memory:
the animal gives milk
the animal chews its cud
the animal has long legs
the animal has a long neck
Inference engine:
Cycle 1: R2 add: it is a mammal to Working Memory (WM)
Cycle 2: R2, R8 add: it is an ungulate, it is even-toed to WM
Cycle 3: R2, R8, R11 add: it is a Giraffe to WM
Stop and display: It is a Giraffe
Final state of Working Memory:
the animal gives milk
the animal chews its cud
the animal has long legs
the animal has a long neck
it is a mammal
it is an ungulate
it is even-toed
it is a Giraffe
Solution (Q2).
Given the facts in working memory initially:
the animal has hair
the animal has claws
the animal has pointed teeth
the animal's eyes point forward
the animal has a tawny color
the animal has dark spots
Is the animal a cheetah? Justify using backward chaining (Goal driven
reasoning)
To prove that the animal is a cheetah, we have to prove that (using Rule 9):
the animal is a carnivore and the animal has a tawny color and the animal has
dark spots
To prove that the animal is carnivore, we have to prove either:
the animal is a mammal and the animal eats meat (Rule 5)
or
the animal is a mammal and the animal has pointed teeth and the animal has
claws and the animal's eyes point forward (Rule 6)
The animal is mammal can be proved using Rule 1 (as the animal has hair is
present in WM). However, the animal eats meat is not present in WM and
cannot be proved using any rule. So, we cannot prove that the animal is
carnivore by using Rule 5. Now, let us try Rule 6. The animal is mammal can
be proved using Rule 1.the facts the animal has pointed teeth and the animal
has claws and the animal's eyes point forward are present in WM so they are
true. Therefore, the animal is a carnivore is true.
the animal is a carnivore has been proved. Let us prove the remaining facts.
the animal has a tawny color and the animal has dark spots are true because
they are present in WM. Therefore, we can conclude that:
The animal is cheetah
Solution (Q1).
working memory (initially): A and F
List the different facts deduced by the inference engine when using forward
chaining (data driven reasoning). For conflict resolution, use rule order as
implied priority (if there is a conflict, choose the rule with smallest number).
For the case of fact with negation, use closed world assumption: if the fact is
present in WM (working Memory) then it is true (its negation is false)
otherwise it is false (its negation is true).
Closed world assumption: if a fact is present in WM, it is true otherwise it is
false (its negation is true).
Inference Engine:
Cycle 1: R2, R7 select R2 and add: D to Working Memory (WM)
Cycle 2: R2, R7 add: E to WM
Cycle 3: R2, R5, R7 add: H to WM
Cycle 4: R2, R5, R6, R7 add: I to WM
Cycle 5: R2, R5, R6, R7, R8 add: G to WM
Cycle 6: R2, R5, R6, R7, R8, R9 add: K to WM
Cycle 7: R2, R5, R6, R7, R8, R9 STOP there is no applicable rules
Solution (Q2)
Is the goal I true of false? Justify using backward chaining (Goal driven
reasoning). For conflict resolution, use rule order as implied priority (if there is
a conflict, choose the rule with smallest number).
By exploring AND/OR Graph, we can easily prove that I is true