首页    期刊浏览 2025年02月28日 星期五
登录注册

文章基本信息

  • 标题:Programming type-safe transformations using higher-order abstract syntax
  • 作者:Olivier Savary Belanger ; Stefan Monnier ; Brigitte Pientka
  • 期刊名称:Journal of Formalized Reasoning
  • 印刷版ISSN:1972-5787
  • 出版年度:2015
  • 卷号:8
  • 期号:1
  • 页码:49-91
  • DOI:10.6092/issn.1972-5787/5122
  • 语种:English
  • 出版社:Alma Mater Studiorum - University of Bologna
  • 摘要:When verifying that compiler phases preserve some property of the compiled program, a major difficulty resides in how to represent and manipulate variable bindings, often imposing extra complexity both on the compiler writer and the verification effort. In this paper, we show how Beluga's dependent contextual types let us use higher-order abstract syntax (HOAS) to implement a type-preserving compiler for the simply-typed lambda-calculus, including transformations such as closure conversion and hoisting. Unlike previous implementations, which have to abandon HOAS locally in favor of a first-order binder representation, we are able to take advantage of HOAS throughout the compiler pipeline, so that the compiler code stays clean and we do not need extra lemmas about binder manipulation. Our work demonstrates that HOAS encodings offer substantial benefits to certified programming. Scope and type safety of the code transformations are statically guaranteed, and our implementation nicely mirrors the paper proof of type preservation, and can hence be seen as an encoding of the proof which happens to be executable as well.
  • 其他摘要:When verifying that compiler phases preserve some property of the compiled program, a major difficulty resides in how to represent and manipulate variable bindings, often imposing extra complexity both on the compiler writer and the verification effort. In this paper, we show how Beluga's dependent contextual types let us use higher-order abstract syntax (HOAS) to implement a type-preserving compiler for the simply-typed lambda-calculus, including transformations such as closure conversion and hoisting.  Unlike previous implementations, which have to abandon HOAS locally in favor of a first-order binder representation, we are able to take advantage of HOAS throughout the compiler pipeline, so that the compiler code stays clean and we do not need extra lemmas about binder manipulation.  Our work demonstrates that HOAS encodings offer substantial benefits to certified programming. Scope and type safety of the code transformations are statically guaranteed, and our implementation nicely mirrors the paper proof of type preservation, and can hence be seen as an encoding of the proof which happens to be executable as well.
  • 关键词:Logical frameworks;Certified Programming;Type-preserving Compilation
Loading...
联系我们|关于我们|网站声明
国家哲学社会科学文献中心版权所有