Just started reading a book about AI. There is a very basic exercise but I can't figure it out, so here we go. The book is Simply Logical: Intelligent Reasoning by Example
The exercise is in the page 19.
Two stations are ‘not too far’ if they are on the same or a different line, with at most one station in between. Define rules for the predicate not_too_far.
The only rules I've seen are nearby and connected and don't know how to use this. What I've done so far is this:
not_too_far(X,Y) :- nearby(X,Y)