Capretta’s delay monad can be used to model partial computations, but it has the “wrong” notion of built-in equality, strong bisimilarity. An alternative is to quotient the delay monad by the “right” notion of equality, weak bisimilarity. However, recent work by Chapman et al. suggests that it is impossible to define a monad structure on the resulting construction in common forms of type theory without assuming (instances of) the axiom of countable choice.
Using an idea from homotopy type theory—a higher inductive-inductive type—we construct a partiality monad without relying on countable choice. We prove that, in the presence of countable choice, our partiality monad is equivalent to the delay monad quotiented by weak bisimilarity. Furthermore we outline several applications.
We thank Gershom Bazerman, Paolo Capriotti, Bernhard Reus, and Bas Spitters for interesting discussions and pointers to related work, and the anonymous reviewers for useful feedback. The work presented in Sect. 3.3 was done in collaboration with Paolo Capriotti.
- 1.Altenkirch, T., Kaposi, A.: Type theory in type theory using quotient inductive types. In: Proceedings of the 43rd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2016, pp. 18–29 (2016). doi: 10.1145/2837614.2837638
- 2.Altenkirch, T., Capriotti, P., Dijkstra, G., Nordvall Forsberg, F.: Quotient inductive-inductive types. Preprint arXiv:1612.02346v1 [cs.LO] (2016)
- 3.Altenkirch, T., Danielsson, N.A., Kraus, N.: Code related to the paper “Partiality, revisited: The partiality monad as a quotient inductive-inductive type” (2017). Agda code, http://www.cse.chalmers.se/~nad/
- 4.Awodey, S., Gambino, N., Sojakova, K.: Inductive types in homotopy type theory. In: 2012 27th Annual ACM/IEEE Symposium on Logic in Computer Science (LICS), pp. 95–104 (2012). doi: 10.1109/LICS.2012.21
- 7.Capretta, V., Altenkirch, T., Uustalu, T.: Partiality is an effect. Slides for a talk given by Uustalu at the 22nd Meeting of IFIP Working Group 2.8 (2005). http://www.cs.ox.ac.uk/ralf.hinze/WG2.8/22/slides/tarmo.pdf
- 9.Cockx, J., Abel, A.: Sprinkles of extensionality for your vanilla type theory. In: TYPES 2016, Types for Proofs and Programs, 22nd Meeting, Book of Abstracts (2016). http://www.types2016.uns.ac.rs/images/abstracts/cockx.pdf
- 10.Coquand, T., Mannaa, B., Ruch, F.: Stack semantics of type theory. Preprint arXiv:1701.02571v1 [cs.LO] (2017)
- 11.Danielsson, N.A.: Operational semantics using the partiality monad. In: Proceedings of the 17th ACM SIGPLAN International Conference on Functional Programming, ICFP 2012, pp. 127–138 (2012). doi: 10.1145/2364527.2364546
- 12.Dijkstra, G.: Quotient inductive-inductive definitions. Ph.D. thesis, University of Nottingham (2017). In preparationGoogle Scholar
- 13.Gilbert, G.: Formalising real numbers in homotopy type theory. In: Proceedings of the 6th ACM SIGPLAN Conference on Certified Programs and Proofs, CPP 2017, pp. 112–124 (2017). doi: 10.1145/3018610.3018614
- 14.Hofmann, M.: Extensional concepts in intensional type theory. Ph.D. thesis, University of Edinburgh (1995)Google Scholar
- 16.Li, N.: Quotient types in type theory. Ph.D. thesis, University of Nottingham (2015)Google Scholar
- 18.Richman, F.: Constructive mathematics without choice. In: Schuster, P., Berger, U., Osswald, H. (eds.) Reuniting the Antipodes – Constructive and Nonstandard Views of the Continuum. Synthese Library, vol. 306, pp. 199–205. Springer Science+Business Media, Dordrecht (2001). doi: 10.1007/978-94-015-9757-9_17 CrossRefGoogle Scholar
- 19.Sojakova, K.: Higher inductive types as homotopy-initial algebras. In: Proceedings of the 42nd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2015, pp. 31–42 (2015). doi: 10.1145/2676726.2676983
- 20.The Univalent Foundations Program: Homotopy Type Theory: Univalent Foundations of Mathematics, 1st edn. (2013). https://homotopytypetheory.org/book/