Why after pressing semicolon program is back in deep recursion?
问题 I'm trying to understand the semicolon functionality. I have this code: del(X,[X|Rest],Rest). del(X,[Y|Tail],[Y|Rest]) :- del(X,Tail,Rest). permutation([],[]). permutation(L,[X|P]) :- del(X,L,L1), permutation(L1,P). It's the simple predicate to show all permutations of given list. I used the built-in graphical debugger in SWI-Prolog because I wanted to understand how it works and I understand for the first case which returns the list given in argument. Here is the diagram which I made for