Re: where do I think wrong

Kilian Evang <[email protected]>
Newsgroups gmane.comp.ai.prolog.swi
Message-ID <[email protected]>
On 2014-03-17 01:24, Richard A. O'Keefe wrote:
> On 15/03/2014, at 12:03 AM, Kilian Evang wrote:
>>>> >>>    half_or_full_siblings(X, Y) :-
>>>>> >>>>        (   same_father(X, Y),
>>>>> >>>> 	    X \== Y
>>>>> >>>> 	;   same_mother(X, Y),
>>>>> >>>> 	    \+ same_father(X, Y)
>>>>> >>>> 	).
>> > 
>> > Because you don't usually want to say that a person is his or her own
>> > sibling.
>> > 
>> > What I don't understand is why the X \== Y is only in the first
>> > or-branch. IMHO it should also be in the second.
> It would be utterly pointless in the second clause.
> It is subsumed by the \+ same_father(X, Y) test;
> you certainly have the same father as yourself!

D'oh, of course. Silly me.

Kilian
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.