skip to main content
research-article
Open Access

Bisimulation as path type for guarded recursive types

Published:02 January 2019Publication History
Skip Abstract Section

Abstract

In type theory, coinductive types are used to represent processes, and are thus crucial for the formal verification of non-terminating reactive programs in proof assistants based on type theory, such as Coq and Agda. Currently, programming and reasoning about coinductive types is difficult for two reasons: The need for recursive definitions to be productive, and the lack of coincidence of the built-in identity types and the important notion of bisimilarity.

Guarded recursion in the sense of Nakano has recently been suggested as a possible approach to dealing with the problem of productivity, allowing this to be encoded in types. Indeed, coinductive types can be encoded using a combination of guarded recursion and universal quantification over clocks. This paper studies the notion of bisimilarity for guarded recursive types in Ticked Cubical Type Theory, an extension of Cubical Type Theory with guarded recursion. We prove that, for any functor, an abstract, category theoretic notion of bisimilarity for the final guarded coalgebra is equivalent (in the sense of homotopy type theory) to path equality (the primitive notion of equality in cubical type theory). As a worked example we study a guarded notion of labelled transition systems, and show that, as a special case of the general theorem, path equality coincides with an adaptation of the usual notion of bisimulation for processes. In particular, this implies that guarded recursion can be used to give simple equational reasoning proofs of bisimilarity. This work should be seen as a step towards obtaining bisimilarity as path equality for coinductive types using the encodings mentioned above.

Skip Supplemental Material Section

Supplemental Material

a4-veltri.webm

