Book contents
- Frontmatter
- Abstract
- Contents
- Preface
- 1 Partial Evaluation in Principle
- 2 Partial Evaluation in Practice
- 3 Static Projections
- 4 Binding-Time Analysis
- 5 Run Time Arguments
- 6 Implementation
- 7 Polymorphism
- 8 Conclusion
- A Implementation of PEL
- B Implementation of BTA
- C Implementation of Specialisation
- D Library Functions
- Bibliography
- Index
5 - Run Time Arguments
Published online by Cambridge University Press: 04 August 2010
- Frontmatter
- Abstract
- Contents
- Preface
- 1 Partial Evaluation in Principle
- 2 Partial Evaluation in Practice
- 3 Static Projections
- 4 Binding-Time Analysis
- 5 Run Time Arguments
- 6 Implementation
- 7 Polymorphism
- 8 Conclusion
- A Implementation of PEL
- B Implementation of BTA
- C Implementation of Specialisation
- D Library Functions
- Bibliography
- Index
Summary
The static projection tells us which part of a function's argument will be present during partial evaluation. In any particular call of the function, this part of the argument is used in the production of a residual function. However, this still leaves the question: which part of the argument should the residual function be given at run-time? Obviously we could pass the whole argument if we wanted to, but we can do a lot better. After all, we assume that the partial evaluator will have taken the static part of the argument into account in producing the residual function. It ought to be unnecessary to supply the residual function with the same information all over again.
We need a way to select the run-time information. The original argument to a function ƒ must be factorised, or decomposed, into static and dynamic factors, and this factorisation should be as complete as possible. That is, the amount of static information which is also regarded as dynamic should be minimised. Then, when we pass the dynamic argument to the residual function, we will be passing as little information at run-time as possible. There are, of course, many possible factorisation methods. Some produce an exact decomposition while others do not in that they contain extra junk.
We will look at two methods in this chapter. While the first does not produce an exact factorisation of the original argument, it is based on very familiar constructions and is interesting in its own right. The second method, which is exact, arises as a generalisation of the first, and provides a practical application of some fairly deep mathematics.
- Type
- Chapter
- Information
- Project Factorisations in Partial Evaluation , pp. 56 - 74Publisher: Cambridge University PressPrint publication year: 1991