22.19 Being involved with: Question
Exercise: Being involved with
In defining the 'jealous/2' predicate, we assumed that we had a predicate called 'involved_with(X,Y)' which told us whether X was involved with Y. We now need to formalize what 'being involved with' means.
The important thing is that if X is involved with Y, then it is also true that Y is involved with X. That is, the relation is "commutative" (as the mathematicians would say).
Assume that you have a predicate 'involved/2' which tells us whether X and Y are involved. The significant part about this predicate is that it does not list relationships twice. That is, it only tells us that X and Y are involved, not that Y and X are involved.
Write a predicate 'involved_with(X,Y)' which codifies the fact that X is involved with Y either if involved(X,Y) is true, or if involved(Y,X) is true.
Click to see an answer.
Up: 22 A Murder Mystery