
expensive(house).
expensive(car).

likes(john, X) :- expensive(X).

likes(X, mary).
likes(ed, Y).
likes(mary, Y) :- likes(Y, john).