Download Comp 371 Fall 2005 Assignment 1

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

Propositional calculus wikipedia , lookup

Transcript
COMP 3710 Applied Artificial Intelligence
Seminar/Lab 4.
Propositional Logic
1. Objectives

Use of logical equivalences

How to convert BNF to CNF

Use of resolution refutation

How to convert rules and facts to Horn forms
In this week, you are asked to answer the next questions.
2. (2 marks) Which of the followings are correct? You need to prove or disprove using truth
tables.
a. (A  B)  C  (A  C)  (B  C)
b. (C  (~A  ~B))  ((A  C)  (B  C))
3. (2 marks) Convert the followings to CNF forms. You need to use equivalences.
a. (A  (B  C))  (~(B  C))
b. (A  (B  C))  ((A  B)  C)
4. (2 mark) Convert the next 4 rules and 1 fact to a CNF form.
a. Rules
 If X croaks and eats flies, then X is a frog.
 If X chirps and sings, then X is a canary.
 If X is a frog, then X is colored green.
 If X is a canary, then X is colored yellow.
b. Fact
 Fritz croaks and eats flies.
c. Query
 The color of Fritz is Green.
5. (2 marks) Using resolution refutation prove the above question.
6. (2 marks) Convert the next rules and facts to and-or graph.
a. If X croaks and eats flies, then X is a frog.
b. If X chirps and sings, then X is a canary.
1
c. If X is a frog, then X is colored green.
d. If X is a canary, then X is colored yellow.
e. Fritz croaks and eats flies.
f.
What color is Fritz?
7. (3 marks) Prove the above question using backward chaining. You need to start with Yellow.
8. (3 marks) Let’s suppose we have rules as follows.

If A and B, then C.

If D, then C.

If E, then F.

If G and H, then E.
Then we can convert the above rules to disjunction of conjunctions as follows.
var rule = {};
// empty associative array
rule['C'] = [[A, B], [D]];
// (A  B)  (D)
rule['F'] = [[E]];
// (E)
rule['E'] = [[G, H]];
// (G  H)
Each of rule[] is an array of arrays of propositional symbols. Outer array uses  and inner
arrays use .
Convert all the rules in ZooKeeper in the above way. This representation of rules will be used
in the implementation of backward chaining for ZooKeeper next week.
9. (1 mark) Let’s suppose we have facts as follows.

G

H
Then we can convert the above rules as follows.
var fact = [];
fact[0] = 'G';
fact[1] = 'H';
Convert all the facts in ZooKeeper in the above way. This representation of facts will be used
in the implementation of backward chaining for ZooKeeper next week.
10. Submission
You need to submit a document file, not images of hand-written answers.
Total marks: 17
Due with full marks: 11:59 PM, October 21, 2016
Due for the late submission with 10% penalty: 11:59 PM, October 23, 2016
2
3