see Below, we consider the storeless version of the cm machine and we present the underlying calculus of closures. The following proposition states the equivalence of the fg machine and the cm machine with respect to the values they compute: Proposition 9. Moreover, it can be shown that each step of the fg machine is simulated by at most one step of the cm machine . The grammar of terms, closures and substitutions is the same, but the reduction con- texts which correspond to the stack frames in the machine contain permission tables.
From a calculus standpoint, Clements and Felleisen therefore obtained proper tail re- cursion by changing the computational model witness the change from OKsec to OKcm sec and by simplifying the reduction rules and modifying the compatibility rules. We first present this machine, and then the corresponding calculus of closures. In addition, the machine has a read-write security register m holding the current permission table and a read-only security register ms holding a list of outer permission tables. Moreover, it can be shown that each step of the cm machine is simulated by one step of the unzipped cm machine.
Compared to the rules of Sec- tion 7. When a value is consumed, the current permission table is discarded. In doing so, we have provided a calculus account of machine design and optimization for stack inspection. This machine models the memory-allocation behavior of function calls in Scheme, and Clinger used it to specify in which sense an implementation should not run out of memory when processing a tail-recursive program such as a program in CPS. Denotable values are locations.
In Section 7, we showed storeless variants of two machines for stack inspection the fg and the cm machines. The original versions of these machines use a store in the Clinger fashion , and we can exhibit their underlying calculi with an explicit representation of the store, as straightforward extensions of the storeless calculi. For conciseness, we do not include them here. In the former case—handled by Var1 —the result is this value, the current context, and the current store.
Since every argument to an applica- tion can potentially be shared, App conservatively allocates a new location in the store for such shared closures. Beta extends the substitution with this location. A sequence of let constructs binding variables to shared computations is a local version of a global heap where shared computations are bound to locations; extra reductions are then needed to propagate all the let constructs to the top level. Allocation, however, occurs late in Ariola et al. Delaying allocation is useful in the presence of strict functions, which we do not consider here.
We can construct a local version of our calculus with either of the store propagated inside closures or of late allocation. From there, one can mechanically derive the corre- sponding abstract machines. All of the calculi are new. Many of the abstract machines are known and have been independently designed and proved correct.
The work reported here leads us to drawing the following conclusions. Refocusing: Despite its pragmatic origin—fusing a plug function and a decomposition function in a reduction-based evaluation function to improve its efficiency , and in combination with compressing intermediate transitions and unfolding closures, refocusing proves consistently useful to construct reduction-free evaluation functions in the form of abstract machines, even in the presence of computational effects.
Together, the syntactic correspondence between calculi and abstract machines and the functional correspondence between abstract machines and evaluators therefore connect ap- parently distinct approaches to the same computational situations. A typed version of it is available in Standard ML of New Jersey  and Griffin has identified its logical content . The elements of answer we contribute here are that the syntactic correspondence links calculi and abstract machines, and the functional correspondence links abstract machines and evaluators. So by construction, all these specifications are inter-derivable and therefore they are consistent.
Normalization by evaluation: Finally, refocusing provides a guideline for constructing reduction-free normalization functions out of reduction-based ones . We have illustrated the method here with weak reduction and weak-head normalization i. Explicit substitutions. Journal of Functional Programming, 1 4 —, A functional correspondence between evaluators and abstract machines. ACM Press, August A functional correspondence between call-by-need evaluators and lazy abstract machines.
Information Process- ing Letters, 90 5 —, A functional correspondence be- tween monadic evaluators and abstract machines for languages with computational effects. Theoretical Computer Science, 1 —, The call-by-need lambda calculus. ACM Press. Ariola and Hugo Herbelin. Minimal classical logic and control operators. In Jos C. An operational founda- tion for delimited continuations in the CPS hierarchy. Logical Methods in Computer Science, 1 :1—39, November A concrete framework for environment ma- chines.
From interpreter to logic engine by defunc- tionalization.
A simple proof of a folklore theorem about delimited control. Accepted for publication in the Journal of Functional Programming as a theoretical pearl.
Buy Abstract machines and grammars (Little, Brown computer systems series) on charmwollstepen.tk ✓ FREE SHIPPING on qualified orders. Texts in Theoretical Computer Science An EATCS Series Editors: W. Brauer G. Rozenberg A. Salomaa On behalf of the Europ.
A dynamic continuation- passing style for dynamic delimited continuations. On the dynamic extent of delimited continuations. Information Processing Letters, 96 1 :7—17, Artificial Intelligence Programming.
Lawrence Earlbaum Associates, The Calculi of Lambda-Conversion. Princeton University Press, A tail-recursive semantics for stack inspection. Friedman, and Mitchell Wand. A scheme for a higher-level semantic algebra. Cambridge University Press, Hartheimer, and Eric M. Implementation strategies for first-class continuations. Higher-Order and Symbolic Computation, 12 1 :7—45, Proper tail recursion and space efficiency. In Keith D.
An abstract machine for lambda-terms normalization. In Wand , pages — Strongly reducing variants of the Krivine abstract machine. In Danvy . To appear. Journal version of . Pitman, An abstract framework for environment machines. Theoretical Computer Science, —, Confluence properties of weak and strong calculi of explicit substitutions.
Journal of the ACM, 43 2 — , Formalizing implementation strategies for first-class continuations. From reduction-based to reduction-free normalization. Elsevier Science. Invited talk. On evaluation contexts, continuations, and the rest of the computa- tion. Recipient of the Peter Landin prize.
Defunctionalized interpreters for higher-order programming languages. John Reynolds session. Springer, In preparation. Abstracting control. Representing control, a study of the CPS trans- formation. Mathematical Structures in Computer Science, 2 4 —, Intensions and extensions in a reflective tower.
In Cartwright , pages — Defunctionalization at work. Refocusing in reduction semantics. An operational investigation of the CPS hierarchy.
An environment machine for the lambda-mu-calculus. Mathe- matical Structures in Computer Science, —, A monadic framework for subcontinuations. The theory and practice of first-class prompts.
Programming languages and lambda cal- culi. Unpublished lecture notes.