cui.pro

来自「prolog,人工智能推理程序,运行环境prolog」· PRO 代码 · 共 30 行

PRO
30
字号
/*       resort knowledge base  */
 domains
      data_list = data_type*
      data_type = is(sb,sb);
                  has(sb,sb);
                  is_on(sb,sb);
                  is_in(sb,sb);
                  is_by(sb,sb);
                  cost(sb,sb);
                  needs(sb,sb)
 predicates
       rule(integer,date_type,data_list)
       question(integer,data_type)
 clauses
       rule(1,has(X,bad_location),[is_on(X,busy_street)]).
       rule(2,has(X,good_location),[is_by(X,ocean)]).
       rule(2,has(X,good_location),[is_in(X,mountains)]).
       rule(3,is(X,unsatisfactory),[has(X,bad_location),has(X,poor_service)]).
       rule(3,is(X,unsatisfactory),[has(X,dirty_rooms)]).
       rule(4,is(X,nice),[has(X,good_location),has(X,clean_rooms)]).
       rule(5,is(X,expensity),[cost(X,over_100)]).
       rule(6,is(X,inexpensive),[cost(X,under_30)]).
       rule(7,is(X,fancy),[has(X,pool),has(X,entertainment),has(X,marble_floors)]).
       rule(8,is(X,one_star),[is(X,unsatistactory),has(X,bugs),needs(X,repair)]).
       rule(9,is(X,two_star),[is(X,nice),has(X pool),has(X,good_service)]).
       rule(9,is(X,two_star),[is(X,inexpensive),has(X,clean_room)]).
       rule(10,is(X,three_star),[is(X,two_star),has(X,good_restaurant)]).
       rule(10,is(X,three_star),[has(X,good_location),has(X,entertainment)]).
       rule(11,is(X,four_star),[is(X,fancy),has(x,great_service)])
       rule(11,is(X,four_star),[is(X,expensive),hsa(X,view),has(X,good_service)]).

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?