用续延编译的逻辑本质
The Logical Essence of Compiling With Continuations
AI总结:
该研究以Moggi的计算λ演算为源语言,提出值填充风格(VFS)转换作为CPS转换的替代方案,揭示了ANF的两个新子语言,证实证明论可作为中间表示的基础。
摘要:
基于续延的编译的核心在于,续延传递风格(CPS)转换等价于将源语言转换为管理式范式(ANF)的变换。我们以Moggi的计算λ演算(lbc)作为源语言,定义了一种CPS转换的替代方案——值填充风格(VFS)转换,其目标语言为相继式演算LJQ,该转换利用了相继式演算对上下文进行形式化表示的能力。VFS转换无需类型转换:实际上,仅当将VFS目标语言编码到CPS目标语言中时,才会引入双重否定。当这种可选编码与VFS转换组合时,可重构出原始的CPS转换。回到直接风格下,VFS转换的“核心”在于它揭示了ANF的一个新子语言——值封闭风格(VES),与另一个子语言续延封闭风格(CES)并存:这种替代方案源于lbc语法中关于如何展开应用构造子的两难问题。在带类型的场景下,VES和CES对应于两种按值调用证明系统之间的选择,即LJQ和带广义应用的自然演绎,证实了证明论可作为中间表示的基础。
英文摘要:
The essence of compiling with continuations is that conversion to continuation-passing style (CPS) is equivalent to a source language transformation converting to administrative normal form (ANF). Taking as source language Moggi's computational lambda-calculus (lbc), we define an alternative to the CPS-translation with target in the sequent calculus LJQ, named value-filling style (VFS) translation, and making use of the ability of the sequent calculus to represent contexts formally. The VFS-translation requires no type translation: indeed, double negations are introduced only when encoding the VFS target language in the CPS target language. This optional encoding, when composed with the VFS-translation reconstructs the original CPS-translation. Going back to direct style, the "essence" of the VFS-translation is that it reveals a new sublanguage of ANF, the value-enclosed style (VES), next to another one, the continuation-enclosing style (CES): such an alternative is due to a dilemma in the syntax of lbc, concerning how to expand the application constructor. In the typed scenario, VES and CES correspond to an alternative between two proof systems for call-by-value, LJQ and natural deduction with generalized applications, confirming proof theory as a foundation for intermediate representations.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。