14 lines
375 B
Prolog
14 lines
375 B
Prolog
%% Given facts.
|
|
directTrain(saarbruecken,dudweiler).
|
|
directTrain(forbach,saarbruecken).
|
|
directTrain(freyming,forbach).
|
|
directTrain(stAvold,freyming).
|
|
directTrain(fahlquemont,stAvold).
|
|
directTrain(metz,fahlquemont).
|
|
directTrain(nancy,metz).
|
|
|
|
%% Rules.
|
|
travelFromTo(X, Y) :- directTrain(X, Y).
|
|
travelFromTo(X, Y) :- directTrain(X, Z),
|
|
travelFromTo(Z, Y).
|