takes(bob,cs2).
reqs(cs2,cs1).
has_taken(A,C) :- takes(A,B), reqs(B,C).

% Sample Prolog interaction:

% ?- [students].
% true.

% ?- takes(bob,X).
% X = cs2.

% ?- takes(W,cs2).
% W = bob.

% ?- has_taken(bob,X).
% X = cs1.
