Here the two list are taken by the predicate “append” and returns the appended list. To append two list a list is broken continuously until the last empty list is encountered and finally the other list is appended or joined at the end of first recursively. The code to append is given as follows:
int_list = integer*
append(int_list, int_list, int_list)
append([H|L1], L2, [H|L3]):-append(L1,L2,L3).