Course:CPSC312-2018 University Agenda

From UBC Wiki

University Agenda


Isabel Zorrilla Steenbock, Kushal Mohee

What is the problem?


Students often have difficulties in simulating their degree on beginning university here at UBC. They have troubling exploring and scheduling their degree into a 4 year plan. This task can be especially difficult since courses often have prerequisites which need to be fulfilled and many requirements in different categories that need to be fulfilled.


We would like to prototype a tool coded in Prolog which would allow students to choose among several courses to meet the requirements of their major and build a timetable from there for the upcoming 4 years.


A typical degree in UBC would consist of 120 credits over 4 years. Often, majors in UBC already have mandatory courses(core courses) which need to be taken. While, some of these courses might fulfill some requirements, we often need to choose other courses/electives to fulfill the rest. Upper level courses might have prerequisites which were not explicitly mentioned hence we can lose track of which courses need which prerequisites.

Our prolog program allows you to choose courses from a suggested list to fulfill your requirements. It also recognizes the prerequisites and prompts you to choose the appropriate prerequisites from a list for a chosen course.

After compiling all your choices, it creates a feasible timetable while enforcing prerequisite rules. It has been designed to ask you how many courses you indeed to take each term and produces a plan accordingly. It returns a list of courses which did not fit based on the preferences you inputted.

The code was made as modular as possible. There are 3 components to it namely:

  1. The Knowledge Base - contains UBC courses
  2. The Requirements Analyser - responsible to ask about which courses the user wants to take to fulfill which requirements
  3. The Scheduler - uses the list provided by the Requirements Analyzer to create the timetable

What is the something extra?

We implemented a simple IO interface to make it easy for the user to type their chosen course and messages are written to validate the user’s choice.

What did we learn from doing this?

  1. The fundamental principles of logic programing
  2. Prototyping a solution to a problem
  3. Prolog programming syntax
  4. Using SWI-Prolog built in functions
  5. Use of triples to define relations
  6. Learnt to work with IO principles with SWI-Prolog
  7. Testing code rigorously using trace and debug functions
  8. Modular coding so that functions are general enough to be used for other majors and degrees
  9. Writing recursive predicates especially with lists

Our code:

There are 3 files in the link, each one acting as one of the components mentioned above.

  1. The Knowledge Base -
  2. The Requirements Analyzer -
  3. The Scheduler -

So far the Knowledge Base contains information relevant to a cognitive systems degree and the program will run with a cogs degree.

You only need to run load the scheduler on SWI-Prolog. Consult more instructions in the ReadMe file.

Click here to access our code.