首页> 外文会议>Proceedings of the 2011 ACM SIGPLAN international conference on functional programming >An Equivalence-Preserving CPS Translation via Multi-Language Semantics
【24h】

An Equivalence-Preserving CPS Translation via Multi-Language Semantics

机译:通过多语言语义保持等价的CPS翻译

获取原文
获取原文并翻译 | 示例

摘要

Language-based security relies on the assumption that all potential attacks follow the rules of the language in question. When programs are compiled into a different language, this is true only if the translation process preserves observational equivalence. To prove that a translation preserves equivalence, one must show that if two program fragments cannot be distinguished by any source context, then their translations cannot be distinguished by any target context. Informally, target contexts must be no more powerful than source contexts, i.e., for every target context there exists a source context that "behaves the same." This seems to amount to being able to "back-translate" arbitrary target terms. However, that is simply not viable for practical compilers where the target language is lower-level and, thus, contains expressions that have no source equivalent. In this paper, we give a CPS translation from a less expressive source language (STLC) to a more expressive target language (System F) and prove that the translation preserves observational equivalence. The key to our equivalence-preserving compilation is the choice of the right type translation: a source type cr mandates a set of behaviors and we must ensure that its translation σ~+ mandates semantically equivalent behaviors at the target level. Based on this type translation, we demonstrate how to prove that for every target term of type σ+, there exists an equivalent source term of type cr -even when sub-terms of the target term are not necessarily "back-translatable" themselves. A key novelty of our proof, resulting in a pleasant proof structure, is that it leverages a multi-language semantics where source and target terms may interoperate.
机译:基于语言的安全性基于以下假设:所有潜在的攻击都遵循所讨论语言的规则。当程序被编译为另一种语言时,仅当翻译过程保留了观察上的等效性时,情况才如此。为了证明翻译保留了等效性,必须证明如果两个程序片段都不能通过任何源上下文来区分,那么它们的翻译就不能通过任何目标上下文来区分。非正式地,目标上下文必须不比源上下文更强大,即,对于每个目标上下文,都存在一个“行为相同”的源上下文。这似乎等于能够“反向翻译”任意目标术语。但是,这对于实际的编译器是不可行的,因为它们的目标语言是较低级的,因此包含的表达式没有源代码。在本文中,我们将CPS从表达较少的源语言(STLC)转换为表达较高的目标语言(System F),并证明该翻译保留了观察上的等效性。保持等效性编译的关键是选择正确的类型转换:源类型cr强制执行一组行为,并且我们必须确保其转换σ〜+强制在目标级别执行语义上等效的行为。基于这种类型转换,我们演示了如何证明对于σ+类型的每个目标项,都存在一个cr类型的等效源项,即使目标项的子项本身不一定“可以逆向翻译”也是如此。我们的证明的一个关键新颖之处在于,它利用了多语言语义,其中源和目标术语可以互操作,从而形成了令人愉悦的证明结构。

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号