Unformatted text preview:

Programming Languages Fall of 2001Programming Assignment #1 Basic Travel Agent in Prolog Due: Tuesday, November 20, 2001Programming LanguagesFall of 2001Programming Assignment #1Basic Travel Agent in PrologDue: Tuesday, November 20, 2001Available flights:Query:connection(From, To, Departure, Price, Duration, ListOfFlights).Testing data: (provided by me during testing - do not include in the submitted file!)cancelled(FlightNr).rescheduled(FlightNr,NewDeparture, NewDuration).airport_closed(City, FromTime, ToTime).Additional information:- All times are in full hours using the 24 hour clock.aa123, 10am, $250, 3 hoursladallasdenverchicagonewYorkco145, 6am, $150, 4 hoursaa12, 2pm, $250, 2 hoursde111, 9pm, $200, 2 hoursaa45,3pm $150,2 hoursnw145, 8pm, $350, 6 hoursde333, 7pm, $450, 5 hoursco156, 10am, $150, 3 hoursaa555, 8am, $250, 4 hours- No connection should last more than 24 hours.- There must be at least one hour of waiting time between connecting flights.- If the airport is closed during some hours than no flight can depart or land duringthose hours. All such flights are therefore effectively cancelled.- Do not use negation in your premises. Use "!, fail" if necesary.- Make sure to preserve the exact names and lists of arguments in the query and test data predicates.- Make sure to preserve the exact names of the airports and flight numbers. Examples of test data:cancelled(de66).rescheduled(aa125, 12, 7).rescheduled(aa34, 17, 2).airport_closed(newYork, 8, 12).Sample program run (not using the above data):?- connection(la,newYork, Departure, Price, Duration, FlightNrs).Departure = 12Price = 510Duration = 9FlightNrs = [aa125|co24|de234] ;Departure = 9Price = 410Duration = 14FlightNrs = [co244|co24|aa23] ;No more connections available.Good


View Full Document

UCR CS 181 - Programming Languages

Documents in this Course
Lecture

Lecture

220 pages

Load more
Download Programming Languages
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Programming Languages and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Programming Languages 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?