14 lines
375 B
Perl
14 lines
375 B
Perl
|
%% 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).
|