

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


Programming Assignment # Basic Travel Agent in Prolog Due: Tuesday, November 20, 2001
connection(From, To, Departure, Price, Duration, ListOfFlights).
cancelled(FlightNr).
rescheduled(FlightNr,NewDeparture, NewDuration).
airport_closed(City, FromTime, ToTime).
la
dallas
denver
chicago
newYork
co145, 6am, $150, 4 hours
aa12, 2pm, $250, 2 hours
de111, 9pm, $200, 2 hours
aa45,3pm $150, 2 hours nw145, 8pm, $350, 6 hours
de333, 7pm, $450, 5 hours
co156, 10am, aa555, 8am, $150, 3 hours $250, 4 hours
aa123, 10am, $250, 3 hours
cancelled(de66).
rescheduled(aa125, 12, 7). rescheduled(aa34, 17, 2).
airport_closed(newYork, 8, 12).
?- connection(la,newYork, Departure, Price, Duration, FlightNrs).
Departure = 12 Price = 510 Duration = 9 FlightNrs = [aa125|co24|de234] ;
Departure = 9 Price = 410 Duration = 14 FlightNrs = [co244|co24|aa23] ;
No more connections available.