fig15_9.pl

来自「超多的prolog源代码 具体内容见压缩包里面的programs.txt」· PL 代码 · 共 24 行

PL
24
字号
% Figure 15.9  An interpreter for rules with certainties.

% Rule interpreter with certainties

% certainty( Proposition, Certainty)

certainty( P, Cert)  :-
   given( P, Cert).

certainty( Cond1 and Cond2, Cert)  :-
   certainty( Cond1, Cert1),
   certainty( Cond2, Cert2),
   min( Cert1, Cert2, Cert).

certainty( Cond1 or Cond2, Cert)  :-
   certainty( Cond1, Cert1),
   certainty( Cond2, Cert2),
   max( Cert1, Cert2, Cert).

certainty( P, Cert)  :-
   if Cond then P : C1,
   certainty( Cond, C2),
   Cert is C1 * C2.

⌨️ 快捷键说明

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