% append1(L, M, N) is true iff list N is list M appended to list L.
% If append is not built into your program, consider renaming this append.

append1([], M, M).

append1([A | L], M, [A | N]) :- append1(L, M, N).

/* Example:

| ?- append1([1, 2, 3], [4, 5], N).

N = [1,2,3,4,5] 

| ?- append1(L, [4, 5], [1, 2, 3, 4, 5]).

L = [1,2,3] 

| ?- append1(L, M, [1, 2, 3, 4, 5]).

L = [],
M = [1,2,3,4,5] ;

L = [1],
M = [2,3,4,5] ;

L = [1,2],
M = [3,4,5] ;

L = [1,2,3],
M = [4,5] ;

L = [1,2,3,4],
M = [5] ;

L = [1,2,3,4,5],
M = [] ;

no
*/
