Question: A variant of the above program for sublist is defined by the following three rules: subsequence([XIXs] , [XIYs]) - subsequence(Xs,Ys). subsequence(Xs, [Y lYs]) - subsequence(Xs,Ys).

A variant of the above program for sublist is defined by the following three rules:
subsequence([XIXs] , [XIYs]) - subsequence(Xs,Ys).
subsequence(Xs, [Y lYs]) - subsequence(Xs,Ys).
subsequence([ ] ,Ys).
Explain why this prolog program has a different meaning from the above picture.
append(Xs, YsXsYs) XsYs is the result of concatenating the lists Xs and Ys. append([ ],Ys, Ys). append( [X/Xs), Ys, [XZs]) append(X,Y,Zs)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
