Download Backward chaining for ZooKeeper

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
COMP 3710 Applied Artificial Intelligence
Seminar/Lab 5.
Backward Chaining for ZooKeeper
1. Objectives

Use of backward chaining

How to convert rules and facts to Horn forms

How to use DNF in the implementation of backward chaining
2. How to implement backward chaining for ZooKeeper
var rule = {};
rule['Mammal'] = [['Hair'], ['Milk']];
// rules for Mammal
...
var fact = [];
fact[0] = 'Hair';
...
var animal = ['Albatross', 'Penguin', 'Ostrich', 'Zebra', 'Giraffe', 'Tiger',
'Cheetah'];...
var sub_goal = [];
function isFact(ps)
// ps: propositional symbol
function isSubGoal(ps)
function popFromSubGoals(ps)
function pushIntoSubGoals(ps)
function pushIntoFacts(ps)
function thereIsNoRuleToUse(ps)
function print(msg), println(msg), clear()
// utility functions to display messages
The functions that you need to implement:

function find()
This function should print a proper message for each animal.

function backwardChaining(ps)
// ps: propositional symbol
You can start with

//cs.tru.ca/~mlee/comp3710/Software/backward-chaining-zookeeper-student.html
3. Exercise
rule['Bird'] = [['Feather'], ['Fly', 'LayEgg']];
There are two rules to check if ‘Bird’ is valid.
Algorithm of backwardChining():
If ‘Bird’ is a fact, then it is valid and hence return true.
If there is no more rule to use for ‘Bird’, then it is not valid and hence return false.
If ‘Bird’ is a sub-goal, then it is not valid and hence return false.
(Use backward chaining again for each rule.)
Make ‘Bird’ a sub-goal.
(If ‘Feather’ is valid, or ‘Fly’ and ‘LayEgg’ are valid, then ‘Bird’ is valid. You may use for loops.)
Return backwardChaining(‘Feather’) || (backwardChaining(‘Fly’) && backwardChaining(‘LayEgg’))
4. Assignment

Submit the application in 2) by email, with the screen shot that shows how your application works.

Please do not share the code. Any violation could cause a very serious problem.

The title of the mail should include your name, id, and COMP 3710.

Total marks: 10
o

No completion: 0 mark

Any syntax error, or

No implementation of any of necessary functions
o
Full implementation with logical errors: 5 marks
o
Full implementation with no logical error: 10 marks
Due
o
Full mark: 11:59 pm, October 28, 2016
o
20% penalty: 11:59 pm, October 30, 2016
o
Any further late submission will NOT be accepted. Even 1 second according to TRU email system.