appends on list to another
INCLUDE 'prolib' append(List1,List2,ResultList)
append(List1,List2,ResultList) (i,i,o) (i,o,i) (o,i,i) (o,o,i)
voidlist(List1) (x) first list of any type
voidlist(List2) (x) second list of any type
voidlist(Result) (x) combined list of the first and second lists elements
Succeeds if the arguments can be match so that ResultList is the concatenation of
List1 and List2.
Its definition is:
PREDICATE append(voidlist,voidlist,voidlist). append([],X,X). append([H|T],List,[H|Sum]):- append(T,List,Sum).
append(L1,L2,X), write(L1,L2),nl, fail.
fails if arguments cannot be matched. No runtime errors
prolog-process, client-server, object