fork download
  1. :- set_prolog_flag(verbose,silent).
  2. :- prompt(_, '').
  3. :- use_module(library(readutil)).
  4.  
  5. main:-
  6. process,
  7.  
  8. process:-
  9. % 商品データ
  10. product(item1, 3000, 4.8, 20).
  11. product(item2, 1800, 4.2, 200).
  12. product(item3, 5000, 4.9, 5).
  13. product(item4, 2500, 4.5, 80).
  14.  
  15. % 条件検索ルール: 評価が4.5以上、かつ価格が3000以下の商品を抽出する
  16. recommended_product(Name, Price, Rating, Reviews) :-
  17. product(Name, Price, Rating, Reviews),
  18. Rating >= 4.5,
  19. Price =< 3000. /* your code goes here */
  20.  
  21. :- main.
Success #stdin #stdout #stderr 0.04s 7160KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
ERROR: /home/6PofOj/prog:21:
	No permission to modify static procedure `true/0'
Warning: /home/6PofOj/prog:23:
	Goal (directive) failed: user:main
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit