This assignment uses Prolog and the biductive computing paradigm to allow a user to generate a schedule of courses for completing a computer science degree. For the sake of simplicity, only computer science and mathematics courses are included, though a more useful planner would include all university courses. Courses may be offered in spring, fall, or both. And some courses have one or more prerequisites that must be completed in prior semesters.
There are only eight semesters available for scheduling courses (Fall first year through Spring fourth year). At most, only four courses may be scheduled each semester. A course cannot be scheduled more than once. A course with prerequisites can only be scheduled in a semester after all of its prerequisites have been scheduled. All courses required for the major must be scheduled.
The included file courses.pl
contains facts about course offerings (Fall or Spring or both), prerequisites, and courses required for the major. Refer to the test cases in planner_tests.pl
for the list of required rules.
A typical course planner simply tells the student which courses are still needed before they can complete their degree. But students often have more complex questions during advising sessions that cannot be easily answered. These questions include, “when should I take a particular course?”; “do I have to take this course in that semester?”; “when can I study abroad (and thereby possibly miss a semester of courses)?”; “can I still graduate if I only take at most two computer science courses per semester?” These questions require biductive computing because they mix partial initial conditions with partial goal conditions.
Your course planner must support the following biductive features:
A series of test cases are given in planner_tests.pl
. Run the test cases with this command:
swipl -q -s planner_tests.pl -t run_tests
If the tests pass, you should see only some dots (1 dot per test) and no error or warning messages.
Submit your planner.pl
file. Include the files planner_tests.pl
and courses.pl
as well, even though you do not need to modify them.
Note: You must not write any new facts. Only write rules. The file courses.pl
has all the facts that are needed.
You'll probably want to start your planner.pl
file like so:
:- [courses]. % import courses.pl
As a simple extension to this assignment, more courses may be added to courses.pl
to cover general education requirements. Our computer science major also requires several elective courses from a list of options. Courses may be distinguished as elective or non-elective and corresponding rules may be added to the planner.pl
file and test cases.
Further enhancements may involve course load restrictions (e.g., no more than two computer science courses per semester, and no fewer than three courses overall per semester) and course time-of-day details.
Naturally, more majors may be added with appropriate additions to courses.pl
and updates to rules in planner.pl
to allow the user to indicate their desired major. Adding minors would also be a useful enhancement.
More biductive features may be added such as the ability to answer a question like, “which major requires the fewest additional courses beyond those I have already taken?” or, “if I study abroad for one semester, which semester should I choose so that I can keep an easy schedule in my senior year?”