合理的议程是正确的Haskell:使用agda2hs编写经过验证的Haskell

Jesper Cockx, Orestis Melkonian, Lucas Escot, James Chapman, U. Norell
{"title":"合理的议程是正确的Haskell:使用agda2hs编写经过验证的Haskell","authors":"Jesper Cockx, Orestis Melkonian, Lucas Escot, James Chapman, U. Norell","doi":"10.1145/3546189.3549920","DOIUrl":null,"url":null,"abstract":"Modern dependently typed languages such as Agda can be used to statically enforce the correctness of programs. However, they still lack the large ecosystem of a more popular language like Haskell. To combine the strength of both approaches, we present agda2hs, a tool that translates an expressive subset of Agda to readable Haskell, erasing dependent types and proofs in the process. Thanks to Agda's support for erasure annotations, this process is both safe and transparent to the user. Compared to other tools for program extraction, agda2hs uses a syntax that is already familiar to functional programmers, allows for both intrinsic and extrinsic approaches to verification, and produces Haskell code that is easy to read and audit by programmers with no knowledge of Agda. We present a practical use case of agda2hs at IOG to verify properties of a program generator. While both agda2hs and its ecosystem are still young, our experiences so far show that this is a viable approach to make verified functional programming available to a broader audience. This paper is a literate Agda script, hence all rendered (Agda) code has been typechecked.","PeriodicalId":118757,"journal":{"name":"Proceedings of the 15th ACM SIGPLAN International Haskell Symposium","volume":"27 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2022-09-06","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"1","resultStr":"{\"title\":\"Reasonable Agda is correct Haskell: writing verified Haskell using agda2hs\",\"authors\":\"Jesper Cockx, Orestis Melkonian, Lucas Escot, James Chapman, U. Norell\",\"doi\":\"10.1145/3546189.3549920\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"Modern dependently typed languages such as Agda can be used to statically enforce the correctness of programs. However, they still lack the large ecosystem of a more popular language like Haskell. To combine the strength of both approaches, we present agda2hs, a tool that translates an expressive subset of Agda to readable Haskell, erasing dependent types and proofs in the process. Thanks to Agda's support for erasure annotations, this process is both safe and transparent to the user. Compared to other tools for program extraction, agda2hs uses a syntax that is already familiar to functional programmers, allows for both intrinsic and extrinsic approaches to verification, and produces Haskell code that is easy to read and audit by programmers with no knowledge of Agda. We present a practical use case of agda2hs at IOG to verify properties of a program generator. While both agda2hs and its ecosystem are still young, our experiences so far show that this is a viable approach to make verified functional programming available to a broader audience. This paper is a literate Agda script, hence all rendered (Agda) code has been typechecked.\",\"PeriodicalId\":118757,\"journal\":{\"name\":\"Proceedings of the 15th ACM SIGPLAN International Haskell Symposium\",\"volume\":\"27 1\",\"pages\":\"0\"},\"PeriodicalIF\":0.0000,\"publicationDate\":\"2022-09-06\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"1\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"Proceedings of the 15th ACM SIGPLAN International Haskell Symposium\",\"FirstCategoryId\":\"1085\",\"ListUrlMain\":\"https://doi.org/10.1145/3546189.3549920\",\"RegionNum\":0,\"RegionCategory\":null,\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"\",\"JCRName\":\"\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"Proceedings of the 15th ACM SIGPLAN International Haskell Symposium","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/3546189.3549920","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 1

摘要

现代的依赖类型语言(如Agda)可用于静态地强制程序的正确性。然而,它们仍然缺乏像Haskell这样更流行的语言那样的大型生态系统。为了结合这两种方法的优势,我们提出了agda2hs,这是一个将Agda的表达子集转换为可读的Haskell的工具,在此过程中删除依赖类型和证明。由于Agda对擦除注释的支持,这个过程对用户来说既安全又透明。与其他程序提取工具相比,agda2hs使用函数式程序员已经熟悉的语法,允许内部和外部验证方法,并且生成的Haskell代码对于不了解Agda的程序员来说也很容易阅读和审计。我们提出了一个agda2hs在IOG上的实际用例来验证程序生成器的属性。虽然agda2hs及其生态系统还很年轻,但我们迄今为止的经验表明,这是一种可行的方法,可以将经过验证的函数式编程提供给更广泛的受众。本文是一个文字Agda脚本,因此所有渲染(Agda)代码都经过了类型检查。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
Reasonable Agda is correct Haskell: writing verified Haskell using agda2hs
Modern dependently typed languages such as Agda can be used to statically enforce the correctness of programs. However, they still lack the large ecosystem of a more popular language like Haskell. To combine the strength of both approaches, we present agda2hs, a tool that translates an expressive subset of Agda to readable Haskell, erasing dependent types and proofs in the process. Thanks to Agda's support for erasure annotations, this process is both safe and transparent to the user. Compared to other tools for program extraction, agda2hs uses a syntax that is already familiar to functional programmers, allows for both intrinsic and extrinsic approaches to verification, and produces Haskell code that is easy to read and audit by programmers with no knowledge of Agda. We present a practical use case of agda2hs at IOG to verify properties of a program generator. While both agda2hs and its ecosystem are still young, our experiences so far show that this is a viable approach to make verified functional programming available to a broader audience. This paper is a literate Agda script, hence all rendered (Agda) code has been typechecked.
求助全文
通过发布文献求助,成功后即可免费获取论文全文。 去求助
来源期刊
自引率
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学术文献互助群
群 号:481959085
Book学术官方微信