References

  1. Andreas Abel, Stephan Adelsberger, and Anton Setzer. 2017. Interactive programming in Agda - Objects and graphical user interfaces. J. Funct. Program. 27 (2017), e8.Google ScholarGoogle ScholarCross RefCross Ref
  2. Jirí Adámek, Paul Blain Levy, Stefan Milius, Lawrence S. Moss, and Lurdes Sousa. 2015. On Final Coalgebras of Power-Set Functors and Saturated Trees - To George Janelidze on the Occasion of His Sixtieth Birthday. Applied Categorical Structures 23, 4 (2015), 609–641.Google ScholarGoogle ScholarCross RefCross Ref
  3. Benedikt Ahrens, Paolo Capriotti, and Régis Spadotti. 2015. Non-Wellfounded Trees in Homotopy Type Theory. In 13th International Conference on Typed Lambda Calculi and Applications, TLCA 2015, July 1-3, 2015, Warsaw, Poland (LIPIcs), Thorsten Altenkirch (Ed.), Vol. 38. Schloss Dagstuhl - Leibniz-Zentrum fuer Informatik, 17–30.Google ScholarGoogle Scholar
  4. Andrew W. Appel and David A. McAllester. 2001. An indexed model of recursive types for foundational proof-carrying code. ACM Trans. Program. Lang. Syst. 23, 5 (2001), 657–683. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Robert Atkey and Conor McBride. 2013. Productive coprogramming with guarded recursion. In ACM SIGPLAN International Conference on Functional Programming, ICFP’13, Boston, MA, USA - September 25 - 27, 2013, Greg Morrisett and Tarmo Uustalu (Eds.). ACM, 197–208. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Patrick Bahr, Hans Bugge Grathwohl, and Rasmus Ejlers Møgelberg. 2017. The clocks are ticking: No more delays!. In 32nd Annual ACM/IEEE Symposium on Logic in Computer Science, LICS 2017, Reykjavik, Iceland, June 20-23, 2017. IEEE Computer Society, 1–12.Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Marc Bezem, Thierry Coquand, and Simon Huber. 2013. A Model of Type Theory in Cubical Sets. In 19th International Conference on Types for Proofs and Programs, TYPES 2013, April 22-26, 2013, Toulouse, France (LIPIcs), Ralph Matthes and Aleksy Schubert (Eds.), Vol. 26. Schloss Dagstuhl - Leibniz-Zentrum fuer Informatik, 107–128.Google ScholarGoogle Scholar
  8. Lars Birkedal, Ales Bizjak, Ranald Clouston, Hans Bugge Grathwohl, Bas Spitters, and Andrea Vezzosi. 2016. Guarded Cubical Type Theory: Path Equality for Guarded Recursion. In 25th EACSL Annual Conference on Computer Science Logic, CSL 2016, August 29 - September 1, 2016, Marseille, France (LIPIcs), Jean-Marc Talbot and Laurent Regnier (Eds.), Vol. 62. Schloss Dagstuhl - Leibniz-Zentrum fuer Informatik, 23:1–23:17.Google ScholarGoogle Scholar
  9. Lars Birkedal, Rasmus Ejlers Møgelberg, Jan Schwinghammer, and Kristian Støvring. 2012. First steps in synthetic guarded domain theory: step-indexing in the topos of trees. Logical Methods in Computer Science 8, 4 (2012). Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Aleš Bizjak, Lars Birkedal, and Marino Miculan. 2014. A Model of Countable Nondeterminism in Guarded Type Theory. In Rewriting and Typed Lambda Calculi - Joint International Conference, RTA-TLCA 2014, Held as Part of the Vienna Summer of Logic, VSL 2014, Vienna, Austria, July 14-17, 2014. Proceedings (Lecture Notes in Computer Science), Gilles Dowek (Ed.), Vol. 8560. Springer, 108–123.Google ScholarGoogle ScholarCross RefCross Ref
  11. Ales Bizjak, Hans Bugge Grathwohl, Ranald Clouston, Rasmus Ejlers Møgelberg, and Lars Birkedal. 2016. Guarded Dependent Type Theory with Coinductive Types. In Foundations of Software Science and Computation Structures - 19th International Conference, FOSSACS 2016, Held as Part of the European Joint Conferences on Theory and Practice of Software, ETAPS 2016, Eindhoven, The Netherlands, April 2-8, 2016, Proceedings, Bart Jacobs and Christof Löding (Eds.). Springer, 20–35.Google ScholarGoogle Scholar
  12. Edwin Brady. 2016. Type-driven Development with Idris. Manning Publications Company.Google ScholarGoogle Scholar
  13. Cyril Cohen, Thierry Coquand, Simon Huber, and Anders Mörtberg. 2018. Cubical Type Theory: A Constructive Interpretation of the Univalence Axiom. In 21st International Conference on Types for Proofs and Programs (TYPES 2015) (Leibniz International Proceedings in Informatics (LIPIcs)), Tarmo Uustalu (Ed.), Vol. 69. Schloss Dagstuhl–Leibniz-Zentrum fuer Informatik, Dagstuhl, Germany, 5:1–5:34.Google ScholarGoogle Scholar
  14. Thierry Coquand. 1993. Infinite Objects in Type Theory. In Types for Proofs and Programs, International Workshop TYPES’93, Nijmegen, The Netherlands, May 24-28, 1993, Selected Papers (Lecture Notes in Computer Science), Henk Barendregt and Tobias Nipkow (Eds.), Vol. 806. Springer, 62–78. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Thierry Coquand, Simon Huber, and Anders Mörtberg. 2018. On Higher Inductive Types in Cubical Type Theory. In Proceedings of the 33rd Annual ACM/IEEE Symposium on Logic in Computer Science, LICS 2018, Oxford, UK, July 09-12, 2018, Anuj Dawar and Erich Grädel (Eds.). ACM, 255–264. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Nils Anders Danielsson. 2018. Up-to techniques using sized types. PACMPL 2, POPL (2018), 43:1–43:28. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Peter Dybjer. 1996. Internal Type Theory. In Types for Proofs and Programs, International Workshop TYPES’95, Torino, Italy, June 5-8, 1995, Selected Papers (Lecture Notes in Computer Science), Stefano Berardi and Mario Coppo (Eds.), Vol. 1158. Springer, 120–134. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Dan Frumin, Herman Geuvers, Léon Gondelman, and Niels van der Weide. 2018. Finite sets in homotopy type theory. In Proceedings of the 7th ACM SIGPLAN International Conference on Certified Programs and Proofs, CPP 2018, Los Angeles, CA, USA, January 8-9, 2018, June Andronick and Amy P. Felty (Eds.). ACM, 201–214. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Matthew Hennessy and Robin Milner. 1980. On Observing Nondeterminism and Concurrency. In Automata, Languages and Programming, 7th Colloquium, Noordweijkerhout, The Netherlands, July 14-18, 1980, Proceedings (Lecture Notes in Computer Science), J. W. de Bakker and Jan van Leeuwen (Eds.), Vol. 85. Springer, 299–309. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Claudio Hermida and Bart Jacobs. 1998. Structural Induction and Coinduction in a Fibrational Setting. Inf. Comput. 145, 2 (1998), 107–152. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. John Hughes, Lars Pareto, and Amr Sabry. 1996. Proving the Correctness of Reactive Systems Using Sized Types. In Conference Record of POPL’96: The 23rd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, Papers Presented at the Symposium, St. Petersburg Beach, Florida, USA, January 21-24, 1996, Hans-Juergen Boehm and Guy L. Steele Jr. (Eds.). ACM Press, 410–423. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Bart Jacobs. 2016. Introduction to Coalgebra: Towards Mathematics of States and Observation. Cambridge Tracts in Theoretical Computer Science, Vol. 59. Cambridge University Press.Google ScholarGoogle Scholar
  23. Ralf Jung, Robbert Krebbers, Jacques-Henri Jourdan, Aleš Bizjak, Lars Birkedal, and Derek Dreyer. 2018. Iris from the ground up. (2018). https://people.mpi- sws.org/~dreyer/papers/iris- ground- up/paper.pdfGoogle ScholarGoogle Scholar
  24. Alexander Kurz and Jiri Velebil. 2016. Relation lifting, a survey. J. Log. Algebr. Meth. Program. 85, 4 (2016), 475–499.Google ScholarGoogle ScholarCross RefCross Ref
  25. Xavier Leroy. 2006. Formal certification of a compiler back-end or: programming a compiler with a proof assistant. In Proceedings of the 33rd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2006, Charleston, South Carolina, USA, January 11-13, 2006, J. Gregory Morrisett and Simon L. Peyton Jones (Eds.). ACM, 42–54. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Saunders MacLane and Ieke Moerdijk. 2012. Sheaves in geometry and logic: A first introduction to topos theory. Springer Science & Business Media.Google ScholarGoogle Scholar
  27. Bassel Mannaa and Rasmus Ejlers Møgelberg. 2018. The Clocks They Are Adjunctions Denotational Semantics for Clocked Type Theory. In 3rd International Conference on Formal Structures for Computation and Deduction, FSCD 2018, July 9-12, 2018, Oxford, UK (LIPIcs), Hélène Kirchner (Ed.), Vol. 108. Schloss Dagstuhl–Leibniz-Zentrum fuer Informatik, 23:1–23:17.Google ScholarGoogle Scholar
  28. Robin Milner. 1980. A Calculus of Communicating Systems. Lecture Notes in Computer Science, Vol. 92. Springer. Google ScholarGoogle Scholar
  29. Robin Milner. 1983. Calculi for Synchrony and Asynchrony. Theor. Comput. Sci. 25 (1983), 267–310.Google ScholarGoogle ScholarCross RefCross Ref
  30. Robin Milner. 1999. Communicating and mobile systems: the pi calculus. Cambridge University Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. R. E. Møgelberg. 2014. A type theory for productive coprogramming via guarded recursion. In CSL-LICS. 71:1–71:10.Google ScholarGoogle Scholar
  32. Rasmus Ejlers Møgelberg and Marco Paviotti. 2016. Denotational semantics of recursive types in synthetic guarded domain theory. In Proceedings of the 31st Annual ACM/IEEE Symposium on Logic in Computer Science, LICS ’16, New York, NY, USA, July 5-8, 2016, Martin Grohe, Eric Koskinen, and Natarajan Shankar (Eds.). ACM, 317–326. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. Hiroshi Nakano. 2000. A Modality for Recursion. In 15th Annual IEEE Symposium on Logic in Computer Science, Santa Barbara, California, USA, June 26-29, 2000. IEEE Computer Society, 255–266. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. Ian Orton and Andrew M. Pitts. 2016. Axioms for Modelling Cubical Type Theory in a Topos. In 25th EACSL Annual Conference on Computer Science Logic, CSL 2016, August 29 - September 1, 2016, Marseille, France (LIPIcs), Jean-Marc Talbot and Laurent Regnier (Eds.), Vol. 62. Schloss Dagstuhl - Leibniz-Zentrum fuer Informatik, 24:1–24:19.Google ScholarGoogle Scholar
  35. Damien Pous and Davide Sangiorgi. 2012. Enhancements of the bisimulation proof method. In Advanced Topics in Bisimulation and Coinduction, Davide Sangiorgi and Jan Rutten (Eds.). Cambridge University Press.Google ScholarGoogle Scholar
  36. Jan J. M. M. Rutten. 2000. Universal coalgebra: a theory of systems. Theor. Comput. Sci. 249, 1 (2000), 3–80. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. Daniel Schwencke. 2010. Coequational logic for accessible functors. Inf. Comput. 208, 12 (2010), 1469–1489. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. Arnaud Spiwack and Thierry Coquand. 2010. Constructively Finite? In Contribuciones científicas en honor de Mirian Andrés Gómez, Laureano Lambán Pardo, Ana Romero Ibáñez, and Julio Rubio García (Eds.). Universidad de La Rioja, 217–230.Google ScholarGoogle Scholar
  39. Sam Staton. 2009. Relating Coalgebraic Notions of Bisimulation. In Algebra and Coalgebra in Computer Science, Third International Conference, CALCO 2009, Udine, Italy, September 7-10, 2009. Proceedings (Lecture Notes in Computer Science), Alexander Kurz, Marina Lenisa, and Andrzej Tarlecki (Eds.), Vol. 5728. Springer, 191–205. Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. The Agda Team. 2018. The Agda wiki. (2018). http://wiki.portal.chalmers.se/agda/ .Google ScholarGoogle Scholar
  41. The Project Everest Team. 2018. The Everest Project. (2018). https://project- everest.github.io/ .Google ScholarGoogle Scholar
  42. The Univalent Foundations Program. 2013. Homotopy Type Theory: Univalent Foundations of Mathematics. https: //homotopytypetheory.org/book , Institute for Advanced Study.Google ScholarGoogle Scholar
  43. Niccolò Veltri. 2017. A Type-Theoretical Study of Nontermination. Ph.D. Dissertation. Tallinn University of Technology. https://digi.lib.ttu.ee/i/?7631Google ScholarGoogle Scholar
  44. Andrea Vezzosi. 2017. Streams for Cubical Type Theory. (2017). http://www.cse.chalmers.se/~vezzosi/streams- ctt.pdfGoogle ScholarGoogle Scholar

Index Terms

  1. Bisimulation as path type for guarded recursive types

        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

        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!