Author:
Johann Patricia,Polonsky Andrew
Abstract
AbstractThis paper introduces deep induction, and shows that it is the notion of induction most appropriate to nested types and other data types defined over, or mutually recursively with, (other) such types. Standard induction rules induct over only the top-level structure of data, leaving any data internal to the top-level structure untouched. By contrast, deep induction rules induct over all of the structured data present. We give a grammar generating a robust class of nested types (and thus ADTs), and develop a fundamental theory of deep induction for them using their recently defined semantics as fixed points of accessible functors on locally presentable categories. We then use our theory to derive deep induction rules for some common ADTs and nested types, and show how these rules specialize to give the standard structural induction rules for these types. We also show how deep induction specializes to solve the long-standing problem of deriving principled and practically useful structural induction rules for bushes and other truly nested types. Overall, deep induction opens the way to making induction principles appropriate to richly structured data types available in programming languages and proof assistants. Agda implementations of our development and examples, including two extended case studies, are available.
Publisher
Springer International Publishing
Reference17 articles.
1. Abbott, M.G., Altenkirch, T., Ghani, N.: Containers: Constructing strictly positive types. Theoretical Computer Science 342(2), pp. 3-27 (2005)
2. Altenkirch, T, Ghani, N., Hancock, P., McBride, C., Morris, P.: Indexed containers. Journal of Functional Programming 25 (2015)
3. Abbott, M. G., Altenkirch, T., Ghani, N.: Representing nested inductive types using W-types. In: Automata, Languages and Programming, pp. 59-71 (2004)
4. Abel, A.: Type-based termination: A polymorphic lambda-calculus with sized higher-order types. Ph.D. Dissertation, Ludwig Maximilians University Munich. https://dblp.org/rec/bib/phd/de/Abel2007. 2007.
5. Abel, A.: Semi-continuous sized types and termination. Logical Methods in Computer Science 4(2) (2008)
Cited by
6 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. GADTs are not (Even partial) functors;Mathematical Structures in Computer Science;2024-08-27
2. Practical and Sound Equality Tests, Automatically: Deriving eqType Instances for Jasmin’s Data Types with Coq-Elpi;Proceedings of the 12th ACM SIGPLAN International Conference on Certified Programs and Proofs;2023-01-11
3. GADTs, Functoriality, Parametricity: Pick Two;Electronic Proceedings in Theoretical Computer Science;2022-04-08
4. (Deep) induction rules for GADTs;Proceedings of the 11th ACM SIGPLAN International Conference on Certified Programs and Proofs;2022-01-11
5. Parametricity for Nested Types and GADTs;Logical Methods in Computer Science;2021-12-23