Homework 3. ============== 1. Write a predicate that accepts a list and succeeds if that list has exactly three elements. ============= 2. Write a predicate that accepts a list and generates from it a similar list with the first two elements swapped. It should work like this: ?-swap_first_two([a,b,c,d], [b,a,c,d]). Yes ?-swap_first_two([a,b,c,d], X). X= [b,a,c,d]; No ?-swap_first_two(X, [b,a,c,d]). X=[a,b,c,d]; No ?-swap_first_two([a,b,c,d], [b,a,d,c]). No ?-swap_first_two([a,b,c,d], [X,Y,c,d]). X=b Y=a; No ==================== 3. Exercise 3.1 from the book: You have the program: aless(X,Y):-name(X,L), name(Y,M),alessx(L,M). alessx([],[_|_]). alessx([X|_],[Y|_]):-X