Question: QUESTIONS 1. (40 points) Write in the Racket programming language a function to compute a list that consists of all elements of the given list

 QUESTIONS 1. (40 points) Write in the Racket programming language a

QUESTIONS 1. (40 points) Write in the Racket programming language a function to compute a list that consists of all elements of the given list for which the given condition is true. All functions except (car, cdr, cons, define, if, cond, else, null?,>,, +, must be defined ;For example the pos and neg functions are the given conditions. (define (pos x) x 0) (define (neg x) x0) Test Example Welcome to DrRacket, version 7.0 [3m]. Language: racket, with debugging; memory limit: 128 MB >(fpos ' 2-345-6) (1 245) > (f neg 2-345-6)) 2. (30 points) Give to the predicate "p" a self-explain name. p(l I P(L] p( [H | T]) :-a(M, [ T), p(M). a(I 1, L, L). a(HT], B, [H C)-a(T, B, C). Hint The self-explain names for the predicate "a" are "append" or "concatenation The self-explain names are not "f","g", "h", etc. The "not well known" names such as "Operation-Manhattan" have to be additionally explained 3. (30 points)

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!