Please implement the following predicates and place them all in a file called project4.prolog. Note that each problem is weighed differently based on expected difficulty. Rules: - For #5, do not rely on any built-in sorting predicates. - All of your predicates will be tested using version 8 of SWI Prolog. Your predicates must work without crashing, hanging, or infinite loops in order to receive full credit. - In order to receive credit, make sure that your predicates are named the exact same way as the assignment, and make sure that the parameters in your predicates match the exact order specified in this assignment. - You may define your own "helper" predicates if it helps with defining the predicates in this assignment. Problems 1. (10%) Given the following definition of a natural number: natural_number(0). natural_number(s(X)) :- natural_number(X). Write the predicates even/1 and odd/1, which both take a natural number as input. For example: even(0). -- evaluates to true odd(s(0)). -- evaluates to true odd(s(s(0))). -- evaluates to false 2. (10%) Write the predicate natural_length/2, where the first parameter is a list and where the second parameter is a natural number as defined in #1. For example: natural_length([], 0). -- evaluates to true natural_length([a, b, c, d, e], s(s(s(s(s(0)))))). -- evaluates to true natural_length([a, b, c], X). -- X = s(s(s(0))) 3. (20%) Write the predicate vowel_count/2, where the first parameter is a list of single character symbols (e.g., [t,h,i,s]) and the second parameter is the count of vowels that appeared. Vowels are a, e, i, o, and u. vowel_count([], 0). -- evaluates to true vowel_count([a,x,i,o,m], s(s(s(0)))). -- evaluates to true vowel_count([r,h,y,t,h,m], X) -- X = 0 4. (20%) Write the predicate flatten/2, where the first parameter is a list and the second parameter is the "flattened" version of that list (i.e., all sublists are subsumed into one main list where the ordering is preserved). For example: flatten([a,b,c], [a,b,c]). -- evaluates to true flatten([a,b,[c,d,[e]],[f]], [a, b, c, d, e, f]). -- evaluates to true flatten([a,b,[c]], X). -- X = [a,b,c] 5. (40%) Write the predicate mysort/2, where the first parameter is the list to be sorted, and the second parameter is the sorted list. The elements are integers; this will require reading ahead in the textbook in order to deal with integers. For example: mysort([3, 1, 2, 4], [1, 2, 3, 4]). -- evaluates to true mysort([9, 8, 7, 6, 5], [5, 6, 7, 8, 9]). -- evaluates to true mysort([5, 2, 6], X). -- X = [2, 5, 6]