To demonstrate derivation of monadic programs, we present a specification of sorting using the non-determinism monad, and derive pure quicksort on lists and state-monadic quicksort on arrays. In the derivation one may switch between point-free and pointwise styles, and deploy techniques familiar to functional programmers such as pattern matching and induction on structures or on sizes. Derivation of stateful programs resembles reasoning backwards from the postcondition.


翻译:为了展示蒙拿迪程序衍生,我们提出了一个使用非确定性山岳来分类的规格,并且从列表和阵列上产生纯等离子体,并在阵列上产生纯等离子体。 在引出时,我们可以在点和点风格之间转换,并运用功能程序员熟悉的技术,如结构或大小上的模式匹配和感应。 典型程序的推理类似于后条件的倒推理。

0
下载
关闭预览

相关内容

专知会员服务
161+阅读 · 2021年3月6日
专知会员服务
82+阅读 · 2020年9月28日
专知会员服务
19+阅读 · 2020年9月6日
专知会员服务
61+阅读 · 2020年3月19日
RL 真经
CreateAMind
6+阅读 · 2018年12月28日
已删除
将门创投
3+阅读 · 2018年8月21日
Auto-Encoding GAN
CreateAMind
7+阅读 · 2017年8月4日
Arxiv
4+阅读 · 2018年4月30日
VIP会员
最新内容
博士论文 | 面向大模型推理的内存高效算法
专知会员服务
2+阅读 · 7月27日
美空军新型反无人机部队初探
专知会员服务
7+阅读 · 7月27日
《防空交战流程的概率建模研究》
专知会员服务
10+阅读 · 7月27日
ICML 2026 教程 | 数值优化理论还重要吗?
专知会员服务
6+阅读 · 7月26日
ICM 2026 | 陶哲轩:人工智能时代的数学
专知会员服务
9+阅读 · 7月26日
《反无人机交战场景下的战斗归零研究》
专知会员服务
7+阅读 · 7月26日
博士论文 | 用代码结构感知方法推进代码大模型
相关VIP内容
相关资讯
RL 真经
CreateAMind
6+阅读 · 2018年12月28日
已删除
将门创投
3+阅读 · 2018年8月21日
Auto-Encoding GAN
CreateAMind
7+阅读 · 2017年8月4日
Top
微信扫码咨询专知VIP会员