What problem can occur when we use append with cut operator?
append2([],L,L):-!. append2([H|T],L,[H|TL]):-append2(T,L,TL).
I have tri
It won't work when the first two arguments are variable:
?- append(X, Y, [1, 2, 3]). X = [], Y = [1, 2, 3] ; X = [1], Y = [2, 3] ; X = [1, 2], Y = [3] ; X = [1, 2, 3], Y = [] ; false. ?- append2(X, Y, [1, 2, 3]). X = [], Y = [1, 2, 3].