Question: Write a Prolog program with the following knowledge base: directTrain(union-station, san-bernardino). directTrain(oxnard, union-station). directTrain(burbank, lancaster). directTrain(lancaster, union-station). directTrain(san-bernardino, riverside). directTrain(santa-ana, burbank). directTrain(oceanside, santa-ana). This knowledge

Write a Prolog program with the following knowledge base:

directTrain(union-station, san-bernardino). directTrain(oxnard, union-station). directTrain(burbank, lancaster). directTrain(lancaster, union-station). directTrain(san-bernardino, riverside). directTrain(santa-ana, burbank). directTrain(oceanside, santa-ana).

This knowledge base holds facts about towns you can travel between by taking a direct train, e.g., from union station to san bernardino.

Write a Prolog recursive predicate travelBetween that tells us when we can travel by train between two towns (not necessarily by a single direct train).

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!