Lab 5 Discuss the solution to Assignment 1 ----------------------------- More List operations ------------------ 1. Add element at the end of a list. ?-add_last(a, [1,b,c],L). L= [1,b,c,a]. yes 2. Add one to all the numbers in a list ?- add_one([1,3,5],L). L = [2, 4, 6] ?- add_one([1,a, 3, b, c, 5],L). L = [2, a, 4, b, c, 6] 3. Add one to the first number in a list ?- add_one_first([a, 1,2,3],L). L = [a, 2, 2, 3] ?- add_one_first([a, b, 2, c, 5],L). L = [a, b, 3, c, 5] 4. Member predicate that looks for an element at any level in a nested list. ?-nested_member(a, [b, c, [d, [a, e]]]). yes 5. Delete element from nested list, any level. ?-del(a, [a, b, [c, a, [a]], d, a], L). L = [b, [c, []], d] yes 6. Count element occurrences, all levels in nested list. countAll(L,E,N) holds if the list L contains E N times on any level. Precondition: L and E are instantiated. L is a possibly nested list. ?- countAll([1,2,1,[2,[1]],3],1,N). N = 3 ; No ?- countAll([1,2,1,[2,[1]],3],1,3). Yes ?- countAll([1,2,1,[2,[1]],3],1,2). No