Assignment 3
Due: 11:59 PM on Thursday, November 21, 2024
Write and document a Python program that uses both forward and
backward chaining to determine if a given symbol is entailed
by a definite clause knowledge base. You have been given
Python files myDCKBClasses.py and
testDCKB.py and you need to fill in the
function definitions in file
mDCKBFunctions.template according
to the specified algorithms given in Lecture #14 to create a file
myDCKBFunctions.py such that testDCKB.py (when run using
python3 on the CS departmental LabNet systems) can exactly
reproduce the outputs in script file out.script
with respect to the definite clause files
DCClause1.txt,
DCClause2.txt, and
DCClause3.txt
and the fact files
DCFact1a.txt,
DCFact1b.txt,
DCFact1c.txt,
DCFact1d.txt,
DCFact2a.txt,
DCFact2b.txt,
DCFact3a.txt, and
DCFact3b.txt.
You are not allowed to modify any of the code in provided files
testDCKB.py and myDCKBClasses.py. When modifying
file myDCKBFunctions.template to create
myDCKBFunctions.py, you cannot:
- modify the lone import statement;
- add other import statements (this includes import
statements added automatically by IDEs such as PyCharm);
- add, modify, or remove function definitions or modify given comments
associated with those functions;
- add new class definitions or global variables (use the
provided classes in file mySearchClasses.py); or
- access any provided class attributes directly (use
provided attribute access functions in file
mySearchClasses.py).
Violations of any of these constraints will result in severe
mark deductions (see assignment evaluation scheme below).
Hints
You may find it useful to progress through the given tests
in the given order when debugging your code.
You may have to modify the given algorithms to accommodate the
situation in which the given symbol is not part of the given
definite clause knowledge base.
Assignment Submission
Please submit your program file myDCKBFunctions.py
through the course D2L / Brightspace shell by 11:59pm on the assignment due
date. Note that each program file must have the following
comment block at the top, where the X's are replaced
with the appropriate information. For example, my Python file for
this assignment would begin with the following comment block:
#########################################################
## CS 3200 (Fall 2024), Assignment #3 ##
## Script File Name: myDCKBFunctions.py ##
## Student Name: Todd Wareham ##
## Login Name: harold ##
## MUN #: 8008765 ##
#########################################################
You do not have to develop your code on our CS departmental LabNet systems.
However, as your code will be tested on our CS departmental LabNet
systems as part of the assignment marking process,
you should ensure that your code compiles and runs correctly on at
least one of these systems.
- October 17, 2024
Assignment #3 posted.
Created: October 17, 2024
Last Modified: November 4, 2024