⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fig15_6.pl

📁 超多的prolog源代码 具体内容见压缩包里面的programs.txt
💻 PL
字号:
%  Figure 15.6   A backward chaining interpreter for if-then rules.


% A simple backward chaining rule interpreter

:-  op( 800, fx, if).
:-  op( 700, xfx, then).
:-  op( 300, xfy, or).
:-  op( 200, xfy, and).

is_true( P)  :-
   fact( P).

is_true( P)  :-
   if Condition then P,        % A relevant rule   
   is_true( Condition).        % whose condition is true 

is_true( P1 and P2)  :-
   is_true( P1),
   is_true( P2).

is_true( P1 or P2)  :-
   is_true( P1)
   ;
   is_true( P2).

⌨️ 快捷键说明

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