[Pts 4] Consider the following definition of
the mother and of the ancestor predicates:
mother(a,b). /* a is mother of b */
mother(a,c). /* a is mother of c */
mother(c,d). /* c is mother of d */
mother(d,e). /* d is mother of e */
ancestor(X,Y) :- mother(X,Y).
ancestor(X,Y) :- mother(X,Z), ancestor(Z,Y).
For each of the following queries, please indicate all the answers that are returned (assuming that we interactively keep asking for more answers). If no answers are returned, write "no". If the query generates an error, write "error".
- ?- mother(X,a). no
- ?- mother(a,Y). Y = b ; Y = c
- ?- ancestor(a,Y). Y = b ; Y = c ;
Y = d ; Y = e
- ?- ancestor(X,b), ancestor(X,d). X = a ;