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会员
最新内容
世界模型入门:从序贯决策到通用智能体
专知会员服务
0+阅读 · 今天15:30
军事域更好使用人工智能的实用指南
专知会员服务
8+阅读 · 10月22日
《衡量语言模型中的作战规划能力》
专知会员服务
13+阅读 · 10月20日
Maven智能系统:帕兰提尔军事人工智能平台详解
专知会员服务
15+阅读 · 10月20日
《测试自动化框架在敏捷软件开发中的角色》
专知会员服务
8+阅读 · 10月20日
俄罗斯如何拦截乌克兰无人机与巡航导弹
专知会员服务
12+阅读 · 10月15日
《武器-目标分配问题:精确与近似求解算法》
专知会员服务
16+阅读 · 10月15日
相关VIP内容
相关资讯
RL 真经
CreateAMind
6+阅读 · 2018年12月28日
已删除
将门创投
3+阅读 · 2018年8月21日
Auto-Encoding GAN
CreateAMind
7+阅读 · 2017年8月4日
Top
微信扫码咨询专知VIP会员