Reference no: EM13333373
Write a Prolog relation subsequence(L1,L2) that is true if list L1 contains a subset of the elements of L2 in the same order.
How many different proofs are there for each of the following queries?
ask subsequence([a,d],[b,a,d,a]).
ask subsequence([b,a],[b,a,d,a]).
ask subsequence([X,Y],[b,a,d,a]).
ask subsequence(S,[b,a,d,a]).
Explain why there are that many.
1. Write a Prolog relation that returns a list containing the union of the elements of two given lists.
2. Write another relation (anything you want) that does something not performed above. Explain what your relation does.