Solving a sample query
The vegetable database:
/* 1  */ color(banana, yellow).
/* 2  */ color(squash, yellow).
/* 3  */ color(apple, green).
/* 4  */ color(peas, green).
/* 5  */ color(broccoli, green).
/* 6  */ fruit(banana).
/* 7  */ fruit(apple).
/* 8  */ vegetable(squash).
/* 9  */ vegetable(peas).
/* 10 */ vegetable(broccoli).

/* 11 */ eats(bob, X) :- color(X, green), vegetable(X).

And a query: eats(bob, Y).



Last modified on