Under Control: Compositionally Correct Closure Conversion with Mutable State

P. Mates, James T. Perconti, Amal J. Ahmed
{"title":"Under Control: Compositionally Correct Closure Conversion with Mutable State","authors":"P. Mates, James T. Perconti, Amal J. Ahmed","doi":"10.1145/3354166.3354181","DOIUrl":null,"url":null,"abstract":"Compositional compiler verification aims to ensure correct compilation of components, not just whole programs. Perconti and Ahmed [2014] propose a methodology for compositional compiler correctness that supports linking with code of arbitrary provenance. In particular, they allow compiled components to be linked with code whose functionality cannot even be expressed in the compiler's own source language. The essence of their approach is to define a multi-language system that formalizes interoperability between the source and target languages so that compiler correctness can be stated as contextual equivalence in the multi-language. They illustrate this methodology on a two-pass type-preserving compiler for a polymorphic language with recursive types. We show how to extend this multi-language compiler-verification approach to a source language with ML-style mutable references. We present the first compositional correctness proof of typed closure conversion for a language with mutable state. More importantly, we show we can extend our target language with first-class control (call/cc) yielding a compiler correctness theorem that allows components compiled from the source language (without call/cc) to be linked with target-language components (with call/cc) whose extensional behavior cannot be expressed in the source. A nontrivial technical contribution is the design of the multi-language logical relation used to carry out the proof of compiler correctness. This is semantically challenging due to the mix of parametric polymorphism and mutable state in both interoperating languages. We use a blue font to typeset our source language and a bold red to typeset the target. The paper will be much easier to read if viewed/printed in color.","PeriodicalId":182058,"journal":{"name":"Proceedings of the 21st International Symposium on Principles and Practice of Declarative Programming","volume":"38 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2019-10-07","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"9","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Proceedings of the 21st International Symposium on Principles and Practice of Declarative Programming","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/3354166.3354181","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 9

Abstract

Compositional compiler verification aims to ensure correct compilation of components, not just whole programs. Perconti and Ahmed [2014] propose a methodology for compositional compiler correctness that supports linking with code of arbitrary provenance. In particular, they allow compiled components to be linked with code whose functionality cannot even be expressed in the compiler's own source language. The essence of their approach is to define a multi-language system that formalizes interoperability between the source and target languages so that compiler correctness can be stated as contextual equivalence in the multi-language. They illustrate this methodology on a two-pass type-preserving compiler for a polymorphic language with recursive types. We show how to extend this multi-language compiler-verification approach to a source language with ML-style mutable references. We present the first compositional correctness proof of typed closure conversion for a language with mutable state. More importantly, we show we can extend our target language with first-class control (call/cc) yielding a compiler correctness theorem that allows components compiled from the source language (without call/cc) to be linked with target-language components (with call/cc) whose extensional behavior cannot be expressed in the source. A nontrivial technical contribution is the design of the multi-language logical relation used to carry out the proof of compiler correctness. This is semantically challenging due to the mix of parametric polymorphism and mutable state in both interoperating languages. We use a blue font to typeset our source language and a bold red to typeset the target. The paper will be much easier to read if viewed/printed in color.
在控制之下:具有可变状态的组合正确闭包转换
组合编译器验证的目的是确保组件的正确编译,而不仅仅是整个程序。Perconti和Ahmed[2014]提出了一种组合编译器正确性的方法,该方法支持与任意来源的代码链接。特别是,它们允许将编译后的组件与功能甚至不能用编译器自己的源语言表示的代码链接起来。他们的方法的本质是定义一个多语言系统,将源语言和目标语言之间的互操作性形式化,这样编译器的正确性就可以被描述为多语言中的上下文等价。他们在具有递归类型的多态语言的两遍类型保留编译器上演示了这种方法。我们展示如何扩展这个多语言compiler-verification ml风格的源语言可变的参考方法。我们给出了具有可变状态的语言的类型闭包转换的第一个组合正确性证明。更重要的是,我们展示了我们可以用一级控制(call/cc)扩展我们的目标语言,从而产生一个编译器正确性定理,该定理允许从源语言(不含call/cc)编译的组件与扩展行为不能在源语言中表示的目标语言组件(含call/cc)链接。一个重要的技术贡献是设计了用于执行编译器正确性证明的多语言逻辑关系。由于两种互操作语言中参数多态性和可变状态的混合,这在语义上具有挑战性。我们用蓝色字体来排版源语言,用红色粗体来排版目标语言。这张纸如果用彩色打印的话,阅读起来会容易得多。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约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学术官方微信