A Formalisation of a Dependently Typed Language as an Inductive-Recursive Family

  • Nils Anders Danielsson
Part of the Lecture Notes in Computer Science book series (LNCS, volume 4502)

Abstract

It is demonstrated how a dependently typed lambda calculus (a logical framework) can be formalised inside a language with inductive-recursive families. The formalisation does not use raw terms; the well-typed terms are defined directly. It is hence impossible to create ill-typed terms.

As an example of programming with strong invariants, and to show that the formalisation is usable, normalisation is proved. Moreover, this proof seems to be the first formal account of normalisation by evaluation for a dependently typed language.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. [AA02]
    Abel, A., Altenkirch, T.: A predicative analysis of structural recursion. Journal of Functional Programming 12(1), 1–41 (2002)MATHCrossRefMathSciNetGoogle Scholar
  2. [AAD07]
    Abel, A., Aehlig, K., Dybjer, P.: Normalization by evaluation for Martin-Löf type theory with one universe. Submitted for publication (2007)Google Scholar
  3. [AC06]
    Altenkirch, T., Chapman, J.: Tait in one big step. In: MSFP 2006 (2006)Google Scholar
  4. [Ada04]
    Adams, R.: Formalized metatheory with terms represented by an indexed family of types. In: TYPES 2004. LNCS, vol. 3839, pp. 1–16. Springer, Heidelberg (2004)Google Scholar
  5. [AR99]
    Altenkirch, T., Reus, B.: Monadic presentations of lambda terms using generalized inductive types. In: Flum, J., Rodríguez-Artalejo, M. (eds.) CSL 1999. LNCS, vol. 1683, pp. 453–468. Springer, Heidelberg (1999)CrossRefGoogle Scholar
  6. [BS91]
    Berger, U., Schwichtenberg, H.: An inverse of the evaluation functional for typed λ-calculus. In: LICS 1991, pp. 203–211 (1991)Google Scholar
  7. [BW97]
    Barras, B., Werner, B.: Coq in Coq. Unpublished (1997)Google Scholar
  8. [CD97]
    Coquand, T., Dybjer, P.: Intuitionistic model constructions and normalization proofs. Mathematical Structures in Computer Science 7(1), 75–94 (1997)MATHCrossRefMathSciNetGoogle Scholar
  9. [Coq02]
    Coquand, C.: A formalised proof of the soundness and completeness of a simply typed lambda-calculus with explicit substitutions. Higher-Order and Symbolic Computation 15, 57–90 (2002)MATHCrossRefGoogle Scholar
  10. [Dan07]
    Danielsson, N.A.: Personal web page. available (2007), at http://www.cs.chalmers.se/~nad/
  11. [DS06]
    Dybjer, P., Setzer, A.: Indexed induction-recursion. Journal of Logic and Algebraic Programming 66(1), 1–49 (2006)MATHCrossRefMathSciNetGoogle Scholar
  12. [Dyb96]
    Dybjer, P.: Internal type theory. In: Berardi, S., Coppo, M. (eds.) TYPES 1995. LNCS, vol. 1158, pp. 120–134. Springer, Heidelberg (1996)Google Scholar
  13. [McBa]
    McBride, C.: Beta-normalization for untyped lambda-calculus (unpublished program)Google Scholar
  14. [McBb]
    McBride, C.: Type-preserving renaming and substitution (unpublished)Google Scholar
  15. [ML75]
    Martin-Löf, P.: An intuitionistic theory of types: Predicative part. In: Logic Colloquium ’73, pp. 73–118. North-Holland, Amsterdam (1975)Google Scholar
  16. [ML04]
    Martin-Löf, P.: Normalization by evaluation and by the method of computability. Lecture series given at Logikseminariet Stockholm–Uppsala (2004)Google Scholar
  17. [MM91]
    Mitchell, J.C., Moggi, E.: Kripke-style models for typed lambda calculus. Annals of Pure and Applied Logic 51, 99–124 (1991)MATHCrossRefMathSciNetGoogle Scholar
  18. [MM04]
    McBride, C., McKinna, J.: The view from the left. Journal of Functional Programming 14(1), 69–111 (2004)MATHCrossRefMathSciNetGoogle Scholar
  19. [MP99]
    McKinna, J., Pollack, R.: Some lambda calculus and type theory formalized. Journal of Automated Reasoning 23(3), 373–409 (1999)MATHCrossRefMathSciNetGoogle Scholar
  20. [MW06]
    McKinna, J., Wright, J.: A type-correct, stack-safe, provably correct expression compiler in Epigram. Accepted for publication in the Journal of Functional Programming (2006)Google Scholar
  21. [Nor07]
    Norell, U.: AgdaLight home page. available (2007), at http://www.cs.chalmers.se/~ulfn/agdaLight/
  22. [NPS90]
    Nordström, B., Petersson, K., Smith, J.M.: Programming in Martin-Löf’s Type Theory, An Introduction. Oxford University Press, Oxford (1990)MATHGoogle Scholar
  23. [PL04]
    Pašalić, E., Linger, N.: Meta-programming with typed object-language representations. In: Karsai, G., Visser, E. (eds.) GPCE 2004. LNCS, vol. 3286, pp. 136–167. Springer, Heidelberg (2004)Google Scholar
  24. [XCC03]
    Xi, H., Chen, C., Chen, G.: Guarded recursive datatype constructors. In: POPL 2003, pp. 224–235 (2003)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2007

Authors and Affiliations

  • Nils Anders Danielsson
    • 1
  1. 1.Chalmers University of Technology 

Personalised recommendations