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

takesCourse(X,Y) :- &dlQS["mor/queries/lubm_query2.rq"](X,Y).
advisor(X,Y) :- &dlQS["mor/queries/lubm_query3.rq"](X,Y).
teacherOf(X,Y) :- &dlQS["mor/queries/lubm_query4.rq"](X,Y).
student(X) :- &dlQS["mor/queries/lubm_query5.rq"](X).
faculty(X) :- &dlQS["mor/queries/lubm_query6.rq"](X).
course(X) :- &dlQS["mor/queries/lubm_query7.rq"](X).
fullprof(X) :- &dlQS["mor/queries/lubm_query8.rq"](X).


