next up previous
Next: The ladder rule Up: No Title Previous: No Title

Lab

buy( Person, Thing) :-
   needs( Person, Thing),
   price( Thing, Price), 
   can_pay( Person, Price).
 
price(cornflakes,2). 
price(frosties,3). 
price(branflakes,2). 
price(chocolate_cake,1). 

needs(antonia, frosties).
needs(mark, branflakes).

can_pay(antonia,4). 
can_pay(mark,2).

Queries :

buy(mark,frosties)
buy(mark,_)



Omer F Rana
Thu Feb 13 19:58:14 GMT 1997