CSc 8710 Deductive Databases and Logic Programming
Fall 2002
Programming Assignment #4
October 17, 2002 (Thursday)

Consider the following Datalog query:

  trip(L,S,E) :- leg(L,S,E).
  trip(L,S,E) :- leg(L,S,I), trip(L,I,E). 
  trip(L,S,E) :- interchange(I,L,M), trip(L,S,I), trip(M,I,E).

  query(X) :- trip(blue,suwanee,X).
where the base predicates are defined as follows: