Welcome to W3Courses
 Like Us on Facebook

Appends Two Lists using Prolog Source Code

The following code appends two lists

CODE
append([],Y,Y).
append([X|T],Y,[X|R]) :- append(X,Y,R).

RESULT
?- append([a],[b,c],R).
R = [a, b, c]
Yes
 

Share