From fraser.mathieson@stir.ac.uk  Tue Mar  7 11:48:04 2000
Received: from clyde.stir.ac.uk (clyde.stir.ac.uk [139.153.13.35])
	by swi.psy.uva.nl (8.9.3/8.9.3) with ESMTP id LAA11062
	for <prolog@swi.psy.uva.nl>; Tue, 7 Mar 2000 11:48:03 +0100 (MET)
Received: from findhorn.stir.ac.uk (findhorn.stir.ac.uk [139.153.13.5])
          by clyde.stir.ac.uk (8.8.8/8.8.4) with ESMTP
	  id KAA15983 for <prolog@swi.psy.uva.nl>; Tue, 7 Mar 2000 10:46:57 GMT
Received: by findhorn.stir.ac.uk with Internet Mail Service (5.5.2650.21)
	id <F7F9JV06>; Tue, 7 Mar 2000 10:48:23 -0000
Message-ID: <0B17AD22BF66D1119981006097BCB3A3032364CE@findhorn.stir.ac.uk>
From: Fraser Mathieson {Students} <fraser.mathieson@stir.ac.uk>
To: "'prolog@swi.psy.uva.nl'" <prolog@swi.psy.uva.nl>
Subject: Pointers
Date: Tue, 7 Mar 2000 10:48:21 -0000 
Return-Receipt-To: Fraser Mathieson {Students}
	 <fraser.mathieson@findhorn.stir.ac.uk>
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2650.21)
Content-Type: text/plain

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


