I have a programm in Prolog related to a family tree, where i have to find all the sibling related to an individual.
I’ve defined the rule ‘sister’ as:
sister(X,Y) :- parent(Z,X),parent(Z,Y),woman(X)
Let’s imagine ‘Jack’ has multiple sisters, Laura, Jessica and Julia. When I ask ?- sister(‘Laura’,’Jack’) Prolog answers yes. But when i ask ?- sister(X,’Jack’) it answers false instead of all the possible values of X. Any idea of whats wrong or how to fix it?
Ian Garcia Morini is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.