Abstract
We propose a (limited) solution to the problem of constructing stream values defined by recursive equations that do not respect the guardedness condition. The guardedness condition is imposed on definitions of corecursive functions in Coq, AGDA, and other higher-order proof assistants. In this paper, we concentrate in particular on those non-guarded equations where recursive calls appear under functions. We use a correspondence between streams and functions over natural numbers to show that some classes of non-guarded definitions can be modelled through the encoding as structural recursive functions. In practice, this work extends the class of stream values that can be defined in a constructive type theory-based theorem prover with inductive and coinductive types, structural recursion and guarded corecursion.
Work is partially supported by the INRIA CORDI post-doctoral program, the ANR project “A3Pat” ANR-05-BLAN-0146 and by EPSRC postdoctoral grant EP/F044046/1.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Abel, A.: Type-Based Termination. A Polymorphic Lambda-Calculus with Sized Higher-Order Types. PhD thesis, Fakultät für Mathematik, Informatik und Statistik der Ludwig-Maximilians-Universität München (2006)
Barthe, G., Courtieu, P.: Efficient Reasoning about Executable Specifications in Coq. In: Carreño, V.A., Muñoz, C.A., Tahar, S. (eds.) TPHOLs 2002. LNCS, vol. 2410, pp. 31–46. Springer, Heidelberg (2002)
Barthe, G., Frade, M.J., Giménez, E., Pinto, L., Uustalu, T.: Type-based termination of recursive definitions. Mathematical Structures in Computer Science 14, 97–141 (2004)
Bertot, Y.: Filters and co-inductive streams, an application to Eratosthenes’ sieve. In: Urzyczyn, P. (ed.) TLCA 2005. LNCS, vol. 3461, pp. 102–115. Springer, Heidelberg (2005)
Bertot, Y., Castéran, P.: Interactive Theorem Proving and Program Development, Coq’Art: the Calculus of Constructions. Springer, Heidelberg (2004)
Bertot, Y., Komendantskaya, E.: Experiments on using structural recursion for corecursion: Coq code (2008), http://hal.inria.fr/inria-00322331/
Bertot, Y., Komendantskaya, E.: Inductive and coinductive components of corecursive functions in Coq. Electr. Notes Theor. Comput. Sci. 203(5), 25–47 (2008)
Bove, A.: General Recursion in Type Theory. PhD thesis, Department of Computing Science, Chalmers University of Technology (2002)
Bronson, S.: Posting to Coq club. Codata: problem with guardedness condition? (June 30, 2008), http://pauillac.inria.fr/pipermail/coq-club/2008/003783.html
Coquand, T.: Infinite objects in type theory. In: Barendregt, H., Nipkow, T. (eds.) TYPES 1993. LNCS, vol. 806, pp. 62–78. Springer, Heidelberg (1994)
Danielsson, N.A.: Posting to Coq club. Codata: problem with guardedness condition? An ad-hoc approach to productive definitions (1,4 August 2008), http://pauillac.inria.fr/pipermail/coq-club/2008/003859.html and http://sneezy.cs.nott.ac.uk/fplunch/weblog/?p=109
Dijkstra, E.W.: Hamming’s exercise in SASL, circulated privately (June 1981)
Endrullis, J., Grabmayer, C., Hendriks, D., Isihara, A., Klop, J.W.: Productivity of stream definitions. In: Csuhaj-Varjú, E., Ésik, Z. (eds.) FCT 2007. LNCS, vol. 4639, pp. 274–287. Springer, Heidelberg (2007)
Gianantonio, P.D., Miculan, M.: A unifying approach to recursive and co-recursive definitions. In: Geuvers, H., Wiedijk, F. (eds.) TYPES 2002. LNCS, vol. 2646, pp. 148–161. Springer, Heidelberg (2003)
Giménez, E.: Un Calcul de Constructions Infinies et son Application à la Vérification des Systèmes Communicants. PhD thesis, Laboratoire de l’Informatique du Parallélisme, Ecole Normale Supérieure de Lyon (1996)
Gordon, M.J.C., Melham, T.F.: Introduction to HOL: a theorem proving environment for higher-order logic. Cambridge University Press, Cambridge (1993)
Hughes, J., Pareto, L., Sabry, A.: Proving the correctness of reactive systems using sized types. In: POPL, pp. 410–423 (1996)
Jacobs, B., Rutten, J.: A tutorial on (co)algebras and (co)induction. EATCS Bulletin 62, 222–259 (1997)
Karczmarczuk, J.: Functional differentiation of computer programs. Higher-Order and Symbolic Computation 14(1), 35–57 (2001)
Nipkow, T., Paulson, L.C., Wenzel, M. (eds.): Isabelle/HOL - A Proof Assistant for Higher-Order Logic. LNCS, vol. 2283. Springer, Heidelberg (2002)
Niqui, M.: Coinductive field of exact real numbers and general corecursion. In: Proc. of CMCS 2006. ENTCS, vol. 164, pp. 121–139. Elsevier, Amsterdam (2006)
Nordström, B.: Terminating general recursion. BIT 28, 605–619 (1988)
Paulson, L.: Mechanizing coinduction and corecursion in higher-order logic. Logic and Computation 2(7), 175–204 (1997)
Regensburger, F.: Holcf: Higher order logic of computable functions. In: Schubert, E.T., Alves-Foss, J., Windley, P. (eds.) HUG 1995. LNCS, vol. 971, pp. 293–307. Springer, Heidelberg (1995)
Sijtsma, B.: On the productivity of recursive list definitions. ACM Transactions on Programing Languages and Systems 11(4), 633–649 (1989)
Slind, K.: Function definition in higher order logic. In: von Wright, J., Harrison, J., Grundy, J. (eds.) TPHOLs 1996. LNCS, vol. 1125, Springer, Heidelberg (1996)
The Agda Development Team. The agda reference manual, http://appserv.cs.chalmers.se/users/ulfn/wiki/agda.php
The Coq Development Team. The Coq proof assistant reference manual, http://coq.inria.fr
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2009 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Bertot, Y., Komendantskaya, E. (2009). Using Structural Recursion for Corecursion. In: Berardi, S., Damiani, F., de’Liguoro, U. (eds) Types for Proofs and Programs. TYPES 2008. Lecture Notes in Computer Science, vol 5497. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-02444-3_14
Download citation
DOI: https://doi.org/10.1007/978-3-642-02444-3_14
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-02443-6
Online ISBN: 978-3-642-02444-3
eBook Packages: Computer ScienceComputer Science (R0)