11.1. depthf irstl ([Node I PathJ, [Node I Path]):-goal(Node). depthfirstK [Node I Path], Solution):-s[ Node, Nodel), not member] Nodel, Path), depthfitstll [Nodel, Node I Path], Solution).
113 * ,
% , % iterative_deepening(Start, Solution):-
id_path[ Start, Mode, [], Solution),
goal[ Node). i path[ First, Last, Path): Path % First Last path[ First, First, [First]). path(First, Last, [First, Second I Rest]):-
s(First, Second),
path[ Second, Last, [Second I Rest]). % % idj>ath(Fir3t, Last, Template, Path): Path % First Last, h i Template. % id_path(First, Last, Template, Path):-
Path - Template,
path! First, Last, Path)
copy_term(Template, P),
path(First, _, P),!, % % , Template idjpathf First, Last, [_ I Template], Path). % 4 , Template
11.6. - 15 ; - 26 .
N(b, 0) = 1
N(b, d) = { b, d - 1) + (b" + 1 - l)/(b - 1) d > 0
11.8. solve! StartSet, Solution):- £ StartSet -
% bagof((Node), member! Mode, StartSet), CandidatePaths), breadthfirst[ CandidatePaths, Solution),
11.9. , -
, . , .
% , origs(Model, Node2) - i $ s : s{ Nodel, Node2):-origs(Node2, Nodel).
11.10. %
% StartNode-EndNode
% ,
s(Start - End, NewStart - NewEnd) :-
origs{ Start, MewStart), % origs (NewEnd, End)..* % goal(Start - End)
goal! Start - Start). h
goal(Start - End):-
origs(Start, End). %
It. 11. find l - ; f i n d 2 - ( cone (Path, _,_)
, f i n d l ); f i n d 3 - .
11.12. .