首页    期刊浏览 2025年12月04日 星期四
登录注册

文章基本信息

  • 标题:Eta-Expansion Does The Trick (Revised Version)
  • 本地全文:下载
  • 作者:Olivier Danvy ; Karoline Malmkjær ; Jens Palsberg
  • 期刊名称:BRICS Report Series
  • 印刷版ISSN:0909-0878
  • 出版年度:1996
  • 卷号:3
  • 期号:17
  • 出版社:Aarhus University
  • 摘要:Partial-evaluation folklore has it that massaging one's source programs can make them specialize better. In Jones, Gomard, and Sestoft's recent textbook, a whole chapter is dedicated to listing such "binding-time improvements": nonstandard use of continuation passing style, eta-expansion, and a popular transformation called "The Trick". We provide a unified view of these binding-time improvements, from a typing perspective. Just as a proper treatment of product values in partial evaluation requires partially static values, a proper treatment of disjoint sums requires moving static contexts across dynamic case expressions. This requirement precisely accounts for the nonstandard use of continuation-passing style encountered in partial evaluation. Eta-expansion thus acts as a uniform binding-time coercion between values and contexts, be they of function type, product type, or disjoint-sum type. For the latter case, it enables "The Trick". In this article, we extend Gomard and Jones's partial evaluator for the lambda-calculus, lambda-Mix, with products and disjoint sums; we point out how eta-expansion for (finite) disjoint sums enables The Trick; we generalize our earlier work by identifying that eta-expansion can be obtained in the binding-time analysis simply by adding two coercion rules; and we specify and prove the correctness of our extension to lambda-Mix. Keywords: Partial evaluation, binding-time analysis, program specialization, binding-time improvement, eta-expansion, static reduction.
国家哲学社会科学文献中心版权所有