predicates
can_buy(symbol, symbol)
person(symbol)
car(symbol)
likes(symbol, symbol)
for_sale(symbol)
clauses
can_buy(X, Y) :-
person(X),
car(Y),
likes(X, Y),
for_sale(Y).
person(kelly).
person(judy).
car(mercedes).
car(benz).
likes(kelly, benz).
likes(judy, pizza).
for_sale(pizza).
for_sale(mercedes).
for_sale(benz).