Generic and flexible defaults for verified, law-abiding type-class instances
Generic and flexible defaults for verified, law-abiding type-class instances
复制标题
经过验证、遵守法律的类型类实例的通用且灵活的默认值
DOI:
10.1145/3331545.3342591
复制
发表时间:
2019
期刊:
影响因子:
--
通讯作者:
Newton, Ryan R.
中科院分区:
文献类型:
--
作者:
Scott, Ryan G.;Newton, Ryan R.
Dependently typed languages allow programmers to state and prove type class laws by simply encoding the laws as class methods. But writing implementations of these methods frequently give way to large amounts of routine, boilerplate code, and depending on the law involved, the size of these proofs can grow superlinearly with the size of the datatypes involved.We present a technique for automating away large swaths of this boilerplate by leveraging datatype-generic programming. We observe that any algebraic data type has an equivalentrepresentation typethat is composed of simpler, smaller types that are simpler to prove theorems over. By constructing an isomorphism between a datatype and its representation type, we derive proofs for the original datatype by reusing the corresponding proof over the representation type. Our work is designed to be general-purpose and does not require advanced automation techniques such as tactic systems. As evidence for this claim, we implement these ideas in a Haskell library that defines generic, canonical implementations of the methods and proof obligations for classes in the standard base library.
登录
查看更多内容
影响因子:
2.3
作者:
José Pedro Magalhães;A. Dijkstra;J. Jeuring;Andres Löh
通讯作者:
Andres Löh
DOI:
10.5555/985799.985801
发表时间:
2003
期刊:
Nord. J. Comput.
影响因子:
--
作者:
Marcin Benke;P. Dybjer;Patrik Jansson
通讯作者:
Patrik Jansson
DOI:
10.1145/1088348.1088355
发表时间:
2005
期刊:
ArXiv
影响因子:
--
作者:
Andreas Abel;Marcin Benke;Ana Bove;John Hughes;U. Norell
通讯作者:
U. Norell
影响因子:
--
作者:
Chapman J
通讯作者:
Chapman J
DOI:
--
发表时间:
2013
期刊:
ACM SIGPLAN Symposium/Workshop on Haskell
影响因子:
--
作者:
R. Eisenberg;Stephanie Weirich
通讯作者:
Stephanie Weirich