Question
Prolog Travel Assignment help In Prolog, given the set of facts: byCar(auckland,hamilton). byCar(hamilton,raglan). byCar(valmont,saarbruecken). byCar(valmont,metz). byTrain(metz,frankfurt). byTrain(saarbruecken,frankfurt). byTrain(metz,paris). byTrain(saarbruecken,paris). byPlane(frankfurt,bangkok). byPlane(frankfurt,singapore). byPlane(paris,losAngeles). byPlane(bangkok,auckland). byPlane(losAngeles,auckland). A.)
Prolog Travel Assignment help
In Prolog, given the set of facts:
byCar(auckland,hamilton). byCar(hamilton,raglan). byCar(valmont,saarbruecken). byCar(valmont,metz).
byTrain(metz,frankfurt). byTrain(saarbruecken,frankfurt). byTrain(metz,paris). byTrain(saarbruecken,paris).
byPlane(frankfurt,bangkok). byPlane(frankfurt,singapore). byPlane(paris,losAngeles). byPlane(bangkok,auckland). byPlane(losAngeles,auckland).
A.) Write a set of rules to determine if:
- Travel is possible between two cities by car
- Travel is possible between two cities by train
- Travel is possible between any two cities by plane
- Travel is possible between any two cities using plane and/or train, but not by car
- Travel is possible between two cities by any method
B.) Create a second set of rules that include the distance between each town by that method of travel. Then create a new set of rules for 1 thru 5 above that return the total distance traveled.
C.) Finally, create one rule that determines if it is possible to travel between two cities by any method, and for each route, it returns the total travel by each method. For example, If traveling from City A to City B, you would travel 1000 miles. 160 by car, 500 by plane and 340 by train.
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