I am a new learner for prolog. Here is the question of our workshop, I have no idea where start it. Would really appreciate any help with this.
sublist(Xs, Ys)
This holds when Xs is a list containing some of the elements of Ys, in the same order they appear in the list Ys. This should work whenever Ys is a proper list. For example:
sublist([a,c,e],[a,b,c,d,e]) should succeed.
sublist([a,e,c],[a,b,c,d,e]) should fail.
sublist([a,X,d],[a,b,c,d,e]) should have the two solutions X=b and X=c.
sublist(X,[a,b,c]) should have the eight solutions X=[]; X=[c]; X=[b]; X=[b,c]; X=[a]; X=[a,c]; X=[a,b]; and X=[a,b,c].