Using agda2hs and ad-hoc Haskell FFI bindings, writing Qt applications in C++ with Agda- or Haskell-based backends (possibly including correctness proofs) is already possible. However, there was no repeatable methodology to do so, nor to use \emph{arbitrary} Haskell built-in libraries in Agda code. We present a well-documented, general methodology to address this, applying the ideas of the Model-View-ViewModel architecture to models implemented in functional languages. This is augmented by a software development kit providing easy installation and automated compilation. For obstacles arising, we provide solutions and ideas that are novel contributions by themselves. We describe and compare solutions for using arbitrary Haskell built-ins in Agda code, highlighting their advantages and disadvantages. Also, for user interruption, we present a new Haskell future design that, to the best of our knowledge, is the first to provide for arbitrary interruption and the first to provide for interruption via direct FFI calls from C and C++. Finally, we prove with benchmarks that the agda2hs compiler at the base of our methodology is viable when compared to other solutions, specifically to the OCaml extraction feature of Rocq and the default MAlonzo backend of Agda.


翻译:使用agda2hs和特定的Haskell FFI绑定,通过C++编写基于Agda或Haskell后端(可能包含正确性证明)的Qt应用程序已成为可能。然而,此前既缺乏可重复的方法论,也无法在Agda代码中使用任意Haskell内置库。我们提出了一种文档完善且通用的方法论来解决该问题,将模型-视图-视图模型架构的思想应用于以函数式语言实现的模型中,并通过提供简易安装与自动编译的软件开发工具包加以增强。针对过程中遇到的障碍,我们给出了本身具有创新贡献的解决方案与思路。我们描述并比较了在Agda代码中使用任意Haskell内置库的多种方案,突出其优缺点。此外,针对用户中断问题,我们提出了一种新的Haskell future设计——据我们所知,这是首个支持任意中断的方案,同时也是首个允许通过C和C++直接FFI调用实现中断的方案。最后,我们通过基准测试证明,与其他解决方案(尤其是Rocq的OCaml提取功能及Agda默认MAlonzo后端)相比,本方法论所依赖的agda2hs编译器具有可行性。

0
下载
关闭预览

相关内容

Haskell 是一种纯函数式编程语言,于 1990 年在编程语言 Miranda 的基础上标准化,并且以 λ 演算为基础发展而来。
PyGDA代码库,快速入门图域自适应学习
专知会员服务
11+阅读 · 2025年7月17日
使用 OpenLLM 构建和部署大模型应用
专知会员服务
55+阅读 · 2024年1月4日
【2023新书】实用C++后端编程,325页pdf
专知会员服务
68+阅读 · 2023年9月10日
【Manning新书】C++并行实战,592页pdf,C++ Concurrency in Action
Effective.Modern.C++ 中英文版,334页pdf
专知会员服务
69+阅读 · 2020年11月4日
Effective.Modern.C++ 中英文版,334页pdf
专知
26+阅读 · 2020年11月4日
TheFatRat 一款简易后门工具
黑白之道
36+阅读 · 2019年10月23日
进一步改进GPT和BERT:使用Transformer的语言模型
机器之心
16+阅读 · 2019年5月1日
用PyTorch实现各种GANs(附论文和代码地址)
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
3+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
19+阅读 · 2012年12月31日
Arxiv
0+阅读 · 3月4日
Arxiv
0+阅读 · 2月21日
VIP会员
最新内容
BES:让语言模型通过双向进化搜索自我改进
专知会员服务
3+阅读 · 5月30日
以色列-美国-伊朗战争中的无人机:关键要点
专知会员服务
4+阅读 · 5月30日
《Palantir任务保障性软件安全标准(MA-S2)》
专知会员服务
10+阅读 · 5月30日
基于声学的无人机检测技术综述
专知会员服务
8+阅读 · 5月30日
《当代混合战争分析框架:俄乌战争经验教训》
战略前沿人工智能的再思考(中文)
专知会员服务
8+阅读 · 5月29日
《量化地基防空系统间接效应的博弈论方法》
专知会员服务
6+阅读 · 5月29日
相关基金
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
3+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
19+阅读 · 2012年12月31日
Top
微信扫码咨询专知VIP会员