Subject: Pointers

From: Fraser Mathieson {Students} <[email-masked]>
Date: Tue, 7 Mar 2000 10:48:21 -0000

Hi everyone,

I am trying to write a Prolog program which consist of a train timetable, in
the form:

	train(['Stirling',849,'Glasgow',935]).
	train(['Stirling',905,'Edinburgh',958]).
	train(['Aberdeen',705,'Dundee',825,'Perth',847,'Stirling',
	919,'Glasgow',950]).
	train(['Stirling',935,'Edinburgh',1028]).

Two programs I have came across are:

1.	Displaying the next train from one town to the other.  Here, the
user must type in the 	goal:

		?- nextTrain(City,TimeNow,DepTime,NextStop).

	e.g. the next train from Stirling to Edinburgh be at 0905.

2.	Showing the next train.  Here the user must type in the goal:
	
		?- showNextTrain(City1,City2,TimeNow).

	where it show the next direct train from City1 to City2.  Also
showing the departure 
	time and place, and arrival time and place.  Also the predicate
should not fail, and 	the train doesn't need to originate at the first
city, nor terminate at the second.

Could anyone out there give me some hints.

Cheers

Fraser Mathieson