In verified generic programming, one cannot exploit the structure of concrete data types but has to rely on well chosen sets of specifications or abstract data types (ADTs). Functors and monads are at the core of many applications of functional programming. This raises the question of what useful ADTs for verified functors and monads could look like. The functorial map of many important monads preserves extensional equality. For instance, if $f, g : A \rightarrow B$ are extensionally equal, that is, $\forall x \in A, \ f \ x = g \ x$, then $map \ f : List \ A \rightarrow List \ B$ and $map \ g$ are also extensionally equal. This suggests that preservation of extensional equality could be a useful principle in verified generic programming. We explore this possibility with a minimalist approach: we deal with (the lack of) extensional equality in Martin-L\"of's intensional type theories without extending the theories or using full-fledged setoids. Perhaps surprisingly, this minimal approach turns out to be extremely useful. It allows one to derive simple generic proofs of monadic laws but also verified, generic results in dynamical systems and control theory. In turn, these results avoid tedious code duplication and ad-hoc proofs. Thus, our work is a contribution towards pragmatic, verified generic programming.


翻译:在经过核实的通用编程中,人们无法利用具体数据类型的结构,但必须依赖精心选择的成套规格或抽象数据类型(ADTs)。 调料和调味物是功能性编程许多应用的核心。 这就提出了一个问题,即对经核实的调料和调味物来说,ADTs有什么用处。 许多重要的调味物的调料地图可以保存扩展性平等。 例如,如果 $f, g :\ rightrow B$是扩展式的, 也就是说, $\f\ f=x g = x $, 然后 $map\ f: 列表\\\ 直观列表\ B$ 和 $map\ gads 也可以是扩展式的。 这表明, 维护扩展性平等可能是经过核实的通用编程中的一项有用原则。 我们探索这种可能性, 最起码的方法是: 我们处理( ) 马丁- L\ 的扩展性编程中缺乏) 扩展性理论, \ f= g= gxxxxxxxxxxxxxxxxxxxxx, 然后 y- surrendational rogreal rogresulational rogresulationsurviewsurview.

0
下载
关闭预览

相关内容

迄今为止,产品设计师最友好的交互动画软件。

专知会员服务
52+阅读 · 2021年8月8日
专知会员服务
29+阅读 · 2021年8月2日
专知会员服务
19+阅读 · 2020年9月6日
强化学习最新教程,17页pdf
专知会员服务
182+阅读 · 2019年10月11日
A Technical Overview of AI & ML in 2018 & Trends for 2019
待字闺中
18+阅读 · 2018年12月24日
已删除
将门创投
4+阅读 · 2018年11月6日
Hierarchical Disentangled Representations
CreateAMind
4+阅读 · 2018年4月15日
【论文】变分推断(Variational inference)的总结
机器学习研究会
39+阅读 · 2017年11月16日
Auto-Encoding GAN
CreateAMind
7+阅读 · 2017年8月4日
Arxiv
0+阅读 · 2021年10月28日
VIP会员
相关VIP内容
专知会员服务
52+阅读 · 2021年8月8日
专知会员服务
29+阅读 · 2021年8月2日
专知会员服务
19+阅读 · 2020年9月6日
强化学习最新教程,17页pdf
专知会员服务
182+阅读 · 2019年10月11日
相关资讯
A Technical Overview of AI & ML in 2018 & Trends for 2019
待字闺中
18+阅读 · 2018年12月24日
已删除
将门创投
4+阅读 · 2018年11月6日
Hierarchical Disentangled Representations
CreateAMind
4+阅读 · 2018年4月15日
【论文】变分推断(Variational inference)的总结
机器学习研究会
39+阅读 · 2017年11月16日
Auto-Encoding GAN
CreateAMind
7+阅读 · 2017年8月4日
Top
微信扫码咨询专知VIP会员