/* This looks like a reasonable attempt at solving the problem... */
reachable(X,Y) :- reachable(X,Z), borders(Z,Y).
reachable(X,Y) :- borders(X,Y).
borders(pa, md).
borders(md,va).
