Question: The current K LAMBDA semantics of mu ( in Lesson 8 ) is based on substitution, and then letrec is defined as a derived operation
The current K LAMBDA semantics of mu in Lesson is based on substitution, and then letrec is defined as a derived operation using mu Give mu a different semantics, as a derived construct by translation into other LAMBDA constructs, like we defined letrec in Lesson To test it use the same definition of letrec in terms of mu from Lesson and write recursive programs, like the provided factorialletrec.lambda. Note: See the muderived exercise in the nightly built for details and test programs. Exercise points: Modify the K definition of IMP to not automatically initialize variables to Instead, declared variables should stay uninitialized until assigned a value, and the execution should get stuck when an uninitialized variable is looked up Note: See the uninitializedvariables exercise in the nightly built for details and test programs. Exercise points: Mofify IMP so that the K followed by arrow, ~ does not explicitly occur in the definition it currently occurs in the semantics of sequential composition Hint: make sequential composition strict or seqstrict, and have statements reduce to instead of and dont forget to make a KResult you may need a new syntactic category for that, which only includes and is included in KResult Note: See the purelysyntactic exercise in the nightly built for details and test programs. Exercise points: Define a variant of callcc, say callCC, which never returns to the current continuation unless a value is specifically passed to that continuation. Can you define them in terms of each other? Pick one of the substitution versus the environmentbased definitions get extracredit if you do both Note: See the callCC substitution fromcallCCtocallcc substitution fromcallcctocallCCsubstitution callCC environment fromcallCCtocallcc environment and fromcallcctocallCC environment exercises in the nightly built for details and test programs. Exercise points: The current halt; statement of IMP only halts the current thread. Define an abort; statement which halts the entire program.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
