fork download
  1. product(item1,3000,4.8,20).
  2. product(item2,1800,4.2,200).
  3. product(item3,5000,4.9,5).
  4. product(item4,2500,4.5,80).
  5.  
  6. high_rating(Item) :-
  7. product(Item, _, Rating, _),
  8. Rating >= 4.5.
  9.  
  10. affordable(Item) :-
  11. product(Item, Price, _, _),
  12. Price =< 3000.
  13.  
  14. popular(Item) :-
  15. product(Item, _, _, Reviews),
  16. Reviews >= 50.
  17.  
  18. recommended(Item) :-
  19. high_rating(Item),
  20. affordable(Item),
  21. popular(Item).
Success #stdin #stdout #stderr 0.03s 6992KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit