22.21 Relationships: Question

Exercise: Relationships

In defining the predicate 'involved_with/2', we assumed that we had a predicate 'involved/2', which told us whether X and Y were involved with each other. The important thing about this relation is that it only lists relationships once. That is, for example, it does not say both that Anna and Ben are involved, and that Ben and Anna are involved. The involved_with predicate has already taken care of this aspect of being involved.

Go through the text and find out who has a relationship with whom. Write this down in a number of Prolog facts.


Click to see an answer.

Prev: Being involved with
Up: 22 A Murder Mystery
Next: The murderer