skip to main content
research-article

Foundational extensible corecursion: a proof assistant perspective

Published:29 August 2015Publication History
Skip Abstract Section

Abstract

This paper presents a formalized framework for defining corecursive functions safely in a total setting, based on corecursion up-to and relational parametricity. The end product is a general corecursor that allows corecursive (and even recursive) calls under "friendly" operations, including constructors. Friendly corecursive functions can be registered as such, thereby increasing the corecursor's expressiveness. The metatheory is formalized in the Isabelle proof assistant and forms the core of a prototype tool. The corecursor is derived from first principles, without requiring new axioms or extensions of the logic.

References

  1. M. Abbott, T. Altenkirch, and N. Ghani. Containers: Constructing strictly positive types. Theor. Comput. Sci., 342(1):3–27, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. A. Abel. Termination checking with types. RAIRO—Theor. Inf. Appl., 38(4):277–319, 2004.Google ScholarGoogle Scholar
  3. A. Abel. MiniAgda: Integrating sized and dependent types. In A. Bove, E. Komendantskaya, and M. Niqui, eds., PAR 2010, vol. 43 of EPTCS, pp. 14–28, 2010.Google ScholarGoogle Scholar
  4. A. Abel. Re: {Coq-Club} Propositional extensionality is inconsistent in Coq, 2013. Archived at https://sympa.inria.fr/sympa/arc/ coq-club/2013-12/msg00147.html.Google ScholarGoogle Scholar
  5. A. Abel and B. Pientka. Wellfounded recursion with copatterns: A unified approach to termination and productivity. In G. Morrisett and T. Uustalu, eds., ICFP ’13, pp. 185–196. ACM, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. A. Abel, B. Pientka, D. Thibodeau, and A. Setzer. Copatterns: Programming infinite structures by observations. In R. Giacobazzi and R. Cousot, eds., POPL 2013, pp. 27–38, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. A. Asperti, W. Ricciotti, C. S. Coen, and E. Tassi. The Matita interactive theorem prover. In N. Bjørner and V. Sofronie-Stokkermans, eds., CADE-23, vol. 6803 of LNCS, pp. 64–69. Springer, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. R. Atkey and C. McBride. Productive coprogramming with guarded recursion. In G. Morrisett and T. Uustalu, eds., ICFP ’13, pp. 197–208. ACM, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. F. Bartels. Generalised coinduction. Math. Struct. Comp. Sci., 13(2):321–348, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. F. Bartels. On Generalised Coinduction and Probabilistic Specification Formats: Distributive Laws in Coalgebraic Modelling. Ph.D. thesis, Vrije Universiteit Amsterdam, 2004.Google ScholarGoogle Scholar
  11. N. Benton. The proof assistant as an integrated development environment. In C.-c. Shan, ed., APLAS 2013, vol. 8301 of LNCS, pp. 307–314. Springer, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. J.-P. Bernardy, P. Jansson, and R. Paterson. Proofs for free: Parametricity for dependent types. J. Funct. Program., 22(2):107–152, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Y. Bertot and P. Castéran. Interactive Theorem Proving and Program Development—Coq’Art: The Calculus of Inductive Constructions. Texts in Theoretical Computer Science. Springer, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. J. C. Blanchette, J. Hölzl, A. Lochbihler, L. Panny, A. Popescu, and D. Traytel. Truly modular (co)datatypes for Isabelle/HOL. In G. Klein and R. Gamboa, eds., ITP 2014, vol. 8558 of LNCS, pp. 93–110. Springer, 2014.Google ScholarGoogle Scholar
  15. J. C. Blanchette, A. Popescu, and D. Traytel. Unified classical logic completeness: A coinductive pearl. In S. Demri, D. Kapur, and C. Weidenbach, eds., IJCAR 2014, vol. 8562 of LNCS, pp. 46–60. Springer, 2014.Google ScholarGoogle Scholar
  16. J. C. Blanchette, A. Popescu, and D. Traytel. Formalization associated with this paper. https://github.com/dtraytel/fouco, 2015.Google ScholarGoogle Scholar
  17. J. C. Blanchette, A. Popescu, and D. Traytel. Witnessing (co)datatypes. In J. Vitek, ed., ESOP 2015, vol. 9032 of LNCS, pp. 359–382. Springer, 2015.Google ScholarGoogle Scholar
  18. A. Bove, P. Dybjer, and U. Norell. A brief overview of Agda—A functional language with dependent types. In S. Berghofer, T. Nipkow, C. Urban, and M. Wenzel, eds., TPHOLs 2009, vol. 5674 of LNCS, pp. 73–78. Springer, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. A. Cave, F. Ferreira, P. Panangaden, and B. Pientka. Fair reactive programming. In S. Jagannathan and P. Sewell, eds., POPL ’14, pp. 361–372. ACM, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. R. Clouston, A. Bizjak, H. B. Grathwohl, and L. Birkedal. Programming and reasoning with guarded recursion for coinductive types. In A. M. Pitts, ed., FoSSaCS 2015, vol. 9034 of LNCS, pp. 407–421. Springer, 2015.Google ScholarGoogle Scholar
  21. J. Crow, S. Owre, J. Rushby, N. Shankar, and M. Srivas. A tutorial introduction to PVS. WIFT ’95, 1995.Google ScholarGoogle Scholar
  22. M. Dénès. {Coq-Club} Propositional extensionality is inconsistent in Coq, 2013. Archived at https://sympa.inria.fr/sympa/arc/ coq-club/2013-12/msg00119.html.Google ScholarGoogle Scholar
  23. P. Di Gianantonio and M. Miculan. A unifying approach to recursive and co-recursive definitions. In H. Geuvers and F. Wiedijk, eds., TYPES 2002, vol. 2646 of LNCS, pp. 148–161. Springer, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. C. Elliott and P. Hudak. Functional reactive animation. In S. L. P. Jones, M. Tofte, and A. M. Berman, eds., ICFP ’97, pp. 263–273. ACM, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. J. Endrullis, D. Hendriks, and M. Bodin. Circular coinduction in Coq using bisimulation-up-to techniques. In S. Blazy, C. Paulin-Mohring, and D. Pichardie, eds., ITP 2013, vol. 7998 of LNCS, pp. 354–369. Springer, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. U. Hensel and B. Jacobs. Proof principles for datatypes with iterated recursion. In E. Moggi and G. Rosolini, eds., CTCS ’97, vol. 1290 of LNCS, pp. 220–241. Springer, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. J. Heras, E. Komendantskaya, and M. Schmidt. (Co)recursion in logic programming: Lazy vs eager. Theor. Pract. Log. Prog., 14(4-5), 2014.Google ScholarGoogle Scholar
  28. Supplementary material.Google ScholarGoogle Scholar
  29. R. Hinze. Concrete stream calculus—An extended study. J. Funct. Program., 20:463–535, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. R. Hinze and D. W. H. James. Proving the unique fixed-point principle correct—An adventure with category theory. In ICFP ’11, pp. 359–371, 2011. Extended version available at http://www.cs.ox. ac.uk/people/daniel.james/unique/unique-tech.pdf. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. B. Huffman. A purely definitional universal domain. In S. Berghofer, T. Nipkow, C. Urban, and M. Wenzel, eds., TPHOLs 2009, vol. 5674 of LNCS, pp. 260–275. Springer, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. B. Huffman and O. Kunˇcar. Lifting and Transfer: A modular design for quotients in Isabelle/HOL. In G. Gonthier and M. Norrish, eds., CPP 2013, vol. 8307 of LNCS, pp. 131–146. Springer, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. C.-K. Hur, G. Neis, D. Dreyer, and V. Vafeiadis. The power of parameterization in coinductive proof. In R. Giacobazzi and R. Cousot, eds., POPL ’13, pp. 193–206. ACM, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. B. Jacobs. Distributive laws for the coinductive solution of recursive equations. Inf. Comput., 204(4):561–587, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. C. Keller and M. Lasson. Parametricity in an impredicative sort. In P. Cégielski and A. Durand, eds., CSL 2012, vol. 16 of LIPIcs, pp. 381–395. Schloss Dagstuhl, 2012.Google ScholarGoogle Scholar
  36. B. Klin. Bialgebras for structural operational semantics: An introduction. Theor. Comput. Sci., 412(38):5043–5069, 2011.Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. A. Krauss. Partial recursive functions in higher-order logic. In U. Furbach and N. Shankar, eds., IJCAR 2006, vol. 4130 of LNCS, pp. 589–603. Springer, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. N. R. Krishnaswami and N. Benton. Ultrametric semantics of reactive programs. In LICS 2011, pp. 257–266. IEEE, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. O. Kunˇcar. Correctness of Isabelle’s cyclicity checker—Implementability of overloading in proof assistants. In X. Leroy and A. Tiu, eds., CPP 2015, pp. 85–94. ACM, 2015. Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. O. Kunˇcar and A. Popescu. A consistent foundation for Isabelle/HOL. In C. Urban and X. Zhang, eds., ITP 2015, LNCS. Springer, 2015.Google ScholarGoogle Scholar
  41. K. R. M. Leino and M. Moskal. Co-induction simply—Automatic co-inductive proofs in a program verifier. In C. B. Jones, P. Pihlajasaari, and J. Sun, eds., FM 2014, vol. 8442 of LNCS, pp. 382–398. Springer, 2014.Google ScholarGoogle Scholar
  42. X. Leroy. A formally verified compiler back-end. J. Autom. Reasoning, 43(4):363–446, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  43. A. Lochbihler. Verifying a compiler for Java threads. In A. D. Gordon, ed., ESOP 2010, vol. 6012 of LNCS, pp. 427–447. Springer, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  44. A. Lochbihler. Making the Java memory model safe. ACM Trans. Program. Lang. Syst., 35(4):12:1–65, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  45. A. Lochbihler and J. Hölzl. Recursive functions on lazy lists via domains and topologies. In G. Klein and R. Gamboa, eds., ITP 2014, vol. 8558 of LNCS, pp. 341–357. Springer, 2014.Google ScholarGoogle Scholar
  46. J. Matthews. Recursive function definition over coinductive types. In Y. Bertot, G. Dowek, A. Hirschowitz, C. Paulin, and L. Théry, eds., TPHOLs ’99, vol. 1690 of LNCS, pp. 73–90. Springer, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  47. S. Milius, L. S. Moss, and D. Schwencke. Abstract GSOS rules and a modular treatment of recursive definitions. Log. Meth. Comput. Sci., 9(3), 2013.Google ScholarGoogle Scholar
  48. L. S. Moss. Parametric corecursion. Theor. Comput. Sci., 260(1-2):139–163, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  49. T. Nipkow, L. C. Paulson, and M. Wenzel. Isabelle/HOL: A Proof Assistant for Higher-Order Logic. Springer, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  50. L. C. Paulson. Set theory for verification: I. From foundations to functions. J. Autom. Reasoning, 11(3):353–389, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  51. L. C. Paulson. Set theory for verification: II. Induction and recursion. J. Autom. Reasoning, 15(2):167–215, 1995.Google ScholarGoogle ScholarCross RefCross Ref
  52. A. Popescu and E. L. Gunter. Incremental pattern-based coinduction for process algebra and its Isabelle formalization. In C.-H. L. Ong, ed., FoSSaCS 2010, vol. 6014 of LNCS, pp. 109–127. Springer, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  53. J. C. Reynolds. Types, abstraction and parametric polymorphism. In IFIP ’83, pp. 513–523, 1983.Google ScholarGoogle Scholar
  54. G. Ro¸su and D. Lucanu. Circular coinduction—A proof theoretical foundation. In A. Kurz, M. Lenisa, and A. Tarlecki, eds., CALCO 2009, vol. 5728 of LNCS, pp. 127–144. Springer, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  55. J. Rot, M. M. Bonsangue, and J. J. M. M. Rutten. Coalgebraic bisimulation-up-to. In P. van Emde Boas, F. C. A. Groen, G. F. Italiano, J. R. Nawrocki, and H. Sack, eds., SOFSEM 2013, vol. 7741 of LNCS, pp. 369–381. Springer, 2013.Google ScholarGoogle Scholar
  56. J. J. M. M. Rutten. Processes as terms: Non-well-founded models for bisimulation. Math. Struct. Comp. Sci., 2(3):257–275, 1992.Google ScholarGoogle ScholarCross RefCross Ref
  57. J. J. M. M. Rutten. Universal coalgebra: A theory of systems. Theor. Comput. Sci., 249:3–80, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  58. J. J. M. M. Rutten. A coinductive calculus of streams. Math. Struct. Comp. Sci., 15(1):93–147, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  59. D. Sangiorgi. On the bisimulation proof method. Math. Struct. Comp. Sci., 8(5):447–479, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  60. D. Traytel. {Agda} Agda’s copatterns incompatible with initial algebras, 2014. Archived at https: //lists.chalmers.se/pipermail/agda/2014/006759.html.Google ScholarGoogle Scholar
  61. D. Traytel, A. Popescu, and J. C. Blanchette. Foundational, compositional (co)datatypes for higher-order logic—Category theory applied to theorem proving. In LICS 2012, pp. 596–605. IEEE, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  62. D. Turi and G. Plotkin. Towards a mathematical operational semantics. In LICS 1997, pp. 280–291. IEEE, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  63. D. A. Turner. Elementary strong functional programming. In P. H. Hartel and M. J. Plasmeijer, eds., FPLE ’95, vol. 1022 of LNCS, pp. 1–13. Springer, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  64. P. Wadler. Theorems for free! In FPCA ’89, pp. 347–359. ACM, 1989. Google ScholarGoogle ScholarDigital LibraryDigital Library
  65. G. Winskel. A note on model checking the modal ν-calculus. Theor. Comput. Sci., 83(1):157–167, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Foundational extensible corecursion: a proof assistant perspective

        Recommendations

        Comments

        Login options

        Check if you have access through your login credentials or your institution to get full access on this article.

        Sign in

        Full Access

        • Published in

          cover image ACM SIGPLAN Notices
          ACM SIGPLAN Notices  Volume 50, Issue 9
          ICFP '15
          September 2015
          436 pages
          ISSN:0362-1340
          EISSN:1558-1160
          DOI:10.1145/2858949
          • Editor:
          • Andy Gill
          Issue’s Table of Contents
          • cover image ACM Conferences
            ICFP 2015: Proceedings of the 20th ACM SIGPLAN International Conference on Functional Programming
            August 2015
            436 pages
            ISBN:9781450336697
            DOI:10.1145/2784731

          Copyright © 2015 ACM

          Publisher

          Association for Computing Machinery

          New York, NY, United States

          Publication History

          • Published: 29 August 2015

          Check for updates

          Qualifiers

          • research-article

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader
        About Cookies On This Site

        We use cookies to ensure that we give you the best experience on our website.

        Learn more

        Got it!