Affiliation:
1. IT University of Copenhagen, Copenhagen S, Denmark
2. DIKU, University of Copenhagen, Copenhagen ø, Denmark
Abstract
Recent research suggests that the goal of fully automatic and reliable program generation for a broad range of applications is coming nearer to feasibility. However, several interesting and challenging problems remain to be solved before it becomes a reality. Solving them is also
necessary,
if we hope ever to elevate software engineering from its current state (a highly developed handiwork) into a successful branch of engineering, capable of solving a wide range of new problems by systematic, well-automated and well-founded methods.A key problem in all program generation is
termination
of the generation process. This article focuses on off-line partial evaluation and describes recent progress towards automatically solving the termination problem, first for individual programs, and then for specializers and “generating extensions,” the program generators that most offline partial evaluators produce.The technique is based on
size-change graphs
that approximate the changes in parameter sizes at function calls. We formulate a criterion,
bounded anchoring,
for detecting parameters known to be bounded during specialization: a bounded parameter can act as an
anchor
for other parameters. Specialization points necessary for termination are computed by adding a parameter that tracks call depth, and then selecting a specialization point in every call loop where it is unanchored. By generalizing all unbounded parameters, we compute a binding-time division which together with the set of specialization points
guarantees
termination.Contributions of this article include a proof, based on the operational semantics of partial evaluation with memoization, that the analysis guarantees termination; and an in-depth description of safety of the increasing size approximation operator required for termination analysis in partial evaluation.Initial experiments with a prototype shows that the analysis overall yields binding-time divisions that can achieve a high degree of specialization, while still guaranteeing termination.The article ends with a list of challenging problems whose solution would bring the community closer to the goal of broad-spectrum, fully automatic and reliable program generation.
Publisher
Association for Computing Machinery (ACM)
Cited by
11 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. Fast offline partial evaluation of logic programs;Information and Computation;2014-04
2. Bibliography;Program Specialization;2013-02-05
3. Automated termination proofs for haskell by term rewriting;ACM Transactions on Programming Languages and Systems;2011-01
4. Size-Change Termination and Transition Invariants;Static Analysis;2010
5. Macros for context-free grammars;Proceedings of the 10th international ACM SIGPLAN conference on Principles and practice of declarative programming;2008-07-15