Re: siblings
- From: Tomasz Budzeń <tomasz.budzen@xxxxxxxxx>
- Date: Fri, 14 Oct 2011 05:37:11 -0700 (PDT)
Introduce any order of objects (f.e. age of persons) and include condition in your code:
older(tom, merry).
older(merry, john).
older(john, sally).
is_older(X, Y) :- older(X, Y).
is_older(X, Y) :- is_older(X2, Y), older(X2, Y).
......
sibling( X, Y ) :-
parent_child( Z, X ),
parent_child( Z, Y ),
X \= Y,
is_older(X, Y). // <- here,
// this is problem of order of (X, Y) and (Y, X)
Regards,
Tomasz Budzeń
.
- Follow-Ups:
- Re: siblings
- From: Tomasz Budzeń
- Re: siblings
- References:
- siblings
- From: Haris Bogdanovich
- Re: siblings
- From: Haris Bogdanovich
- siblings
- Prev by Date: Re: Where To Find Re-Usable Prolog Code
- Next by Date: Re: siblings
- Previous by thread: Re: siblings
- Next by thread: Re: siblings
- Index(es):
Relevant Pages
|