Question: A Write a predicate myAppend(Ll, L2, L3) to append 2 lists (order is important, you may not use the built in append). E.g., ? -

 A Write a predicate myAppend(Ll, L2, L3) to append 2 lists

A Write a predicate myAppend(Ll, L2, L3) to append 2 lists (order is important, you may not use the built in append). E.g., ? - myAppend ([a, b], [c, d], L). L = [a, b, c, d]. b. Using your definition of myAppend, write a predicate myFirst(X, L) that is true if X is the first item in L. c. Rewrite the predicate myLast(X, L) from the previous question using append. d. Rewrite the predicate next to(X, Y, L) from the previous question using append. e. Write a recursive predicate myReverse(Ll, L2) that succeeds when the result of reversing the elements of list L1 is the list L2. Your answer should use append, and may not make use of the built in reverse predicate. A Write a predicate myAppend(Ll, L2, L3) to append 2 lists (order is important, you may not use the built in append). E.g., ? - myAppend ([a, b], [c, d], L). L = [a, b, c, d]. b. Using your definition of myAppend, write a predicate myFirst(X, L) that is true if X is the first item in L. c. Rewrite the predicate myLast(X, L) from the previous question using append. d. Rewrite the predicate next to(X, Y, L) from the previous question using append. e. Write a recursive predicate myReverse(Ll, L2) that succeeds when the result of reversing the elements of list L1 is the list L2. Your answer should use append, and may not make use of the built in reverse predicate

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!