Starting from:

$30

Assignment 2 COMP 3608

1
Assignment 2
(COMP 3608 - Intelligent Systems)
(For students who want to obtain 4 credits)

Total Mark: 100 marks (weighted 7% out of 100%)
Question 1: [40] Suppose the database initially includes facts A, B, C, D and E, and the knowledge
base contains only three rules:
Rule 1: IF (Y is true) AND (D is true) THEN Z is true
Rule 2: IF (X is true) AND (B is true) AND (E is true) THEN Y is true
Rule 3: IF (A is true) THEN X is true
a. Write a CLIPS program named Fig5.clp to implement the three rules given above.
b. Run the program Fig5.clp, observe its outputs, and explain how the inference process was
performed on the above set of three rules and five facts by CLIPS to infer the fact Z.
Hint: Use the command (agenda) to show the list of activated rules (i.e., activations).
c. Write a Prolog program named Fig5.pl to implement the three rules and five facts given
above.
d. Trace the execution of the program Fig5.pl, observe its outputs, and explain how the
inference process was performed on the above set of three rules and five facts by Prolog to infer
the fact Z.
Hint: Use the trace. command to show the execution steps performed by Prolog.
Question 2: [40 marks] Suppose that a database initially includes the facts A, B, C, D and E, and
the knowledge base contains a set of five rules as follows.
Rule 1:
Y & D → Z
Rule 2:
X & B & E → Y
Rule 3:
A → X
Rule 4:
C → L
Rule 5:
L & M → N
a. Write a CLIPS program named Fig6.clp to implement the five rules given above.
b. Run the program Fig6.clp, observe its outputs, and explain how the inference process was
performed on the above set of five rules and five facts by CLIPS to infer the fact Z.
Hint: Use the command (agenda) to show the list of activated rules (i.e., activations).
c. Write a Prolog program named Fig7.pl to implement the five rules and five facts given above.
d. Trace the execution of the program Fig7.pl, observe its outputs, and explain how the
inference process was performed on the above set of five rules and five facts by Prolog to infer the
fact Z.
Hint: Use the trace. command to show the execution steps performed by Prolog.
Question 3: [20 marks] Implement the demonstrative expert system named Media Advisor in
Negnevitsky’s book (Section 2.7, page 41-57) using
a. [10 marks] CLIPS (name your program MediaAdvisor.clp) and
b. [10 marks] Prolog (name your program MediaAdvisor.pl).
2
Assignment Requirements and Marking Scheme
1. For the CLIPS programs, you need to capture and show the outputs of their executions.
2. For the Prolog programs, you need to capture and show the outputs of their executions. In
addition, use the trace. command to show the steps executed by Prolog.
Submission
1. At the top of your files, you should include the following information.
/*
Full Name:
Student ID:
Email:
Course Code:
*/
2. Submit your files zipped into the file named A2_StudentID.zip (e.g., A2_809000437.zip)
to Mr. Inzamam via the email inzamam.rahaman@outlook.com.
3. Late submission penalty: 10% per day, up to five days
End of Assignment 2

More products