HSG |
|
umgedreht([],[]). umgedreht(L1,L2):-L1=[K1|R1],umgedreht(R1,R2),append(R2,[K1],L2).
?- append(L1,[E|L2],[a,b,c,d]). L1 = [] E = a L2 = [b, c, d] ; L1 = [a] E = b L2 = [c, d] ; L1 = [a, b] E = c L2 = [d] ; L1 = [a, b, c] E = d L2 = [] ; No ?-