-


- - . 27


in_depth(Path,Node,[Node|Path]) :- goal(Node).
in_depth(Path,Node,Solution) :- after(Node,Node1), not(member(Node1,Path)),
in_depth([Node|Path],Node1,Solution).
, ,
, . .
. , "" ,
.
,
. :
in_depth2(Node,Solution,MaxDepth).
, MaxDepth.

in_depth2 , . :
in_depth2(Node,[Node],_) :- goal(Node).
in_depth2(Node,[Node|Solution],MaxDepth) :-
MaxDepth > 0, after(Node,Node1),
Max1=MaxDepth - 1, in_depth2(Node1,Solution,Max1).
, , - .
2. .
 
domains
s=symbol
list=s*
l2=list*
l3=l2*
predicates
tgoal(l2)
delete(list,l2,l2)
member(l2,l3)
after(l2,l2)
solve(l2,l3)
in_depth(l3,l2,l3)
write_list(l3)
clauses
tgoal([[a,b,c],[],[]]). /* */
tgoal([[],[a,b,c],[]]). tgoal([[],[],[a,b,c]]).
after(Stolbs,[Stolb1,[Up1|Stolb2]|Rest]):-



- -  - -  - -