Skip to main content Accessibility help
×
×
Home

Partiality and recursion in interactive theorem provers – an overview

  • ANA BOVE (a1), ALEXANDER KRAUSS (a2) and MATTHIEU SOZEAU (a3)
Abstract

The use of interactive theorem provers to establish the correctness of critical parts of a software development or for formalizing mathematics is becoming more common and feasible in practice. However, most mature theorem provers lack a direct treatment of partial and general recursive functions; overcoming this weakness has been the objective of intensive research during the last decades. In this article, we review several techniques that have been proposed in the literature to simplify the formalization of partial and general recursive functions in interactive theorem provers. Moreover, we classify the techniques according to their theoretical basis and their practical use. This uniform presentation of the different techniques facilitates the comparison and highlights their commonalities and differences, as well as their relative advantages and limitations. We focus on theorem provers based on constructive type theory (in particular, Agda and Coq) and higher-order logic (in particular Isabelle/HOL). Other systems and logics are covered to a certain extent, but not exhaustively. In addition to the description of the techniques, we also demonstrate tools which facilitate working with the problematic functions in particular theorem provers.

Copyright
References
Hide All
Abel, A. (1998) Foetus – termination checker for simple functional programs. Programming Lab Report. Available at http://www.tcs.informatik.uni-muenchen.de/abel/foetus/.
Abel, A. (2006) A Polymorphic Lambda-Calculus with Sized Higher-Order Types, Ph.D. thesis, Ludwig-Maximilians-Universität München.
Abel, A. (2008) Semi-continuous sized types and termination. Logical Methods in Computer Science 4 (2) 133. CSL'06 special issue.
Abel, A. (2010) MiniAgda: Integrating sized and dependent types. In: Bove et al. (2010) 14–28.
Abel, A. and Altenkirch, T. (2002) A predicative analysis of structural recursion. Journal of Functional Programming 12 141.
Abramsky, S. and Jung, A. (1994) Domain theory. In: Abramsky, S., Gabbay, D. M. and Maibaum, T. S. E. (eds.) Handbook of Logic in Computer Science, volume 3, Oxford University Press 1168.
Aczel, P. (1977a) An introduction to inductive definitions. In: Barwise, J. (ed.) Handbook of Mathematical Logic, North-Holland Publishing Company 739782.
Aczel, P. (1977b) The strength of Martin-Löf's intuitionistic type theory with one universe. In: Miettinen, S. and Vnanen, J. (eds.) Proceedings of the Symposium on Mathematical Logic (Oulu, 1974), Report No. 2, Department of Philosopy, University of Helsinki, Helsinki 132.
Agda (2008) Agda wiki. Available at http://wiki.portal.chalmers.se/agda/agda.php.
Ait Mohamed, O., Muñoz, C. and Tahar, S. (eds.) (2008) In: Theorem Proving in Higher Order Logics (TPHOLs 2008), Proceedings of 21st International Conference, Montreal, Canada, August 18–21, 2008. Springer-Verlag Lecture Notes in Computer Science 5170 319 pp.
Audebaud, P. (1991) Partial objects in the calculus of constructions. In: Kahn, G. (ed.) Logic in Computer Science (LICS 1991), IEEE 8695.
Balaa, A. and Bertot, Y. (2000) Fix-point equations for well-founded recursion in type theory. In: Aagaard, M. and Harrison, J. (eds.) Theorem Proving in Higher Order Logics (TPHOLs 2000). Springer-Verlag Lecture Notes in Computer Science 1869 116.
Balaa, A. and Bertot, Y. (2002) Fonctions récursives générales par itération en théorie des types. Journées Francophones des Langages Applicatifs - JFLA02, INRIA.
Barringer, H., Cheng, J. H. and Jones, C. B. (1984) A logic covering undefinedness in program proofs. Acta Informatica 21 251269.
Barthe, G. and Courtieu, P. (2002) Efficient reasoning about executable specifications in Coq. In: Carreno, V. A., Muñoz, C. and Tahar, S. (eds.) Theorem Proving in Higher-Order Logics (TPHOLs 2002). Springer-Verlag Lecture Notes in Computer Science 2410 3146.
Barthe, G., Forest, J., Pichardie, D. and Rusu, V. (2006) Defining and reasoning about recursive functions: A practical tool for the Coq proof assistant. In: Hagiya, M. and Wadler, P. (eds.) Functional and Logic Programming (FLOPS 2006). Springer-Verlag Lecture Notes in Computer Science 3945 114129.
Barthe, G., Frade, M. J., Giménez, E., Pinto, L. and Uustalu, T. (2004) Type-based termination of recursive definitions. Mathematical Structures in Computer Science 14 (1) 97141.
Barthe, G., Grégoire, B. and Pastawski, F. (2006) CIC^: Type-based termination of recursive definitions in the calculus of inductive constructions. In: Hermann, M. and Voronkov, A. (eds.) Logic for Programming, Artificial Intelligence, and Reasoning (LPAR 2006). Springer-Verlag Lecture Notes in Computer Science 4246 257271.
Barthe, G., Grégoire, B. and Riba, C. (2008) Type-based termination with sized products. In: Kaminski, M. and Martini, S. (eds.) CSL. Springer Lecture Notes in Computer Science 5213 493507.
Barthe, G., Grégoire, B. and Riba, C. (2009) A tutorial on type-based termination. In: Bove, A., Barbosa, L. S., Pardo, A. and Pinto, J. S. (eds.) Language Engineering and Rigorous Software Development. Springer-Verlag Lecture Notes in Computer Science 5520 100152.
Berghofer, S. and Nipkow, T. (2000) Executing higher order logic. In: Callaghan et al. (2002) 24–40.
Berghofer, S. and Wenzel, M. (1999) Inductive datatypes in HOL – lessons learned in formal-logic engineering. In: Bertot et al. (1999) 19–36.
Bertot, Y., Capretta, V. and Das Barman, K. (2002) Type-theoretic functional semantics. In: Carreno, V. A., Muñoz, C. A. and Tahar, S. (eds.) Theorem Proving in Higher Order Logics: 15th International Conference, TPHOLs 2002. Springer-Verlag Lecture Notes in Computer Science 2410 8397.
Bertot, Y. and Castéran, P. (2004) Interactive Theorem Proving and Program Development. Coq'Art: The Calculus of Inductive Constructions, Springer Verlag.
Bertot, Y., Dowek, G., Hirschowitz, A., Paulin, C. and Théry, L. (eds.) (1999) In: Theorem Proving in Higher Order Logics (TPHOLs '99). Springer-Verlag Lecture Notes in Computer Science 1690 358 pp.
Bertot, Y. and Komendantsky, V. (2008) Fixed point semantics and partial recursion in Coq. In: Antoy, S. and Albert, E. (eds.) Principles and Practice of Declarative Programming (PPDP '08), ACM, New York, NY, USA 8996.
Blanqui, F. (2004) A type-based termination criterion for dependently-typed higher-order rewrite systems. In: van Oostrom, V. (ed.) Rewriting Techniques and Applications, 15th International Conference, RTA 2004, Aachen, Germany, June 3–5, 2004, Proceedings. Springer Lecture Notes in Computer Science 3091 2439.
Blanqui, F. (2005) Decidability of type-checking in the calculus of algebraic constructions with size annotations. In: Ong, L. (ed.) Computer Science Logic (CSL 2005). Springer-Verlag Lecture Notes in Computer Science 3634 135150.
Bove, A. (2009) Another look at function domains. In: Abramsky, S., Mislove, M. and Palamidessi, C. (eds.) Mathematical Foundations of Programming Semantics (MFPS 2009). Electronic Notes in Theoretical Computer Science 249C 6174.
Bove, A. and Capretta, V. (2005a) Modelling general recursion in type theory. Mathematical Structures in Computer Science 15 (4) 671708.
Bove, A. and Capretta, V. (2005b) Recursive functions with higher-order domains. In: Urzyczyn, P. (ed.) Typed Lambda Calculi and Applications (TLCA 2005). Springer-Verlag Lecture Notes in Computer Science 3461 116130.
Bove, A. and Capretta, V. (2007) Computation by prophecy. In: Rocca, S. R. D. (ed.) Typed Lambda Calculi and Applications (TLCA 2007). Springer-Verlag Lecture Notes in Computer Science 4583 7083.
Bove, A. and Capretta, V. (2008) A type of partial recursive functions. In: Ait Mohamed et al. (2008) 102–117.
Bove, A., Dybjer, P. and Sicard-Ramírez, A. (2009) Embedding a logical theory of constructions in Agda, Programming Languages meets Program Verification (PLPV) 2009, ACM Digital Library.
Bove, A., Dybjer, P. and Sicard-Ramírez, A. (2012) Combining interactive and automatic reasoning in first order theories of functional programs. In: Birkedal, L. (ed.) 15th International Conference on Foundations of Software Science and Computational Structures, FoSSaCS 2012. Lecture Notes in Computer Science 7213 104118.
Bove, A., Komendantskaya, E. and Niqui, M. (eds.) (2010) Workshop on Partiality and Recursion in Interative Theorem Provers (PAR 2010), Satellite Workshop of ITP'10 at FLoC 2010. Electronic Proceedings in Theoretical Computer Science 43 93 pp.
Boyer, R. S. and Moore, J. S. (1979) A Computational Logic, Academic Press, New York.
Boyer, R. S. and Moore, J. S. (1996) Mechanized formal reasoning about programs and computing machines. In: Veroff, R. (ed.) Automated Reasoning and Its Applications: Essays in Honor of Larry Wos, MIT Press.
Bulwahn, L., Krauss, A. and Nipkow, T. (2007) Finding lexicographic orders for termination proofs in Isabelle/HOL. In: Schneider, K. and Brandt, J. (eds.) Theorem Proving in Higher Order Logics (TPHOLs 2007). Springer-Verlag Lecture Notes in Computer Science 4732 3853.
Callaghan, P., Luo, Z., McKinna, J. and Pollack, R. (eds.) (2002) In: Types for Proofs and Programs, International Workshop, TYPES 2000, Durham, UK, December 8–12, 2000, Selected Papers. Springer-Verlag Lecture Notes in Computer Science 2277 245 pp.
Capretta, V. (2005) General recursion via coinductive types. Logical Methods in Computer Science 1 (2) 118.
Charguéraud, A. (2010) The optimal fixed point combinator. In: Kaufmann and Paulson (2010) 195–210.
Cheng, J. H. and Jones, C. B. (1991) On the usability of logics which handle partial functions. In: Morgan, C. and Woodcock, J. C. P. (eds.) 3rd Refinement Workshop, Springer Verlag 5169.
Constable, R. L. and Mendler, N. P. (1985) Recursive definitions in type theory. In: Parikh, R. (ed.) Logic of Programs. Springer-Verlag Lecture Notes in Computer Science 193 6178.
Constable, R. L. and Smith, S. F. (1987) Partial objects in constructive type theory. Logic in Computer Science (LICS 1987), IEEE, Washington, DC 183193.
development team (2010) Coq 8.3 Reference Manual, INRIA. http://coq.inria.fr/refman/.
Coquand, T. and Huet, G. (1988) The calculus of constructions. Information and Computation 76 (2/3) 95120.
Coquand, T. and Paulin, C. (1990) Inductively defined types. In: Martin-Löf, P. and Mints, G. (eds.) Proceedings of Colog '88. Springer-Verlag Lecture Notes in Computer Science 417 5066.
Di Gianantonio, P. and Miculan, M. (2003) A unifying approach to recursive and co-recursive definitions. In: Geuvers, H. and Wiedijk, F. (eds.) Types for Proofs and Programs (TYPES 2002). Springer-Verlag Lecture Notes in Computer Science 2646 148161.
Dubois, C. and Donzeau-Gouge, V. V. (1998) A step towards the mechanization of partial functions: domains as inductive predicates. CADE-15 Workshop on Mechanization of Partial Functions.
Dybjer, P. (1985) Program verification in a logical theory of constructions. In: Jouannaud, J.-P. (ed.) Functional Programming Languages and Computer Architecture. Lecture Notes in Computer Science 201 334349.
Dybjer, P. (1991) Inductive sets and families in Martin-Löf's type theory and their set-theoretic semantics. Logical Frameworks, Cambridge University Press 280306.
Dybjer, P. (2000) A general formulation of simultaneous inductive-recursive definitions in type theory. Journal of Symbolic Logic 65 (2) 525549.
Farmer, W. M. (1993) A simple type theory with partial functions and subtypes. Annals of Pure and Applied Logic 64 (3) 211240.
Farmer, W. M., Guttman, J. D. and Thayer, F. J. (1993) IMPS: An interactive mathematical proof system. Journal of Automated Reasoning 11 653654.
Finn, S., Fourman, M. and Longley, J. (1997) Partial functions in a total setting. Journal of Automated Reasoning 18 (1) 85104.
Furbach, U. and Shankar, N. (eds.) (2006) In: Automated Reasoning, 3rd International Joint Conference, IJCAR 2006, Seattle, WA, USA, August 17-20, 2006, Proceedings. Springer Verlag Lecture Notes in Artificial Intelligence 4130 680 pp.
Giesl, J. (1997) Termination of nested and mutually recursive algorithms. Journal of Automated Reasoning 19 (1) 129.
Giesl, J. (2001) Induction proofs with partial functions. Journal of Automated Reasoning 26 (1) 149.
Giménez, E. (1995) Codifying guarded definitions with recursive schemes. In: Dybjer, P., Nordström, B. and Smith, J. M. (eds.) Types for Proofs and Programs (TYPES 1994). Springer-Verlag Lecture Notes in Computer Science 996 3959.
Goguen, H., McBride, C. and McKinna, J. (2006) Eliminating dependent pattern matching. In: Futatsugi, K., Jouannaud, J.-P. and Meseguer, J. (eds.) Algebra, Meaning, and Computation, Essays Dedicated to Joseph A. Goguen. Springer-Verlag Lecture Notes in Computer Science 4060 521540.
Gordon, M. J. C. and Melham, T. F. (eds.) (1993) Introduction to HOL: A Theorem Proving Environment for Higher Order Logic, Cambridge University Press.
Gordon, M. J. C., Milner, R. and Wadsworth, C. P. (1979) Edinburgh LCF: A Mechanised Logic of Computation. Springer-Verlag Lecture Notes in Computer Science 78 162 pp.
Greve, D. (2009) Assuming termination. ACL2 Workshop Proceedings.
Haftmann, F. and Nipkow, T. (2010) Code generation via higher-order rewrite systems. In: Blume, M., Kobayashi, N. and Vidal, G. (eds.) Functional and Logic Programming (FLOPS 2010). Springer-Verlag Lecture Notes in Computer Science 6009 103117.
Harrison, J. (1995) Inductive definitions: Automation and application. In: Schubert et al. (1995) 200–213.
Howard, W. A. (1980) The formulae-as-types notion of construction. In: Seldin, J. P. and Hindley, J. R. (eds.) To H.B. Curry: Essays on Combinatory Logic, Lambda Calculus and Formalism, Academic Press, London 479490.
Huffman, B. (2008) Reasoning with powerdomains in Isabelle/HOLCF. In: Ait Mohamed, O., Muñoz, C. and Tahar, S. (eds.) TPHOLs 2008: Emerging Trends Proceedings, Department of Electrical and Computer Engineering, Concordia University 45–56.
Huffman, B. (2009) A purely definitional universal domain. In: Berghofer, S., Nipkow, T., Urban, C. and Wenzel, M. (eds.) Theorem Proving in Higher Order Logics (TPHOLs 2009). Springer-Verlag Lecture Notes in Computer Science 5674 260275.
Hughes, J., Pareto, L. and Sabry, A. (1996) Proving the correctness of reactive systems using sized types, Principles of Programming Languages (POPL 1996), ACM 410423.
Jones, C. B. (1990) Systematic Software Development using VDM, Prentice-Hall.
Kaufmann, M. and Paulson, L. C. (eds.) (2010) In: Interactive Theorem Proving, Proceedings of 1st International Conference, ITP 2010, Edinburgh, UK, 11–14 July, 2010. Springer-Verlag Lecture Notes in Computer Science 6172 497 pp.
Krauss, A. (2006) Partial recursive functions in higher-order logic. In: Furbach and Shankar (2006) 589–603.
Krauss, A. (2007) Certified size-change termination. In: Pfenning, F. (ed.) Automated Deduction (CADE-21). Springer-Verlag Lecture Notes in Computer Science 4603 460476.
Krauss, A. (2010a) Partial and nested recursive function definitions in higher-order logic. Journal of Automated Reasoning 44 (4) 303336.
Krauss, A. (2010b) Recursive definitions of monadic functions. In: Bove et al. (2010) 1–13.
Krstić, S. and Matthews, J. (2003) Inductive invariants for nested recursion. In: Basin, D. A. and Wolff, B. (eds.) Theorem Proving in Higher Order Logics (TPHOLs 2003). Springer-Verlag Lecture Notes in Computer Science 2758 253269.
Leroy, X. (2006) Formal certification of a compiler back-end, or: programming a compiler with a proof assistant. In: Morrisett, J. G. and Peyton Jones, S. L. (eds.) Principles of Programming Languages (POPL 2006), ACM Press 4254.
Manna, Z. and Shamir, A. (1976) The theoretical aspects of the optimal fixed point. SIAM Journal on Computing 5 (3) 414426.
Manolios, P. and Moore, J. S. (2003) Partial functions in ACL2. Journal of Automated Reasoning 31 (2) 107127.
Martin-Löf, P. (1984) Intuitionistic Type Theory, Bibliopolis, Napoli.
Matthews, J. (1999) Recursive function definition over coinductive types. In: Bertot et al. (1999) 73–90.
McBride, C. (2002) Elimination with a motive. In: Callaghan et al. (2002) 197–216.
McBride, C. (2003) First-order unification by structural recursion. Journal of Functional Programming 13 (6) 10611075.
McBride, C. (2004) Epigram: Practical programming with dependent types. In: Vene, V. and Uustalu, T. (eds.) Advanced Functional Programming (AFP 2004), Springer-Verlag Lecture Notes in Computer Science 3622 130170.
McBride, C. and McKinna, J. (2004) The view from the left. Journal of Functional Programming 14 (1) 69111.
Megacz, A. (2007) A coinductive monad for Prop-bounded recursion. In: Stump, A. and Xi, H. (eds.) Programming Languages meets Program Verification (PLPV 2007), ACM, New York, NY, USA 1120.
Milner, R. (1972) Logic for computable functions: Description of a machine implementation, Technical report, Stanford, CA, USA.
Moggi, E. (1991) Notions of computation and monads. Information and Computation 93 (1) 5592.
Müller, O., Nipkow, T., von Oheimb, D. and Slotosch, O. (1999) HOLCF=HOL+LCF. Journal of Functional Programming 9 (2) 191223.
Nipkow, T., Bauer, G. and Schultz, P. (2006) Flyspeck I: Tame graphs. In: Furbach and Shankar (2006) 21–35.
Nipkow, T., Paulson, L. C. and Wenzel, M. (2002) Isabelle/HOL – A Proof Assistant for Higher-Order Logic , Springer Verlag Lecture Notes in Computer Science 2283 215 pp.
Nordström, B. (1988) Terminating general Recursion. BIT 28 (3) 605619.
Nordström, B., Petersson, K. and Smith, J. (1990) Programming in Martin-Löf's Type Theory. An Introduction, Oxford University Press.
Norell, U. (2007) Towards a Practical Programming Language Based on Dependent Type Theory, Ph.D. thesis, Chalmers University of Technology.
OCaml (1996) Ocaml web page. Available at http://caml.inria.fr/ocaml/.
Owens, S. and Slind, K. (2008) Adapting functional programs to higher-order logic. Higher-Order and Symbolic Computation 21 (4) 377409.
Paulin-Mohring, C. (1993) Inductive definitions in the system Coq - rules and properties. In: Typed Lambda Calculi and Applications (TLCA 1993). Springer-Verlag Lecture Notes in Computer Science 664 328345.
Paulin-Mohring, C. (2009) A constructive denotational semantics for Kahn networks in Coq. In: Bertot, Y., Huet, G., Levy, J.-J. and Plotkin, G. (eds.) From Semantics and Computer Science: Essays in Honor of Gilles Kahn, Cambridge University Press.
Paulson, L. C. (1986) Constructing recursion operators in intuitionistic type theory. Journal of Symbolic Computation 2 (4) 325355.
Paulson, L. C. (1989) The foundation of a generic theorem prover. Journal of Automated Reasoning 5 (3) 363397.
Peyton Jones, S. (ed.) (2003) Haskell 98 Language and Libraries The Revised Report, Cambridge University Press.
Regensburger, F. (1995) HOLCF: Higher order logic of computable functions. In: Schubert et al. (1995) 293–307.
Schubert, E. T., Windley, P. J. and Alves-Foss, J. (eds.) (1995) In: Higher Order Logic Theorem Proving and its Applications, Proceedings of 8th International Workshop, Aspen Grove, UT, USA, 11–14 September, 1995. Springer-Verlag Lecture Notes in Computer Science 971 400 pp.
Scott, D. S. (1993) A type-theoretical alternative to iswim, cuch, owhy. Theoretical Computer Science 121 411440.
Setzer, A. (2006) Partial recursive functions in Martin-Löf type theory. In: Beckmann, A., Berger, U., Löwe, B. and Tucker, J. V. (eds.) Logical Approaches to Computational Barriers: Proceedings of 2nd Conference on Computability in Europe, CiE 2006, Swansea, UK, 30 June-5 July, 2006. Springer Lecture Notes in Computer Science 3988 505515.
Setzer, A. (2007) A data type of partial recursive functions in Martin-Löf type theory. 35 pp, submitted.
Slind, K. (1996) Function definition in higher-order logic. In: von Wright, J., Grundy, J. and Harrison, J. (eds.) Theorem Proving in Higher Order Logics (TPHOLs '96). Springer-Verlag Lecture Notes in Computer Science 1125 381397.
Slind, K. (1999) Reasoning About Terminating Functional Programs, Ph.D. thesis, Institut für Informatik, Technische Universität München.
Sozeau, M. (2006) Subset coercions in Coq. In: Altenkirch, T. and McBride, C. (eds.) TYPES. Springer-Verlag Lecture Notes in Computer Science 4502 237252.
Sozeau, M. (2010) Equations: A dependent pattern matching compiler. In: Kaufmann and Paulson (2010) 419–434.
Sutcliffe, G. (2009) The TPTP problem library and associated infrastructure. The FOT and CNF parts, v.3.5.0. Journal of Automated Reasoning 43 (4) 337362.
Wahlstedt, D. (2007) Dependent Type Theory with Parameterized First-Order Data Types and Well-Founded Recursion, Ph.D. thesis, Chalmers University of Technology.
Wenzel, M., Paulson, L. C. and Nipkow, T. (2008) The Isabelle framework. In: Ait Mohamed et al. (2008) 33–38.
Xi, H. (2001) Dependent types for program termination verification. Logic in Computer Science (LICS 2001), IEEE 231242.
Recommend this journal

Email your librarian or administrator to recommend adding this journal to your organisation's collection.

Mathematical Structures in Computer Science
  • ISSN: 0960-1295
  • EISSN: 1469-8072
  • URL: /core/journals/mathematical-structures-in-computer-science
Please enter your name
Please enter a valid email address
Who would you like to send this to? *
×

Metrics

Full text views

Total number of HTML views: 0
Total number of PDF views: 0 *
Loading metrics...

Abstract views

Total abstract views: 0 *
Loading metrics...

* Views captured on Cambridge Core between <date>. This data will be updated every 24 hours.

Usage data cannot currently be displayed