Reflecting Stacked Continuations in a Fine-Grained Direct-Style Reduction Theory

Dariusz Biernacki, Mateusz Pyzik, Filip Sieczkowski
{"title":"Reflecting Stacked Continuations in a Fine-Grained Direct-Style Reduction Theory","authors":"Dariusz Biernacki, Mateusz Pyzik, Filip Sieczkowski","doi":"10.1145/3479394.3479399","DOIUrl":null,"url":null,"abstract":"The delimited-control operator shift0 has been formally shown to capture the operational semantics of deep handlers for algebraic effects. Its CPS translation generates λ-terms in which continuation composition is not expressed in terms of nested function calls, as is typical of other delimited-control operators, e.g. shift, but with function applications consuming a sequence of continuations one at a time, as if they formed a stack. We present a novel reduction theory for Moggi’s computational λ-calculus extended with shift0 and a control delimiter dollar, which models the capture of evaluation contexts in a fine-grained manner as an interaction between the let-expressions and the delimiter. We establish a connection between our reduction theory and the existing theories of shif0 and dollar. Moreover, we develop a CPS translation for our calculus along with a direct-style translation that together form a reflection, i.e. the translations preserve reductions and the direct-style translation is a right inverse of the CPS translation. This construction relies on the invariant that CPS root terms are in η-head-normal form. The results of this work could potentially be used for compiler optimisations and lead to a similar development for algebraic effects.","PeriodicalId":242361,"journal":{"name":"23rd International Symposium on Principles and Practice of Declarative Programming","volume":"11 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2021-09-06","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"6","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"23rd International Symposium on Principles and Practice of Declarative Programming","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/3479394.3479399","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 6

Abstract

The delimited-control operator shift0 has been formally shown to capture the operational semantics of deep handlers for algebraic effects. Its CPS translation generates λ-terms in which continuation composition is not expressed in terms of nested function calls, as is typical of other delimited-control operators, e.g. shift, but with function applications consuming a sequence of continuations one at a time, as if they formed a stack. We present a novel reduction theory for Moggi’s computational λ-calculus extended with shift0 and a control delimiter dollar, which models the capture of evaluation contexts in a fine-grained manner as an interaction between the let-expressions and the delimiter. We establish a connection between our reduction theory and the existing theories of shif0 and dollar. Moreover, we develop a CPS translation for our calculus along with a direct-style translation that together form a reflection, i.e. the translations preserve reductions and the direct-style translation is a right inverse of the CPS translation. This construction relies on the invariant that CPS root terms are in η-head-normal form. The results of this work could potentially be used for compiler optimisations and lead to a similar development for algebraic effects.
在细粒度直接样式约简理论中反映堆叠延拓
分隔控制操作符shift0已被正式展示用于捕获用于代数效果的深度处理程序的操作语义。它的CPS转换生成λ项,其中延续组合不像其他分隔控制操作符(例如shift)那样,以嵌套函数调用的形式表示,而是函数应用程序一次一个地使用延续序列,就好像它们形成了一个堆栈一样。我们提出了一种新的Moggi计算λ-微积分的约简理论,该理论扩展了shift0和控制分隔符dollar,该理论以细粒度的方式将计算上下文的捕获建模为let表达式和分隔符之间的相互作用。我们建立了我们的还原理论与现有的shif0和dollar理论之间的联系。此外,我们为我们的微积分开发了一个CPS翻译和一个直接风格的翻译,它们共同形成了一个反射,即翻译保留了约简,而直接风格的翻译是CPS翻译的正逆。这种结构依赖于CPS根项是η-头-正规形式的不变式。这项工作的结果可能会用于编译器优化,并导致代数效果的类似发展。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:604180095
Book学术官方微信