Advertisement

Inductive Families Need Not Store Their Indices

  • Edwin Brady
  • Conor McBride
  • James McKinna
Part of the Lecture Notes in Computer Science book series (LNCS, volume 3085)

Abstract

We consider the problem of efficient representation of dependently typed data. In particular, we consider a language TT based on Dybjer’s notion of inductive families [10] and reanalyse their general form with a view to optimising the storage associated with their use. We introduce an execution language, ExTT, which allows the commenting out of computationally irrelevant subterms and show how to use properties of elimination rules to elide constructor arguments and tags in ExTT. We further show how some types can be collapsed entirely at run-time. Several examples are given, including a representation of the simply typed λ-calculus for which our analysis yields an 80% reduction in run-time storage requirements.

Keywords

Type Theory Dependent Type Functional Language Elimination Rule Alternative Implementation 
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.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    Altenkirch, T., Hofmann, M., Streicher, T.: Categorical reconstruction of a reduction free normalization proof (1996)Google Scholar
  2. 2.
    Augustsson, L.: Compiling pattern matching. In: Jouannaud, J.-P. (ed.) Functional Programming Languages and Computer Architecture, September 1985, pp. 368–381. Springer, Heidelberg (1985)Google Scholar
  3. 3.
    Augustsson, L., Carlsson, M.: An exercise in dependent types: A well-typed interpreter (1999), http://www.cs.chalmers.se/~augustss/cayenne/
  4. 4.
    Berardi, S.: Pruning simply typed lambda terms. Journal of Logic and Computation 6(5), 663–681 (1996)zbMATHCrossRefMathSciNetGoogle Scholar
  5. 5.
    Berger, U., Schwichtenberg, H.: An inverse of the evaluation functional for typed λ-calculus. In: Vemuri, R. (ed.) Proceedings of the Sixth Annual IEEE Symposium on Logic in Computer Science, pp. 203–211. IEEE Computer Society Press, Los Alamitos (1991)CrossRefGoogle Scholar
  6. 6.
    Bove, A., Capretta, V.: Modelling general recursion in type theory (September 2002)Google Scholar
  7. 7.
    Callaghan, P., Luo, Z.: Implementation techniques for inductive types in plastic. In: Coquand, T., Nordström, B., Dybjer, P., Smith, J. (eds.) TYPES 1999. LNCS, vol. 1956, pp. 94–113. Springer, Heidelberg (2000)CrossRefGoogle Scholar
  8. 8.
    Coq Development Team. The Coq proof assistant — reference manual (2001)Google Scholar
  9. 9.
    André Lu´ıs de Medeiros Santos. Compilation By Transformatio. In: Non-Strict Functional Languages. PhD thesis, University of Glasgow (1995)Google Scholar
  10. 10.
    Dybjer, P.: Inductive families. Formal Aspects Of Computing 6, 440–465 (1994)zbMATHCrossRefGoogle Scholar
  11. 11.
    Harper, R., Pollack, R.: Type checking with universes. Theoretical Computer Science 89(1), 107–136 (1991)zbMATHCrossRefMathSciNetGoogle Scholar
  12. 12.
    Johnsson, T.: Efficient compilation of lazy evaluation (1984)Google Scholar
  13. 13.
    Letouzey, P.: A new extraction for Coq. In: Geuvers, H., Wiedijk, F. (eds.) TYPES 2002. LNCS, vol. 2646, pp. 200–219. Springer, Heidelberg (2003)CrossRefGoogle Scholar
  14. 14.
    Luo, Z.: Computation and Reasoning – A Type Theory for Computer Science. International Series of Monographs on Computer Science. OUP (1994)Google Scholar
  15. 15.
    Luo, Z., Pollack, R.: Lego proof development system: User’s manual. Technical report, LFCS, University of Edinburgh (1992)Google Scholar
  16. 16.
    Magaud, N., Bertot, Y.: Changing data structures in type theory: A study of natural numbers. In: Callaghan, P., Luo, Z., McKinna, J., Pollack, R. (eds.) TYPES 2000. LNCS, vol. 2277, pp. 181–196. Springer, Heidelberg (2002)CrossRefGoogle Scholar
  17. 17.
    Magnusson, L.: The implementation of ALF – A Proof Editor based on Martin- Löf’s Monomorphic Type Theory with Explicit Substitutions. PhD thesis, Chalmers University of Technology, Göteborg (1994)Google Scholar
  18. 18.
    McBride, C.: Dependently Typed Functional Programs and their proofs. PhD thesis, University of Edinburgh (May 2000)Google Scholar
  19. 19.
    McBride, C., McKinna, J.: The view from the left. Journal of Functional Programming 14(1) (2004)Google Scholar
  20. 20.
    McBride, F.: Computer Aided Manipulation of Symbols. PhD thesis, Queen’s University of Belfast (1970)Google Scholar
  21. 21.
    Paulin-Mohring, C.: Extraction de programmes dans le Calcul des Constructions. PhD thesis, Paris 7 (1989)Google Scholar
  22. 22.
    Jones, S.L.P., Santos, A.L.M.: A transformation-based optimiser for Haskell. Science of Computer Programming 32, 3–47 (1998)zbMATHCrossRefGoogle Scholar
  23. 23.
    Pollack, R.: Implicit syntax. Technical report, LFCS, University of Edinburgh (1992)Google Scholar
  24. 24.
    Sansom, P.M., Jones, S.L.P.: Time and space profiling for non-strict, higher order functional languages (1995)Google Scholar
  25. 25.
    Xi, H.: Dependent Types in Practical Programming. PhD thesis, Department of Mathematical Sciences, Carnegie Mellon University (December 1998)Google Scholar
  26. 26.
    Xi, H.: Dead code elimination through dependent types (1999)Google Scholar
  27. 27.
    Xi, H., Pfenning, F.: Eliminating array bound checking through dependent types (1998)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2004

Authors and Affiliations

  • Edwin Brady
    • 1
  • Conor McBride
    • 1
  • James McKinna
    • 2
  1. 1.Department of Computer ScienceUniversity of Durham 
  2. 2.School of Computer ScienceUniversity of St. Andrews 

Personalised recommendations