Nothing Special   »   [go: up one dir, main page]

skip to main content
10.1145/2784731.2784732acmconferencesArticle/Chapter ViewAbstractPublication PagesicfpConference Proceedingsconference-collections
research-article

Foundational extensible corecursion: a proof assistant perspective

Published: 29 August 2015 Publication History

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.
[2]
A. Abel. Termination checking with types. RAIRO—Theor. Inf. Appl., 38(4):277–319, 2004.
[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.
[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.
[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.
[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.
[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.
[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.
[9]
F. Bartels. Generalised coinduction. Math. Struct. Comp. Sci., 13(2):321–348, 2003.
[10]
F. Bartels. On Generalised Coinduction and Probabilistic Specification Formats: Distributive Laws in Coalgebraic Modelling. Ph.D. thesis, Vrije Universiteit Amsterdam, 2004.
[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.
[12]
J.-P. Bernardy, P. Jansson, and R. Paterson. Proofs for free: Parametricity for dependent types. J. Funct. Program., 22(2):107–152, 2012.
[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.
[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.
[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.
[16]
J. C. Blanchette, A. Popescu, and D. Traytel. Formalization associated with this paper. https://github.com/dtraytel/fouco, 2015.
[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.
[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.
[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.
[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.
[21]
J. Crow, S. Owre, J. Rushby, N. Shankar, and M. Srivas. A tutorial introduction to PVS. WIFT ’95, 1995.
[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.
[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.
[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.
[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.
[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.
[27]
J. Heras, E. Komendantskaya, and M. Schmidt. (Co)recursion in logic programming: Lazy vs eager. Theor. Pract. Log. Prog., 14(4-5), 2014.
[28]
Supplementary material.
[29]
R. Hinze. Concrete stream calculus—An extended study. J. Funct. Program., 20:463–535, 2010.
[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.
[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.
[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.
[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.
[34]
B. Jacobs. Distributive laws for the coinductive solution of recursive equations. Inf. Comput., 204(4):561–587, 2006.
[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.
[36]
B. Klin. Bialgebras for structural operational semantics: An introduction. Theor. Comput. Sci., 412(38):5043–5069, 2011.
[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.
[38]
N. R. Krishnaswami and N. Benton. Ultrametric semantics of reactive programs. In LICS 2011, pp. 257–266. IEEE, 2011.
[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.
[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.
[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.
[42]
X. Leroy. A formally verified compiler back-end. J. Autom. Reasoning, 43(4):363–446, 2009.
[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.
[44]
A. Lochbihler. Making the Java memory model safe. ACM Trans. Program. Lang. Syst., 35(4):12:1–65, 2014.
[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.
[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.
[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.
[48]
L. S. Moss. Parametric corecursion. Theor. Comput. Sci., 260(1-2):139–163, 2001.
[49]
T. Nipkow, L. C. Paulson, and M. Wenzel. Isabelle/HOL: A Proof Assistant for Higher-Order Logic. Springer, 2002.
[50]
L. C. Paulson. Set theory for verification: I. From foundations to functions. J. Autom. Reasoning, 11(3):353–389, 1993.
[51]
L. C. Paulson. Set theory for verification: II. Induction and recursion. J. Autom. Reasoning, 15(2):167–215, 1995.
[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.
[53]
J. C. Reynolds. Types, abstraction and parametric polymorphism. In IFIP ’83, pp. 513–523, 1983.
[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.
[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.
[56]
J. J. M. M. Rutten. Processes as terms: Non-well-founded models for bisimulation. Math. Struct. Comp. Sci., 2(3):257–275, 1992.
[57]
J. J. M. M. Rutten. Universal coalgebra: A theory of systems. Theor. Comput. Sci., 249:3–80, 2000.
[58]
J. J. M. M. Rutten. A coinductive calculus of streams. Math. Struct. Comp. Sci., 15(1):93–147, 2005.
[59]
D. Sangiorgi. On the bisimulation proof method. Math. Struct. Comp. Sci., 8(5):447–479, 1998.
[60]
D. Traytel. {Agda} Agda’s copatterns incompatible with initial algebras, 2014. Archived at https: //lists.chalmers.se/pipermail/agda/2014/006759.html.
[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.
[62]
D. Turi and G. Plotkin. Towards a mathematical operational semantics. In LICS 1997, pp. 280–291. IEEE, 1997.
[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.
[64]
P. Wadler. Theorems for free! In FPCA ’89, pp. 347–359. ACM, 1989.
[65]
G. Winskel. A note on model checking the modal ν-calculus. Theor. Comput. Sci., 83(1):157–167, 1991.

Cited By

View all

Index Terms

  1. Foundational extensible corecursion: a proof assistant perspective

        Recommendations

        Comments

        Please enable JavaScript to view thecomments powered by Disqus.

        Information & Contributors

        Information

        Published In

        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
        • 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
        Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

        Sponsors

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        Published: 29 August 2015

        Permissions

        Request permissions for this article.

        Check for updates

        Author Tags

        1. (Co)recursion
        2. Isabelle
        3. higher-order logic
        4. parametricity
        5. proof assistants

        Qualifiers

        • Research-article

        Funding Sources

        Conference

        ICFP'15
        Sponsor:

        Acceptance Rates

        Overall Acceptance Rate 333 of 1,064 submissions, 31%

        Upcoming Conference

        ICFP '25
        ACM SIGPLAN International Conference on Functional Programming
        October 12 - 18, 2025
        Singapore , Singapore

        Contributors

        Other Metrics

        Bibliometrics & Citations

        Bibliometrics

        Article Metrics

        • Downloads (Last 12 months)9
        • Downloads (Last 6 weeks)1
        Reflects downloads up to 25 Nov 2024

        Other Metrics

        Citations

        Cited By

        View all
        • (2024)Well-Behaved (Co)algebraic Semantics of Regular Expressions in DafnyTheoretical Aspects of Computing – ICTAC 202410.1007/978-3-031-77019-7_3(43-61)Online publication date: 22-Nov-2024
        • (2019)A Consistent Foundation for Isabelle/HOLJournal of Automated Reasoning10.1007/s10817-018-9454-862:4(531-555)Online publication date: 1-Apr-2019
        • (2018)Formalization of the Resolution Calculus for First-Order LogicJournal of Automated Reasoning10.1007/s10817-017-9447-z61:1-4(455-484)Online publication date: 1-Jun-2018
        • (2017)Foundational nonuniform (co)datatypes for higher-order logicProceedings of the 32nd Annual ACM/IEEE Symposium on Logic in Computer Science10.5555/3329995.3330006(1-12)Online publication date: 20-Jun-2017
        • (2017)Contract-based resource verification for higher-order functions with memoizationACM SIGPLAN Notices10.1145/3093333.300987452:1(330-343)Online publication date: 1-Jan-2017
        • (2017)Contract-based resource verification for higher-order functions with memoizationProceedings of the 44th ACM SIGPLAN Symposium on Principles of Programming Languages10.1145/3009837.3009874(330-343)Online publication date: 1-Jan-2017
        • (2017)Foundational nonuniform (Co)datatypes for higher-order logic2017 32nd Annual ACM/IEEE Symposium on Logic in Computer Science (LICS)10.1109/LICS.2017.8005071(1-12)Online publication date: Jun-2017
        • (2017)Interactive programming in Agda – Objects and graphical user interfacesJournal of Functional Programming10.1017/S095679681600031927Online publication date: 6-Feb-2017
        • (2017)Soundness and Completeness Proofs by Coinductive MethodsJournal of Automated Reasoning10.1007/s10817-016-9391-358:1(149-179)Online publication date: 1-Jan-2017
        • (2017)Foundational (Co)datatypes and (Co)recursion for Higher-Order LogicFrontiers of Combining Systems10.1007/978-3-319-66167-4_1(3-21)Online publication date: 29-Aug-2017
        • Show More Cited By

        View Options

        Login options

        View options

        PDF

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader

        Media

        Figures

        Other

        Tables

        Share

        Share

        Share this Publication link

        Share on social media