Relational algebraic ornaments

DTP '13 Pub Date : 2013-09-24 DOI:10.1145/2502409.2502413
Hsiang-Shang Ko, J. Gibbons
{"title":"Relational algebraic ornaments","authors":"Hsiang-Shang Ko, J. Gibbons","doi":"10.1145/2502409.2502413","DOIUrl":null,"url":null,"abstract":"Dependently typed programming is hard, because ideally dependently typed programs should share structure with their correctness proofs, but there are very few guidelines on how one can arrive at such integrated programs. McBride's algebraic ornamentation provides a methodological advancement, by which the programmer can derive a datatype from a specification involving a fold, such that a program that constructs elements of that datatype would be correct by construction. It is thus an effective method that leads the programmer from a specification to a dependently typed program. We enhance the applicability of this method by generalising algebraic ornamentation to a relational setting and bringing in relational algebraic methods, resulting in a hybrid approach that makes essential use of both dependently typed programming and relational program derivation. A dependently typed solution to the minimum coin change problem is presented as a demonstration of this hybrid approach. We also give a theoretically interesting \"completeness theorem\" of relational algebraic ornaments, which sheds some light on the expressive power of ornaments and inductive families.","PeriodicalId":205623,"journal":{"name":"DTP '13","volume":"2673 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2013-09-24","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"14","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"DTP '13","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/2502409.2502413","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 14

Abstract

Dependently typed programming is hard, because ideally dependently typed programs should share structure with their correctness proofs, but there are very few guidelines on how one can arrive at such integrated programs. McBride's algebraic ornamentation provides a methodological advancement, by which the programmer can derive a datatype from a specification involving a fold, such that a program that constructs elements of that datatype would be correct by construction. It is thus an effective method that leads the programmer from a specification to a dependently typed program. We enhance the applicability of this method by generalising algebraic ornamentation to a relational setting and bringing in relational algebraic methods, resulting in a hybrid approach that makes essential use of both dependently typed programming and relational program derivation. A dependently typed solution to the minimum coin change problem is presented as a demonstration of this hybrid approach. We also give a theoretically interesting "completeness theorem" of relational algebraic ornaments, which sheds some light on the expressive power of ornaments and inductive families.
关系型代数装饰
依赖类型的编程是困难的,因为理想情况下,依赖类型的程序应该与其正确性证明共享结构,但是很少有关于如何实现这种集成程序的指导方针。麦克布莱德的代数修饰提供了一种方法上的进步,通过这种方法,程序员可以从涉及折叠的规范中派生出数据类型,这样,构造该数据类型元素的程序将通过构造是正确的。因此,它是将程序员从规范引导到依赖类型程序的有效方法。我们通过将代数修饰推广到关系设置并引入关系代数方法来增强该方法的适用性,从而产生一种混合方法,该方法可以基本使用依赖类型编程和关系程序派生。给出了最小硬币更换问题的一个依赖类型的解作为这种混合方法的演示。我们还给出了关系代数装饰物的一个理论上有趣的“完备性定理”,它揭示了装饰物和归纳族的表达能力。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
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学术文献互助群
群 号:604180095
Book学术官方微信