A Few Constructions on Constructors

  • Conor McBride
  • Healfdene Goguen
  • James McKinna
Part of the Lecture Notes in Computer Science book series (LNCS, volume 3839)


We present four constructions for standard equipment which can be generated for every inductive datatype: case analysis, structural recursion, no confusion, acyclicity. Our constructions follow a two-level approach—they require less work than the standard techniques which inspired them [11,8]. Moreover, given a suitably heterogeneous notion of equality, they extend without difficulty to inductive families of datatypes. These constructions are vital components of the translation from dependently typed programs in pattern matching style [7] to the equivalent programs expressed in terms of induction principles [21] and as such play a crucial behind-the-scenes rôle in Epigram [25].


Node Leaf Type Theory Dependent Type Functional Programming Elimination Rule 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Abbott, M., Altenkirch, T., Ghani, N., McBride, C.: \(\partial\) for data: derivatives of data structures. Fundamenta Informaticae (2005)Google Scholar
  2. 2.
    Altenkirch, T., McBride, C.: Generic programming within dependently typed programming. In: Generic Programming. Proceedings of the IFIP TC2 Working Conference on Generic Programming, Schloss Dagstuhl, July 2002 (2003)Google Scholar
  3. 3.
    Benke, M., Dybjer, P., Jansson, P.: Universes for generic programs and proofs in dependent type theory. Nordic Journal of Computing 10, 265–269 (2003)zbMATHMathSciNetGoogle Scholar
  4. 4.
    Bertot, Y., Castéran, P.: Interactive Theorem Proving and Program Development, Coq’Art: The Calculus of Inductive Constructions. Texts in Theoretical Computer Science. Springer, Heidelberg (2004)zbMATHGoogle Scholar
  5. 5.
    Brady, E., McBride, C., McKinna, J.: Inductive families need not store their indices. In: Berardi, S., Coppo, M., Damiani, F. (eds.) TYPES 2003. LNCS, vol. 3085, pp. 115–129. Springer, Heidelberg (2004)CrossRefGoogle Scholar
  6. 6.
    Coquand, T.: An analysis of Girard’s paradox. In: Proceedings of the First IEEE Symposium on Logic in Computer Science, Cambridge, Massachussetts, pp. 227–236 (1986)Google Scholar
  7. 7.
    Coquand, T.: Pattern Matching with Dependent Types. In: Nordström, B., Petersson, K., Plotkin, G. (eds.) Electronic Proceedings of the Third Annual BRA Workshop on Logical Frameworks, Båstad, Sweden (1992)Google Scholar
  8. 8.
    Cornes, C., Terrasse, D.: Automating Inversion of Inductive Predicates in Coq. In: Berardi, S., Coppo, M. (eds.) TYPES 1995. LNCS, vol. 1158. Springer, Heidelberg (1996)Google Scholar
  9. 9.
    de Bruijn, N.G.: Telescopic Mappings in Typed Lambda-Calculus. Information and Computation 91, 189–204 (1991)zbMATHCrossRefMathSciNetGoogle Scholar
  10. 10.
    Dybjer, P.: Inductive Sets and Families in Martin-Löf’s Type Theory. In: Huet, G., Plotkin, G. (eds.) Logical Frameworks. CUP (1991)Google Scholar
  11. 11.
    Giménez, E.: Codifying guarded definitions with recursive schemes. In: Smith, J., Dybjer, P., Nordström, B. (eds.) TYPES 1994. LNCS, vol. 996, pp. 39–59. Springer, Heidelberg (1995)Google Scholar
  12. 12.
    Giménez, E.: Structural Recursive Definitions in Type Theory. In: Larsen, K.G., Skyum, S., Winskel, G. (eds.) ICALP 1998. LNCS, vol. 1443, p. 397. Springer, Heidelberg (1998)CrossRefGoogle Scholar
  13. 13.
    Goguen, H.: A Typed Operational Semantics for Type Theory. PhD thesis, Laboratory for Foundations of Computer Science, University of Edinburgh (1994), Available from,
  14. 14.
    Harper, R., Pollack, R.: Type checking with universes. Theoretical Computer Science 89, 107–136 (1991)zbMATHCrossRefMathSciNetGoogle Scholar
  15. 15.
    Hinze, R., Jeuring, J., Löh, A.: Type-indexed data types. Science of Computer Programmming 51, 117–151 (2004)zbMATHCrossRefGoogle Scholar
  16. 16.
    Hofmann, M., Streicher, T.: A groupoid model refutes uniqueness of identity proofs. In: Proc. Ninth Annual Symposium on Logic in Computer Science (LICS), Paris, France, pp. 208–212. IEEE Computer Society Press, Los Alamitos (1994)CrossRefGoogle Scholar
  17. 17.
    Huet, G.: The Zipper. Journal of Functional Programming 7(5), 549–554 (1997)zbMATHCrossRefMathSciNetGoogle Scholar
  18. 18.
    Luo, Z.: Computation and Reasoning: A Type Theory for Computer Science. Oxford University Press, Oxford (1994)zbMATHGoogle Scholar
  19. 19.
    Magnusson, L., Nordström, B.: The ALF proof editor and its proof engine. In: Barendregt, H., Nipkow, T. (eds.) TYPES 1993. LNCS, vol. 806. Springer, Heidelberg (1994)Google Scholar
  20. 20.
    McBride, C.: Inverting inductively defined relations in LEGO. In: Giménez, E., Paulin-Mohring, C. (eds.) TYPES 1996. LNCS, vol. 1512, pp. 236–253. Springer, Heidelberg (1998)CrossRefGoogle Scholar
  21. 21.
    McBride, C.: Dependently Typed Functional Programs and their Proofs. PhD thesis, University of Edinburgh (1999), Available from,
  22. 22.
    McBride, C.: Elimination with a Motive. In: Callaghan, P., Luo, Z., McKinna, J., Pollack, R. (eds.) TYPES 2000. LNCS, vol. 2277, p. 197. Springer, Heidelberg (2002)CrossRefGoogle Scholar
  23. 23.
    McBride, C.: Epigram: Practical programming with dependent types. In: Vene, V., Uustalu, T. (eds.) AFP 2004. LNCS, vol. 3622, pp. 130–170. Springer, Heidelberg (2005)CrossRefGoogle Scholar
  24. 24.
    McBride, C., McKinna, J.: Functional Pearl: I am not a Number: I am a Free Variable. In: Nilsson, H. (ed.) Proceedings of the ACM SIGPLAN Haskell Workshop 2004, Snowbird, Utah. ACM, New York (2004)Google Scholar
  25. 25.
    McBride, C., McKinna, J.: The view from the left. Journal of Functional Programming 14(1) (2004)Google Scholar
  26. 26.
    Paulin-Mohring, C.: Définitions Inductives en Théorie des Types d’Ordre Supérieur. Habilitation Thesis. Université Claude Bernard, Lyon I (1996)Google Scholar
  27. 27.
    Smith, J.: The Independence of Peano’s Fourth Axiom from Martin-Löf’s Type Theory without Universes. Journal of Symbolic Logic 53(3) (1983)Google Scholar
  28. 28.
    Streicher, T.: Investigations into intensional type theory. Habilitation Thesis, Ludwig Maximilian Universität (1993)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2006

Authors and Affiliations

  • Conor McBride
    • 1
  • Healfdene Goguen
    • 2
  • James McKinna
    • 3
  1. 1.School of Computer Science and Information TechnologyUniversity of Nottingham 
  2. 2.AT&T LabsFlorham Park
  3. 3.School of Computer ScienceUniversity of St Andrews 

Personalised recommendations