:- import append/3 from basics.
help1(0,L,[]).
help1(_,[],[]).
help1(N,[X|Xs],[X|Res]):- N2 is N - 1, help1(N2,Xs,Res).
help2(0,L,L).
help2(N,[X|Xs],Res):- N2 is N - 1, help2(N2,Xs,Res).
help3(N,L,R):- help1(N,L,R) append help2(N,L,R).
In the following piece of code my help1 predicate will store the first N values in a list. My help2 predicate will store all the values after the first N values in a list.
Finally in my help3 function i am trying to append the results i get from help1 and help2. But i am not able to do so. Can anyone help me out or point out what mistake i have done?