What exactly are administrative redexes after CPS conversion?
Asked Answered
A

2

9

In the context of Scheme and CPS conversion, I'm having a little trouble deciding what administrative redexes (lambdas) exactly are:

  • all the lambda expressions that are introduced by the CPS conversion
  • only the lambda expressions that are introduced by the CPS conversion but you wouldn't have written if you did the conversion "by hand" or through a smarter CPS-converter

If possible, a good reference would be welcome.

Abby answered 23/1, 2010 at 9:21 Comment(0)
T
5

Redex stands for "reducible expression", which is an expression that isn't a value. Therefore, a lambda is not a redex, but a call is.
In CPS, an administrative redex is a redex whose operator is a continuation lambda. Such redexes can be reduced immediately because you know which function you are calling.
For example, ((lambda (u) ...) foo) is an administrative redex, but (k foo) isn't.

Torruella answered 9/6, 2010 at 6:19 Comment(0)
A
4

I think I found my answer. (Edit: I have accepted dimvar's answer instead, it's shorter and more correct.)

Assuming the input program is not fully CPS, at least one procedure return point will have to be converted into a continuation by the CPS conversion. So this continuation is both introduced by the conversion and necessary. Because it is necessary, you would always need to do this, also when converting by hand for example. Therefore, administrative redexes are only those lambdas introduced by the CPS conversion that aren't really necessary (my second definition).

I found a paper that explains it like this (emphasis mine):

The naîve λ-encoding into CPS, however, generates a quite impressive inflation of lambdas, most of which form administrative redexes that can be safely reduced. Administrative reductions yield CPS terms corresponding to what one could write by hand. It has therefore become a challenge to eliminate as many administrative redexes as possible, at CPS-transformation time.

Still, any remarks or suggestions welcome of course.

Abby answered 23/1, 2010 at 11:18 Comment(1)
@Darius: the paper is "CPS Transform of Beta Redexes" (I'm reading it right now). Here is a link: brics.dk/RS/04/39/BRICS-RS-04-39.pdfGrasp

© 2022 - 2024 — McMap. All rights reserved.