From i960242@dei.isep.ipp.pt  Mon Dec 18 16:45:19 2000
Received: from groucho.dei.isep.ipp.pt (root@groucho.dei.isep.ipp.pt [193.136.62.4])
	by swi.psy.uva.nl (8.9.3/8.9.3) with ESMTP id QAA18789
	for <prolog@swi.psy.uva.nl>; Mon, 18 Dec 2000 16:45:08 +0100 (MET)
Received: from pci1a2 (pci1a2.dei.isep.ipp.pt [193.136.62.96])
	by groucho.dei.isep.ipp.pt (8.9.1a/DEINET-1.1) with SMTP id PAA25610
	for <prolog@swi.psy.uva.nl>; Mon, 18 Dec 2000 15:45:53 GMT
Message-Id: <SAK.2000.12.18.fjsmbsln@pci1a2>
Date: Mon, 18 Dec 2000 15:45:26 GMT
X-Priority: 3
From: Nuno Baptista <i960242@dei.isep.ipp.pt>
X-Mailer: Mail Warrior
To: prolog@swi.psy.uva.nl
MIME-Version: 1.0
Content-Type: Text/Plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8Bit
X-Mailer-Version: v3.57
Subject: [SWIPL] Prolog help

I've already found a way to intersect lists. If anyone wants to use here it is.
lista([],S,[]). 
lista(S,[],[]):-
	S\=[]. 
lista([X|TX],[X|TY],[X|TZ]):- 
	lista(TX,TY,TZ). 
lista([X|TX],[Y|TY],TZ):- 
	lista(TX,[Y|TY],TZ). 
lista([X|TX],[Y|TY],TZ):- 
	lista([X|TX],TY,TZ). 


But i need help on something else:
I'm trying to find a way to get the the names of the places where a bus goes to, here it is the code i have write 
now. I could use a litle help. Thanks.

ligacao has a origin and a list of destinies : like (ligacao('Pr. Liberdade',['Serra Pilar','S. Domingos','Carmo','Av. 
Aliados']).)

autocarro has the numbers of the bus that has a stop in some place : 
	autocarro('Pr.Liberdade',[1,7,91,33,83,15,19,76,54]).

the rest of the code is here, but it's not working properly:

percurso(Destino,Destino,[]).
percurso(Origem,Destino,Lista):-
	autocarro(Origem,LA1),
	ligacao(Origem,LO),
	member(NO,LO),
	autocarro(NO,LA2),
	lista(LA1,LA2,L),
	percurso(NO,Destino,L).

Herege doesn't suffer from insanity. He enjoys every minute of it.
                                       
                                   *****HEREGE*****


