ECS533U Week 8 Lab Exercises
ECS533U Week 8 Lab Exercises
ECS533U Introduction to AI
Lab Exercises Week 8
_______________________________
Objective: The lab exercises for this class are designed to solidify the concepts we covered
during the lectures. The will range from theoretical questions, problem-solving tasks and
practical implementations. In week 8 we looked at inference in first-order logic: in this lab
you will use forward chaining and resolution to perform inference.
Document Summary
Exercises
Marking Criteria
Submission Details
Change Log
Exercises
This lab can be done individually (individual task) or in a group of 2 (group task). Any
changes to depth or breadth of each task is clearly detailed in the exercise description.
Note: in this lab, all tasks are individual except for the additional group task described in
Exercise 8.3.
Note: you may use text symbols in place of logical notation, e.g. OR, FORALL. You are not
expected to format logical formulae beautifully, but they must be clear and readable.
Time: 30 minutes
Task: Describe how forward chaining works with this knowledge base.
A: 𝐴𝑛𝑐𝑒𝑠𝑡𝑜𝑟(𝑀𝑜𝑡ℎ𝑒𝑟(𝑥), 𝑥)
Consider a forward chaining algorithm that, on the jth iteration, terminates if the KB contains
a sentence that unifies with the query, else adds to the KB every atomic sentence that can
be inferred from the sentences already in the KB after iteration j − 1.
Describe the first two iterations of forward chaining on this knowledge base. Draw a diagram
to show how sentences are related. (You do not have to include the formulae in your
diagram: label your formulae and refer to the labels in the diagram.)
For each of the following queries, say whether the algorithm will:
1. Give an answer (if so, give the answer and the iteration it is found);
2. Terminate with no answer;
3. Never terminate.
Output: A written description of the knowledge base and attempted proof (PDF or Word).
Use three predicates: HeadOf (h, x) (meaning “h is the head of x”), Horse (x), and Animal
(x).
Draw a diagram to illustrate your proof. (Again, you do not have to include the formulae in
your diagram: label your formulae and refer to the labels in the diagram.)
Task: Design a first-order logic knowledge base about family relationships. Attempt to prove
some simple theorems about the knowledge base.
Output: A written description of the knowledge base and attempted proofs (PDF or Word).
Choose a well-known family or make up your own fictional family. Design a first-order logic
knowledge base that represents these people and their family relationships.
● Grandparents
● Siblings.
● Either uncles or aunts.
You may use equality axioms (see Russell & Norvig section 9.5.5 for a description of equality
axioms).
State and prove three theorems using either forward chaining or resolution:
Briefly discuss whether forward chaining or resolution could be used in each case, and why.
Group Task: Complete the individual tasks described above, and additionally add the concept of
cousin to the knowledge base. State a non-ground theorem about cousins and prove it using
resolution.
Marking Criteria
Total marks available: 100
Task 8.1
Criteria Marks Description
Describe Iterations 50% Full marks for correctly describing two iterations of forward
chaining, with a correct diagram. Correct syntax and unifiers.
Justify Results 25% Explain why the queries have those results..
Tasks 8.2
Criteria Marks Description
Translation 20% Full marks for correct translation of A and B into first order logic.
Deduct marks for syntax errors or inadequacies in translation.
Proof 60% Full marks for a correct proof. Marks awarded for correct proof
steps. Deduct marks for incorrect steps and syntax errors.
Task 8.3
Criteria Marks Description
State theorems 30% Full marks for stating appropriate theorems. Deduct marks if
they are not theorems, are not representing what is requested,
or have syntax errors.
Proof 30% Full marks for a correct proof of each theorem. Marks awarded
for correct proof steps. Deduct marks for incorrect steps and
syntax errors.
Submission Details
Submit answer to the exercises in a single document (PDF or Word)
At the top of all submissions pieces you should have the following information:
Lab Title:
Student Name:
Submission Type: Group/Individual (delete as appropriate)
Group members:
When to submit: All labs may form part of your coursework submissions. This lab is eligible
to be submitted as part of your selection in the Week 12 submission (Coursework 2).
Change Log
13 November 2024 JG: initial version published.
13 November 2024 JG: added clarification on individual vs group tasks.
13 November 2024 JG: added marking criteria.