A Type of Partial Recursive Functions

  • Ana Bove
  • Venanzio Capretta
Part of the Lecture Notes in Computer Science book series (LNCS, volume 5170)


Our goal is to define a type of partial recursive functions in constructive type theory. In a series of previous articles, we studied two different formulations of partial functions and general recursion. We could obtain a type only by extending the theory with either an impredicative universe or with coinductive definitions. Here we present a new type constructor that eludes such entities of dubious constructive credentials. We start by showing how to break down a recursive function definition into three components: the first component generates the arguments of the recursive calls, the second evaluates them, and the last computes the output from the results of the recursive calls. We use this dissection as the basis for the introduction rule of the new type constructor. Every partial recursive function is associated with an inductive domain predicate; evaluation of the function requires a proof that the input values satisfy the predicate. We give a constructive justification for the new construct by interpreting it into the base type theory. This shows that the extended theory is consistent and constructive.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Audebaud, P.: Partial objects in the calculus of constructions. In: Kahn, G. (ed.) Proceedings of the Sixth Annual IEEE Symp. on Logic in Computer Science, LICS 1991, July 1991, pp. 86–95. IEEE Computer Society Press, Los Alamitos (1991)Google Scholar
  2. 2.
    Bove, A.: General recursion in type theory. In: Geuvers, H., Wiedijk, F. (eds.) TYPES 2002. LNCS, vol. 2646, pp. 39–58. Springer, Heidelberg (2003)CrossRefGoogle Scholar
  3. 3.
    Bove, A., Capretta, V.: Nested general recursion and partiality in type theory. In: Boulton, R.J., Jackson, P.B. (eds.) TPHOLs 2001. LNCS, vol. 2152, pp. 121–135. Springer, Heidelberg (2001)CrossRefGoogle Scholar
  4. 4.
    Bove, A., Capretta, V.: Modelling general recursion in type theory. Mathematical Structures in Computer Science 15(4), 671–708 (2005)MathSciNetCrossRefMATHGoogle Scholar
  5. 5.
    Bove, A., Capretta, V.: Recursive functions with higher order domains. In: Urzyczyn, P. (ed.) TLCA 2005. LNCS, vol. 3461, pp. 116–130. Springer, Heidelberg (2005)CrossRefGoogle Scholar
  6. 6.
    Bove, A., Capretta, V.: Computation by prophecy. In: Della Rocca, S.R. (ed.) TLCA 2007. LNCS, vol. 4583, pp. 70–83. Springer, Heidelberg (2007)CrossRefGoogle Scholar
  7. 7.
    Capretta, V.: Universal algebra in type theory. In: Bertot, Y., Dowek, G., Hirschowitz, A., Paulin, C., Théry, L. (eds.) TPHOLs 1999. LNCS, vol. 1690, pp. 131–148. Springer, Heidelberg (1999)CrossRefGoogle Scholar
  8. 8.
    Capretta, V.: Recursive families of inductive types. In: Aagaard, M.D., Harrison, J. (eds.) TPHOLs 2000. LNCS, vol. 1869, pp. 73–89. Springer, Heidelberg (2000)CrossRefGoogle Scholar
  9. 9.
    Capretta, V.: General recursion via coinductive types. Logical Methods in Computer Science 1(2), 1–18 (2005)MathSciNetCrossRefMATHGoogle Scholar
  10. 10.
    Capretta, V., Uustalu, T., Vene, V.: Recursive coalgebras from comonads. In: Proceedings of the Workshop on Coalgebraic Methods in Computer Science (CMCS 2004). Electronic Notes in Theoretical Computer Science, vol. 106, pp. 43–61 (2004)Google Scholar
  11. 11.
    Capretta, V., Uustalu, T., Vene, V.: Recursive coalgebras from comonads. Information and Computation 204(4), 437–468 (2006)MathSciNetCrossRefMATHGoogle Scholar
  12. 12.
    Constable, R.L.: Constructive mathematics as a programming logic I: Some principles of theory. Annals of Mathematics, vol. 24. Elsevier Science Publishers, North-Holland, Amsterdam (1985)MATHGoogle Scholar
  13. 13.
    Constable, R.L., Mendler, N.P.: Recursive definitions in type theory. In: Parikh, R. (ed.) Logic of Programs 1985. LNCS, vol. 193, pp. 61–78. Springer, Heidelberg (1985)CrossRefGoogle Scholar
  14. 14.
    Constable, R.L., Smith, S.F.: Partial objects in constructive type theory. In: Logic in Computer Science, Ithaca, New York, pp. 183–193. IEEE, Los Alamitos (1987)Google Scholar
  15. 15.
    Coquand, T., Huet, G.: The Calculus of Constructions. Information and Computation 76, 95–120 (1988)MathSciNetCrossRefMATHGoogle Scholar
  16. 16.
    Gödel, K.: Über formal unentscheidbare sätze der Principia Mathematica und verwandter systeme. Monatshefte für Mathematik und Physik 38, 173–198 (1931)MathSciNetCrossRefMATHGoogle Scholar
  17. 17.
    Jones, S.P.: Haskell 98 Language and Libraries: The Revised Report, April 2003. Cambridge University Press, Cambridge (2003)MATHGoogle Scholar
  18. 18.
    Martin-Löf, P.: Intuitionistic Type Theory. Bibliopolis, 1984. Notes by Giovanni Sambin of a series of lectures given in Padua (June 1980)Google Scholar
  19. 19.
    Megacz, A.: A coinductive monad for Prop-bounded recursion. In: Stump, A., Xi, H. (eds.) PLPV 2007: Proceedings of the 2007 workshop on Programming languages meets program verification, pp. 11–20. ACM Press, New York (2007)CrossRefGoogle Scholar
  20. 20.
    Meijer, E., Fokkinga, M.M., Paterson, R.: Functional programming with bananas, lenses, envelopes and barbed wire. In: Hughes, J. (ed.) FPCA 1991. LNCS, vol. 523, pp. 124–144. Springer, Heidelberg (1991)CrossRefGoogle Scholar
  21. 21.
    Nordström, B., Petersson, K., Smith, J.M.: Programming in Martin-Löf’s Type Theory. An Introduction. International Series of Monographs on Computer Scence, vol. 7. Oxford University Press, Oxford (1990)MATHGoogle Scholar
  22. 22.
    Setzer, A.: Partial recursive functions in Martin-Löf Type Theory. In: Beckmann, A., Berger, U., Löwe, B., Tucker, J.V. (eds.) CiE 2006. LNCS, vol. 3988, p. 505. Springer, Heidelberg (2006)CrossRefGoogle Scholar
  23. 23.
    Setzer, A.: A data type of partial recursive functions in Martin-Löf Type Theory, http://www.cs.swan.ac.uk/~csetzer/articles/setzerDataTypeParRecPostProceedings.ps
  24. 24.
    The Coq Development Team. LogiCal Project. The Coq Proof Assistant. Reference Manual. Version 8. INRIA (2004), http://pauillac.inria.fr/coq/coq-eng.html

Copyright information

© Springer-Verlag Berlin Heidelberg 2008

Authors and Affiliations

  • Ana Bove
    • 1
  • Venanzio Capretta
    • 2
  1. 1.Department of Computer Science and EngineeringChalmers University of TechnologyGöteborgSweden
  2. 2.Computer Science Institute (ICIS)Radboud University NijmegenThe Netherlands

Personalised recommendations