Question: Consider the following Racket term: (let ([x (f (+ x ( z a)))]) (g (f x))) Recall that a term is in ANF if

Consider the following Racket term: (let ([x (f (+ x ( z a)))]) (g (f x))) Recall that a term is in ANF if 

Consider the following Racket term: (let ([x (f (+ x ( z a)))]) (g (f x))) Recall that a term is in ANF if function calls occur only (a) with atomic arguments and (b) directly under a single let binding. Recall that a term is in CPS if every function call is a tail call (including uses of builtins such as +). For the purposes of this problem, in the CPS portion, you may assume that builtins such as + take an extra continuation argument. (a) Write a translation of the above term to A-Normal Form (ANF). (b) Write a translation of the above term to Continuation-Passing Style (CPS).

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

The image provided contains a question about converting a Racket term into ANormal Form ANF and Cont... View full answer

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 Programming Questions!