
result(X) :- advisor(X,Y), teacherOf(Y,Z), takesCourse(X,Z), student(X), faculty(Y), course(Z), not fullprof(Y).

takesCourse(X,Y) :- mor_dlq1(X,Y).
advisor(X,Y) :- mor_dlq2(X,Y).
teacherOf(X,Y) :- mor_dlq3(X,Y).
student(X) :- mor_dlq4(X).
faculty(X) :- mor_dlq5(X).
course(X) :- mor_dlq6(X).
fullprof(X) :- mor_dlq7(X).

