Find CISC prerequisites
In my opinion, your code would benefit considerably from a better naming convention.

In Prolog, a good predicate name makes clear what each argument denotes.

For example, when I see:


prereqs(460, 233).


then I have no idea what the arguments are. I see it is about prerequisites, but in which direction? Is 460 a prerequisite of&nbsp;233, or is it the other way around? Also, why is this called "prereqs" although each clause only denotes a single prerequisite?

A much more descriptive name for this predicate would be (for example!):


prerequisite_of_course(460, 230).


because this makes clear what is the prerequisite of what. Another very good, descriptive name would be for example:


course_prerequisite(230, 460).


You will find that, if you use more descriptive names, then emitting output yourself will become unnecessary: The predicate name alone will make the situation perfectly clear. Let the toplevel do the printing for you!

The variable names in:


prereq(X, Y) :-
    prereqs(X, Z),
    prereq(Z, Y).


could also be improved considerably by choosing more descriptive names or abbreviations, such as Req, Course etc. For transitive relations between courses, you can for example use:

Course0 &rightarrow; Course1 &rightarrow; ... &rightarrow; Course