?? fig11_7.pl
字號:
% Figure 11.7 A depth-first search program that avoids cycling.
% solve( Node, Solution):
% Solution is an acyclic path (in reverse order) between Node and a goal
solve( Node, Solution) :-
depthfirst( [], Node, Solution).
% depthfirst( Path, Node, Solution):
% extending the path [Node | Path] to a goal gives Solution
depthfirst( Path, Node, [Node | Path] ) :-
goal( Node).
depthfirst( Path, Node, Sol) :-
s( Node, Node1),
not member( Node1, Path), % Prevent a cycle
depthfirst( [Node | Path], Node1, Sol).
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -