Answered step by step
Verified Expert Solution
Question
1 Approved Answer
We are given the following PROLOG knowledge base of travel information: by_Car(miami,orlando). by_Car(orlando,tampa). by_Car(philadelphia,washington_dc). by_Car(philadelphia,new_york). by_Train(new_york,atlanta). by_Train(washington_dc,atlanta). by_Train(new_york,montreal). by_Train(washington_dc,montreal). by_Plane(atlanta,bangkok). by_Plane(atlanta,singapore). by_Plane(montreal,losAngeles). by_Plane(bangkok,miami). by_Plane(losAngeles,miami). Write
We are given the following PROLOG knowledge base of travel information:
by_Car(miami,orlando). by_Car(orlando,tampa). by_Car(philadelphia,washington_dc). by_Car(philadelphia,new_york).
by_Train(new_york,atlanta). by_Train(washington_dc,atlanta). by_Train(new_york,montreal). by_Train(washington_dc,montreal).
by_Plane(atlanta,bangkok). by_Plane(atlanta,singapore). by_Plane(montreal,losAngeles). by_Plane(bangkok,miami). by_Plane(losAngeles,miami).
Write a predicate travel/2 which determines whether it is possible to travel from one place
to another by 'chaining together' car, train, and plane journeys. For example, your program
should answer yes to the query travel(philadelphia,tampa).
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started