I want to define a function in Prolog, which is able to compare two lists and if it is a sublist of the second list than give true as output.
My solution is this:
foo1(,[RL2]). foo1(,). foo1([E|RL], [E2|RL2]) :- E = E2 -> foo1(RL,RL2); foo1([E|RL],RL2), foo1(,[RL2]).
The Problem is, that I need true if it is  or if there is a restlist.
Because if it is foo1([1,2],[1,2,3]). //it should be true
and if foo1([1,2],[1,2]). //it should be also true
But in my case it is true or false. Please help, there must be an easy solution.