trace
domains
x = integer
l = integer*
predicates
concatenate(l,l,l)
sublist(l,l)
clauses
concatenate([],List,List).
concatenate([X|List1],List2,[X|List3]) :-
concatenate(List1,List2,List3).
sublist(SubList,List) :-
concatenate(List1,SubList,List3),
concatenate(List3,List2,List),
write(SubList," is a sublist of ",List),nl.
sublist(SubList,List) :-
write(SubList," is not a sublist of ",List),nl.
Output :
Goal: sublist([2,3,4],[1,2,3,4,5])
[2,3,4] is a sublist of
[1,2,3,4,5]
Yes