This is what I have so far. I need to show that if two stations are connected via a third station, they are connected to each other
station(hamburg).
station(bremen).
station(hannover).
station(berlin).
station(leipzig).
station(osnabruck).
station(stuttgart).
station(fulda).
station(munich).
adjacent(hamburg, bremen).
adjacent(hamburg, berlin).
adjacent(berlin, hannover).
adjacent(berlin, leipzig).
adjacent(leipzig, fulda).
adjacent(fulda, hannover).
adjacent(hannover, osnabruck).
adjacent(osnabruck, bremen).
adjacent(stuttgart, munich).
/* insert your clauses here */
adjacent_(X,Y) :-adjacent(Y,X) .
adjacent_(X,Y) :-adjacent(X,Y) .
connected(X,Y) :-adjacent(X,Y) .
connected(X,Z) :-connected(X,Y), adjacent_(Y,Z) .