Re: Tracing with out using trace?



Markus Triska wrote:

It's easy to derive the corresponding binary relation.

That wasn't a good example by me. Suppose the relationships are son_of and daughter_of, e.g.

son_of(homer, bart).
daughter_of(homer, lisa).
daughter_of(homer, maggie).

Now suppose I try to identify siblings by rule:

sibling([P, X, Y]) :-
son_of(P, X),
son_of(P, Y),
X \== Y.

sibling([P, X, Y]) :-
daughter_of(P, X),
daughter_of(P, Y),
X \== Y.

sibling([P, X, Y]) :-
son_of(P, X),
daughter_of(P, Y).

sibling([P, X, Y]) :-
daughter_of(P, X),
son_of(P, Y).

Not very elegant, I realise, but the print procedure does not know whether to label the P-->X line on the graph with "son_of" or "daughter_of" as they could be in either order.

Again, I realise that this can be coded around but I was hoping to avoid putting such restrictions on the user created rules by being able to duplicate trace and so "know" which link is being followed.

Does this make it clearer?

Regards,
--
Bruce Horrocks
Surrey
England
<firstname>@<surname>.plus.com -- fix the obvious for email
.



Relevant Pages

  • Re: The Simpsons (DE) Missing Characters
    ... If you notice the characters of Bart, Lisa and Maggie ...
    (rec.games.pinball)
  • Review zu 8F15 "Separate Vocations"
    ... Bei "Separate Vocations" handelt es sich um ein oft übersehenes kleines Juwel aus Staffel drei; eine wunderbare Charakterstudie von Bart und Lisa, die die Persönlichkeit der beiden Geschwister genauer unter die Lupe nimmt, indem sie sie jeweils ins Gegenteil verkehrt. ... So entsteht eine self-fulfilling prophecy, und Lisas Charakter beginnt langsam, sich ins Negative, Destruktive zu kehren. ... Vom abenteuerlichen und amüsant in Szene gesetzten Trip im Polizeiauto motiviert, interessiert Bart sich plötzlich für Recht und Ordnung. ...
    (de.rec.tv.simpsons)
  • Re: Heutige 17:30-Uhr-Folge FABF19 "Sleeping With The Enemy"
    ... danach Nelson durch die Nacht schlürft. ... Bart hat erstmals bei einem Test die volle Punktzahl erreicht. ... Als Marge sich schon ganz ... Bart und Lisa, die allerdings sowieso ihre eigenen Sorgen hat, werden ...
    (de.rec.tv.simpsons)
  • Re: Review zu 7F13 "Homer vs Lisa and The Eight Commandment"
    ... wo Marge am Ende der Diskussion im Auto zu Bart entnervt ... Tip, den er Lisa gibt, würde einem Psychologen zur Ehre gereichen. ... Sein Rat an Lisa ist gut, eben weil es ein Rat ist, der frei von Dogmen ... Blablablablabla. ...
    (de.rec.tv.simpsons)
  • Heutige 18:40-Uhr-Folge JABF04 "Little Big Girl"
    ... um Sidekick Bart, ... Portman durchaus gut gesprochene Darcy hat gerade noch etwa 8 Minuten ... Der Subplot mit Lisa ist nett und interessanter, ... trotz der Schrägheit auch gerne mehr über Bart und Darcy. ...
    (de.rec.tv.simpsons)