I have the rule...
brother(X,Y):-(parent(Z,X),parent(Z,Y)),X\==Y,male(X).
But the problem is that it returns duplicates.
So if john has a brother joe, it will say john has two brothers named joe.
because it checks that they share a father and returns joe, and checks that they have the same mother and returns joe.
But of course I want it to work if they only have one parent in common as well.
Can anyone suggest me in the right direction?
Thanks.

New Topic/Question
Reply




MultiQuote





|