Question: course ( cpsc 1 3 1 ) . course ( cpsc 3 3 5 ) . course ( cpsc 3 7 5 ) . course

course(cpsc131).
course(cpsc335).
course(cpsc375).
course(cpsc481).
course(cpsc483).
course(math338).
prereq(cpsc375, cpsc131).% cpsc375 has cpsc131 as a prerequisite
prereq(cpsc375, math338).
prereq(cpsc481, cpsc335).
prereq(cpsc481, math338).
prereq(cpsc483, cpsc375).
1. Write a Prolog program that will answer the queries to the situations above.
a. Give the Prolog program which will include:
i. Facts.
ii. Rules that can be used to answer the queries: (1) all courses that can be taken, and (2) all courses that have already been taken. To be added.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!