Question: Please answer all questions Prolog Practice. In Prolog, write predicates (functions) for each of the following: 1. isMember(X,L) 2. listLength(LX) 3.?SAsc 4. intersection(X,Y.Z). 5. union(X,y.Z

Please answer all questions
 Please answer all questions Prolog Practice. In Prolog, write predicates (functions)

Prolog Practice. In Prolog, write predicates (functions) for each of the following: 1. isMember(X,L) 2. listLength(LX) 3.?SAsc 4. intersection(X,Y.Z). 5. union(X,y.Z 6. difference(X,Y.Z) 7. mergeSort(L,R). o True if atom X is a member of list L (without using the built in member function). o X resolves to the length of list L (without using the build in length function). o predicate fails iff X is not a list of integers in increasing order. (You can ignore the possibility of duplicates). o Z resolves to the intersection of lists X and Y. o Z resolves to the union of lists X and Y o Z resolves to the set of elements in list X, excluding any elements that appear in list Y 1. R resolved to the ascended sort of list L using the merge function in the provided example from class

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!