PureCake: A Verified Compiler for a Lazy Functional Language

被引:1
|
作者
Kanabar, Hrutvik [1 ]
Vivien, Samuel [2 ,3 ]
Abrahamsson, Oskar [3 ]
Myreen, Magnus O. [3 ]
Norrish, Michael [4 ]
Pohjola, Johannes Aman [5 ]
Zanetti, Riccardo [3 ]
机构
[1] Univ Kent, Canterbury, Kent, England
[2] Ecole Normale Super PSL, Paris, France
[3] Chalmers Univ Technol, Gothenburg, Sweden
[4] Australian Natl Univ, Canberra, ACT, Australia
[5] Univ New South Wales, Kensington, NSW, Australia
基金
瑞典研究理事会;
关键词
compiler verification; Haskell; interactive theorem proving; HOL4;
D O I
10.1145/3591259
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
We present PureCake, a mechanically-verified compiler for PureLang, a lazy, purely functional programming language with monadic effects. PureLang syntax is Haskell-like and indentation-sensitive, and its constraint-based Hindley-Milner type system guarantees safe execution. We derive sound equational reasoning principles over its operational semantics, dramatically simplifying some proofs. We prove end-to-end correctness for the compilation of PureLang down to machine code-the first such result for any lazy language-by targeting CakeML and composing with its verified compiler. Multiple optimisation passes are necessary to handle realistic lazy idioms effectively. We develop PureCake entirely within the HOL4 interactive theorem prover.
引用
收藏
页数:25
相关论文
共 50 条
  • [1] A Verified Compiler for a Functional Tensor Language
    Liu, Amanda
    Bernstein, Gilbert
    Chlipala, Adam
    Ragan-Kelley, Jonathan
    [J]. PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2024, 8 (PLDI):
  • [2] A Verified Compiler for an Impure Functional Language
    Chlipala, Adam
    [J]. ACM SIGPLAN NOTICES, 2010, 45 (01) : 93 - 106
  • [3] A Verified Compiler for an Impure Functional Language
    Chlipala, Adam
    [J]. POPL'10: PROCEEDINGS OF THE 37TH ANNUAL ACM SIGPLAN-SIGACT SYMPOSIUM ON PRINCIPLES OF PROGRAMMING LANGUAGES, 2010, : 93 - 106
  • [4] Verified Inlining and Specialisation for PureCake
    Kanabar, Hrutvik
    Korban, Kacper
    Myreen, Magnus O.
    [J]. PROGRAMMING LANGUAGES AND SYSTEMS, PT II, ESOP 2024, 2024, 14577 : 275 - 301
  • [5] Towards a verified compiler prototype for the synchronous language SIGNAL
    Yang, Zhibin
    Bodeveix, Jean-Paul
    Filali, Mamoun
    Hu, Kai
    Zhao, Yongwang
    Ma, Dianfu
    [J]. FRONTIERS OF COMPUTER SCIENCE, 2016, 10 (01) : 37 - 53
  • [6] Towards a verified compiler prototype for the synchronous language SIGNAL
    Zhibin YANG
    JeanPaul BODEVEIX
    Mamoun FILALI
    Kai HU
    Yongwang ZHAO
    Dianfu MA
    [J]. Frontiers of Computer Science., 2016, 10 (01) - 53
  • [7] Towards a verified compiler prototype for the synchronous language SIGNAL
    Zhibin Yang
    Jean-Paul Bodeveix
    Mamoun Filali
    Kai Hu
    Yongwang Zhao
    Dianfu Ma
    [J]. Frontiers of Computer Science, 2016, 10 : 37 - 53
  • [8] Kalas: A Verified, End-To-End Compiler for a Choreographic Language
    Pohjola, Johannes Åman
    Gómez-Londoño, Alejandro
    Shaker, James
    Norrish, Michael
    [J]. Leibniz International Proceedings in Informatics, LIPIcs, 2022, 237
  • [9] Pilsner: A Compositionally Verified Compiler for a Higher-Order Imperative Language
    Neis, Georg
    Hur, Chung-Kil
    Kaiser, Jan-Oliver
    McLaughlin, Craig
    Dreyer, Derek
    Vafeiadis, Viktor
    [J]. ACM SIGPLAN NOTICES, 2015, 50 (09) : 166 - 178
  • [10] Pilsner: A Compositionally Verified Compiler for a Higher-Order Imperative Language
    Neis, Georg
    Hur, Chung-Kil
    Kaiser, Jan-Oliver
    McLaughlin, Craig
    Dreyer, Derek
    Vafeiadis, Viktor
    [J]. PROCEEDINGS OF THE 20TH ACM SIGPLAN INTERNATIONAL CONFERENCE ON FUNCTIONAL PROGRAMMING (ICFP'15), 2015, : 166 - 178