Re: Tracing with out using trace?
- From: Markus Triska <triska@xxxxxx>
- Date: Sat, 02 Sep 2006 21:15:27 +0200
Bruce Horrocks <news@xxxxxxxxxxxxxxxxx> writes:
I want my friend to be able to specify his own rules without having
to worry about my drawing bit.
What about:
grandparent([Grandparent,Parent,Child]) :-
parent(Grandparent, Parent),
parent(Parent, Child).
Yielding:
?- grandparent(Ls).
Ls = [gramps, homer, bart] ;
and generalising the drawing bit to handle such extended relations
represented as lists? You can keep the old rule as well and use it to
draw the corresponding binary relation.
All the best,
-- Markus Triska
.
- Follow-Ups:
- Re: Tracing with out using trace?
- From: Bruce Horrocks
- Re: Tracing with out using trace?
- References:
- Tracing with out using trace?
- From: Bruce Horrocks
- Tracing with out using trace?
- Prev by Date: Re: SWI-Prolog: Undocumented predicates?
- Next by Date: comp.lang.prolog Frequently Asked Questions
- Previous by thread: Tracing with out using trace?
- Next by thread: Re: Tracing with out using trace?
- Index(es):
Relevant Pages
|