PPT Slide
Using =.. To Construct Dynamic Calls
mother(linda, sylvia) . father(linda, aaron) .
answer_questions :- write('mother or father?') , read(X) , write('of whom?') , read(Y) , Q =.. [X, Y, Who] , call(Q) , write(Who) , nl .
1 ?- answer_question. mother or father? mother . of whom? linda . sylvia Yes
2 ?- answer_question. mother or father? father . of whom? linda. aaron Yes