edge('a','b')<-
edge('a','c')<-
edge('b','a')<-
edge('b','d')<-

path1(X,Y) <- edge(X,Y)
path1(X,Y) <- path1(X,Z) and edge(Z,Y)

path2(X,Y) <- edge(X,Y)
path2(X,Y) <- edge(X,Z) and path2(Z,Y)

answer(a,b)<-path1(a,b)